flowsforapex / apex-flowsforapex

Flows for APEX - Model and run process flows all within Oracle APEX!
https://flowsforapex.org
Other
81 stars 41 forks source link

Declarative Process Variables #171

Closed rallen2010 closed 3 years ago

rallen2010 commented 3 years ago

The process variable system introduced in v5.0 provides an enabling capability that creates persistent storage of process stage for the life of a process. We introduced methods for these variables to be substituted into userTasks calling APEX pages, to control bpmn gateways, to be accessed in pl/sql in a scriptTask or serviceTask, and to be used in a timer definition. This created an enabling capability for an APEX developer to use PL/QL to persist and access variables throughout a process.

However, the v5.0 process variables require programming rather than being declarative, frequently require additional non-business scriptTask activities to be added into a business process, and are generally not very declarative or low-code.

This feature builds on the existing v5 process variables by allowing any object in the bpmn model to have variable actions declared with it as part of the object properties. Each object definition would have an associated list of variables that are set before the task is executed and after the task is executed. A variable could be set to an expression, which would be:

See attached PPT for further detail, including some use cases and issues. 2201Declarative Process Variables.pptx

rallen2010 commented 3 years ago

I have the basics of this running in the engine now (on feature-variable-expressions). I need some input / opinion on where these are triggered. Adding triggering points in the engine is relatively simple coding, and so the issue here is to get the triggering points that allow users to build powerful process models.

Recap: The idea is that you can have a set of variable expressions called at various places on the model. Each set is a group of 1 or more variable expressions (such as setting a process variable to a static, to another process variable, to a SQL statement, function body, etc.). Each entry in a set of variable expressions has a sequence number, and so the expressions in a set run in sequence order.

Initially, i thought that each object in a process model could have an expression set that executes before the object ('PRE'), and a set that executes after the object ("POST") - but now realise that, for example, POST would cause problems after an opening parallel or inclusive gateway with auto-executed steps like scriptTasks that follow the gateway executing before the gateway has completed.

So the semantics I'm proposing would work like this:

  1. Naming for Task sets: 'pre' and 'post' or 'before task' and 'after task'?
  2. Naming for Gateway Sets: 'pre' and 'post' or 'before split' and 'after merge'?
  3. Naming for Event Sets: 'pre' or 'before event' and 'on event' ?
  4. Any other triggering points that would be useful?
  5. Any problems or issues here on triggering?

Once we get consensus here, we can spec out the UI and parsing requirements. Happy to give a quick demo of what I have working at our Thursday meeting...

rallen2010 commented 3 years ago

And as part of this feature, flow_reset should include resetting (deleting) all process variables when the process is reset. See Issue #219.

rallen2010 commented 3 years ago

Remaining Tasks after 12 Aug Merge:

LouisMoreaux commented 3 years ago

Delivered in version 21.1