GithubHelp home page GithubHelp logo

Comments (6)

knipknap avatar knipknap commented on July 21, 2024

The TRIGGERED state has been replaced by an attribute. ee8a620

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

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:

  • _update_state() and _update_state_hook(): Should be merged with _predict()/_predict_hook(). Call the resulting methods _update() and _update_hook().
    _update() recursively updates the derivation tree as well as it can given the currently available information. That means it will add or remove children from the derivation tree, AND update the status of all children.
  • _try_fire() methods: Renamed to _start(), those should do the work, update the status of the directly associated task spec, and initiate a call to _update() when there is reason to believe that the derivation tree may be affected. This method does NOT change the status of any other task, nor does it change the structure of the derivation tree. An exception is when the purpose of the task is to trigger or cancel a target, in which case this method may change the status of the target before calling update().
  • _trigger() methods: Just like _start(), except they may also change the status of the triggered task.
  • _on_complete() methods: Renamed to _confirm(). They do not change the derivation tree, and do not change the tree's status.
  • _on_ready() methods: TBD. They may not change the status of the triggered task.
  • _on_cancel(): TBD

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

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

from spiffworkflow.

ziadsawalha avatar ziadsawalha commented on July 21, 2024

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

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

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

  • Allow for trying the task again, or
  • allow to continue as if the task was successful, or
  • do not allow to continue with the branch.

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

  • If the task is to be tried again, go to FUTURE or WAITING,
  • if the task may continue, go to COMPLETED,
  • else go to CANCELLED.

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?

from spiffworkflow.

knipknap avatar knipknap commented on July 21, 2024

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.

from spiffworkflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.