Stream: implementers
Topic: Workflow Actions with Task resources
Felix Dommes (Dec 08 2021 at 11:46):
Hi, we have a few questions regarding the usage of Tasks in RequestGroup.actions. We instantiate RequestGroups from PlanDefinitions and are copying most of the action attributes, but we also create a Task resource. We are using Tasks in actions to execute the specific actions and reference these in the resource field.
However, we are unsure about a few things:
When instantiating the RequestGroup from a PlanDefinition, does the Task resource need to be created immediately or is it also allowed to create actions "at runtime", when they're ready to be executed?
How is the resource field to be used when the timing field includes intervalled execution? We were thinking of creating a new Task resource for every iteration, so we can check on its status. That means we have to use sub-actions to store the Tasks. Is this the intended way?
Thank you in advance :)
Lloyd McKenzie (Dec 08 2021 at 14:16):
RequestGroup (and the referenced Requests) represents a single monolithic inseparable 'order'. As with any order, there can be more than one Task to seek fulfillment of the order and the Tasks can be initiated at any time after the order is activated. The Tasks can qualify 'how much' of the order fulfillment is sought for (e.g. by time or quantity), though qualifying by quantity probably doesn't make sense for a RequestGroup. Also, you generally wouldn't have Tasks seeking fulfillment of different sub-Requests of the RequestGroup given that it's monolithic and can have only one status. (i.e. it needs to be active, on-hold or complete as a 'collective'). You're also free to create sub-Tasks beneath your original fulfillment Task if that's useful.
Felix Dommes (Jan 25 2022 at 09:45):
Thank you for the fast answer, sorry for coming back to it so late!
So if I understood correctly, Tasks should in general be created at RequestGroup creation. However I am afraid I don't fully understand the answer and should clarify the question:
If a RequestGroup.action includes intervalled execution via the timingTiming attribute (repeat with frequency), should this result in a new Task resource for every execution or should the Task somehow cover all iterations? I don't see the possibility to define interval-based execution in Tasks, so is it the former?
Lloyd McKenzie (Jan 25 2022 at 18:26):
You create Tasks asking for fulfillment of some sort of Request. You could point to the overall RequestGroup or you could point to sub-requests referred to by RequestGroup.action.resource. Within Task, you can also choose to filter to a more limited timeframe. If there are any repetitions, that's handled either by the base Request or by creating distinct tasks per repetition.
Johannes Becker (Jan 27 2022 at 15:59):
or by creating distinct tasks per repetition.
Thanks for the clarification. Just to be sure: Creating new Tasks per RequestGroup.action.timingTiming repetition and referencing them as sub-action in the existing RequestGroup's respective action.resource would be OK?
Last updated: Apr 12 2022 at 19:14 UTC