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

Improvement/task spec attributes #328

Merged
merged 11 commits into from
May 11, 2023
Merged

Conversation

essweine
Copy link
Contributor

@essweine essweine commented May 11, 2023

This PR includes substantial changes to the package structure and updated bpmn task attributes.

Package structure changes:

  • all of the old bpmn task spec classes have been moved inside mixins
  • inheritance from BpmnSpecMixin has been removed in the task-specific classes
  • default classes that inherit from the mixin classes are in SpiffWorkflow.bpmn.specs.defaults
  • specs that control the workflow but do not appear on the diagram are in SpiffWorkflow.bpmn.specs.control

Removing the BpmnSpecMixin inheritance makes it easier to extend bpmn task behavior without re-implementing task specific behavior.

BPMN Task attribute changes:

  • all bpmn task specs (visible specs and controlling specs that don't appear on the diagram) have the same set of attributes
  • bpmn_id and bpmn_name attributes are set when they are present in the diagram
  • is_engine_step method has been removed in favor of the core task spec attribute manual
  • spec_type method has been removed and the spec description it used to return is now in the description attribute, and configurable via the parser.
  • id attribute has been removed from all task specs

The name attribute is still used internally by Spiff as a unique identifier for a task spec; id was redundant and confusing, so I've removed it (this enforces the distinction between tasks and task specs too --specs have names, tasks have ids). If a spec has a visible diagram element, it will have bpmn_id set; otherwise it will be None.

It makes a lot more sense to set the display name of the spec type at parse time (do you really want to create a subclass just to change this?); these are now determined by the XML element type and configurable in the parser.

The attribute changes should be updated automatically if a workflow with the older format, but to apply changes en masse, the convert_simple_tasks and update_bpmn_attributes functions in SpiffWorkflow.bpmn.serializer.migration.version_1_2.py can be used.

@essweine essweine merged commit 23d54e5 into main May 11, 2023
@essweine essweine deleted the improvement/task-spec-attributes branch May 11, 2023 20:02
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.

2 participants