Profiles as workflow master (examples)

So far we have looked at everything from the perspective of workflows. But we can also turn this around, i.e. we use a profile and start one or more workflows in it with function start new workflow(). In principle, the profile then has a sub workflow.

Here, too, you can then work with function workflow exists() in the further course or also trigger sleeping states with function fire workflow-event() (see following example).

Please note the slightly different way in which variables are passed from profiles to workflows.

Triggering sleeping states


We recall the first example from section Interactive Workflows. There we said that we have to externally step through the transitions from state to state.

And that's what we do now with a profile. The profile starts the workflow, waits 20 seconds, triggers the automatic transition check, waits 20 seconds, triggers the automatic transition check again, and then terminates.

Start the profile and look at the behaviour of the workflow job.


Import: (instructions)

Profile-My_Master_1.pak

Workflow_WF_interactive_1.obj

images/download/attachments/137309123/WF_interactive_1-version-1-modificationdate-1688714407833-api-v2.png

Triggering cyclical transition check of a specific transition externally


In the next example, we want to illustrate a setting from transitions again (→ Retry after).


Import: (instructions)

Profile-My_Master_2.pak

Workflow_My_Slave.obj


images/download/attachments/137309123/myslave-version-1-modificationdate-1688714407837-api-v2.png


Start the profile. The profile then starts the workflow and waits for 30 seconds. Transition 2 is then triggered specifically (has setting Retry after 1 minute).

In the workflow we see that state Start has set the automatic transition check and a waiting time of 3 minutes. So as soon as the state is entered, the automatic transition check is triggered (all transitions) and from then on (until the end of the waiting time) the cyclical automatic transition check (all transitions) is active.

However, after the specific transition check for Transition 2 has been triggered from the profile after 30 seconds, only this one transition is checked cyclically from this point on.

Just take a look at the log after the workflow job is finished.

The example here is the most complicated variant. The whole thing also works if state Start has no waiting time (then there is only the initial automatic transition check of all transitions and afterwards only the cyclical check of Transition 2) or if it is a sleeping state (then there is only the cyclical check of Transition 2).