Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/multiinstance refactor #292

Merged
merged 13 commits into from Feb 15, 2023
Merged

Conversation

essweine
Copy link
Contributor

This is a complete refactor of how we handle multiinstance tasks. We no longer:

  • use dynamically generated classes
  • copy tasks and insert them into the task tree manually during predict
  • modify the workflow spec while the workflow is in progress (except in the Camunda version)
  • rely on Camnuda extensions in the base package

During parsing, a multiinstance task is added to the spec, with a reference to the original task spec. When the MI task is reached, it changes state to waiting and creates children from the original referenced spec as needed, merges the data from the children into the original task as they are completed, and when all children are complete, moves to ready/complete.

This GREATLY simplifies dealing with multiinstance tasks.

Copy link
Contributor

@jbirddog jbirddog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, lratm (looks really awesome to me).

waiting = []
for sp in subprocesses:
completed = sorted(
[t for t in subprocesses[sp]['tasks'].values() if t['state'] in [32, 64] ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safer/more obvious to use the finished mask?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to leave these as ints, since that's what's in the serialied version.

for sp in [dct] + list(subprocesses.values()):
for task_id, task in sp['tasks'].items():
if task_id in waiting:
task['state'] = 8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing-ish here - TaskState.WAITING?

@sonarcloud
Copy link

sonarcloud bot commented Feb 15, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

93.8% 93.8% Coverage
3.1% 3.1% Duplication

@essweine essweine merged commit 590903f into main Feb 15, 2023
@essweine essweine deleted the feature/multiinstance-refactor branch February 15, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants