Skip to content

Commit

Permalink
Add: Split-Join-History
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Dec 10, 2021
1 parent bba0fb0 commit f4b80ae
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ exclude = '''
| dist
)/
'''
[tool.flake8]
max-line-length = 88
select = "C,E,F,W,B,B950"
extend-ignore = "E203, E501"
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ packages = automations
python_requires = >=3.7
install_requires =
Django>=3.0
[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501
[isort]
profile = black
9 changes: 8 additions & 1 deletion src/automations/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def wrapper(self, task, *args, **kwargs):
self.release_lock(task)
self._automation._db.finished = True
self._automation._db.save()
logger.error("Automation failed with error and was aborted", exc_info=True)
logger.error(
"Automation failed with error and was aborted", exc_info=True
)
return None

return wrapper
Expand Down Expand Up @@ -369,6 +371,7 @@ def execute(self, task: models.AutomationTaskModel):
)
for split in self._splits
)
self.store_result(task, "Split", [task.id for task in tasks])
self.leave(task)
for task in tasks:
self._automation.run(
Expand Down Expand Up @@ -401,6 +404,10 @@ def execute(self, task: models.AutomationTaskModel):
if (
len(all_splits) > 1
): # more than one split at the moment: close this split
if task.message == "Join":
self.store_result(task, "Join", task.result + [task.id])
else:
self.store_result(task, "Join", [task.id])
self.leave(task)
return None
return task
Expand Down
7 changes: 3 additions & 4 deletions src/django_automations.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: django-automations
Version: 0.9.3.1
Version: 0.9.4
Summary: Processes and automations for your Django project
Home-page: https://github.com/fsbraun/django-automations
Author: Fabian Braun
Expand Down Expand Up @@ -88,9 +88,8 @@ After installation add the `automations` to your installed apps in `settings.py`

Only include the "sub app" `automations.cms_automations` if you are using Django CMS.

The last step is to create and run the necessary migrations using the `manage.py` command:
The last step is to run the necessary migrations using the `manage.py` command:

pathon manage.py makemigrations automations
python manage.py migrate automations


Expand All @@ -109,7 +108,7 @@ carried out.
from . import forms

class ProcessInput(Automation):
"""The process steps are defiend by sequentially adding the corresponding nodes"""
"""The process steps are defined by sequentially adding the corresponding nodes"""
start = flow.Execute(this.get_user_input) # Collect input a user has supplied
check = flow.If(
this.does_not_need_approval # Need approval?
Expand Down
13 changes: 10 additions & 3 deletions src/django_automations.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ src/automations/apps.py
src/automations/flow.py
src/automations/models.py
src/automations/settings.py
src/automations/tests.py
src/automations/urls.py
src/automations/views.py
src/automations/cms_automations/__init__.py
Expand All @@ -26,31 +25,39 @@ src/automations/cms_automations/migrations/0001_initial.py
src/automations/cms_automations/migrations/0002_auto_20210506_1957.py
src/automations/cms_automations/migrations/0003_auto_20210511_0825.py
src/automations/cms_automations/migrations/0004_auto_20210511_1042.py
src/automations/cms_automations/migrations/0005_auto_20210514_1815.py
src/automations/cms_automations/migrations/0005_auto_20211121_1838.py
src/automations/cms_automations/migrations/__init__.py
src/automations/cms_automations/templates/automations/cms/empty_template.html
src/automations/locale/de_DE/LC_MESSAGES/django.mo
src/automations/locale/de_DE/LC_MESSAGES/django.po
src/automations/management/__init__.py
src/automations/management/commands/__init__.py
src/automations/management/commands/automation_delete_history.py
src/automations/management/commands/automation_step.py
src/automations/migrations/0001_initial.py
src/automations/migrations/0002_auto_20210506_1957.py
src/automations/migrations/0003_auto_20210511_0825.py
src/automations/migrations/0004_auto_20210511_1042.py
src/automations/migrations/0005_automationmodel_key.py
src/automations/migrations/0006_auto_20210514_1815.py
src/automations/migrations/0006_auto_20211121_1357.py
src/automations/migrations/__init__.py
src/automations/templates/automations/base.html
src/automations/templates/automations/dashboard.html
src/automations/templates/automations/form_view.html
src/automations/templates/automations/history.html
src/automations/templates/automations/preformatted_traceback.html
src/automations/templates/automations/task_list.html
src/automations/templates/automations/traceback.html
src/automations/templates/automations/includes/dashboard.html
src/automations/templates/automations/includes/dashboard_item.html
src/automations/templates/automations/includes/form_view.html
src/automations/templates/automations/includes/task_item.html
src/automations/templates/automations/includes/task_list.html
src/automations/templatetags/atm_tags.py
src/automations/tests/__init__.py
src/automations/tests/methods.py
src/automations/tests/models.py
src/automations/tests/test_automations.py
src/django_automations.egg-info/PKG-INFO
src/django_automations.egg-info/SOURCES.txt
src/django_automations.egg-info/dependency_links.txt
Expand Down

0 comments on commit f4b80ae

Please sign in to comment.