sartography / SpiffWorkflow

A powerful workflow engine implemented in pure Python
GNU Lesser General Public License v3.0
1.69k stars 313 forks source link

TaskSpec refactoring #13

Closed knipknap closed 3 years ago

knipknap commented 12 years ago

Some refactoring of the TaskSpec classes seems to be in order:

knipknap commented 12 years ago

The TRIGGERED state has been replaced by an attribute. ee8a620

knipknap commented 12 years ago

A lot of the confusion in TaskSpec comes from the fact that the purpose of the some methods is not defined clearly enough. I did some preliminary work to organize this better and the plan is to implement the following:

knipknap commented 12 years ago

Some TaskSpec objects have a state even though they should not. E.g. Trigger.queued needs a place to store Workflow global data.

ziadsawalha commented 12 years ago

In which state should a task that has experienced an error condition be? There's no error status.

knipknap commented 12 years ago

In general, the control of a workflow allows for three options after a task has started:

The existing states already allow for modeling this behavior, and the task implementation can decide whichever status makes the most sense after an error:

It is possible that adding a specific ERROR state makes some things simpler, but I am not sure how that should affect the flow; either of the above options should still be available. Do you have a specific use case where this would have helped?

knipknap commented 11 years ago

Another refactoring: Some of the BPMN-layer specific code that just landed in master should move into the core object model:

Adding support for Sequence objects may be useful to the core model; the extra place for storing data and docs make sense when creating a UI editor. This may actually allow for merging the BPMN "emulation layer" with the core model: All BPMNSpecs could be converted into standard TaskSpec objects, and used interchangably with SpiffWorkflow's existing model. Similarly, the storage objects could use the standard serializer API.