conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Dynamic name of field TaskReferenceName

Open nicoSalsa opened this issue 9 years ago • 3 comments

Hello,

It seems not possible to make field TaskReferenceName dynamic, which could be really helpfull. For example, i would like something like this:

{ "name": "sub_workflow_claim", "description": "A simply wait external workflow", "version": 1, "tasks": [ { "taskReferenceName": "${workflow.input.motif}_order_start", "name": "Order_start", "type": "SIMPLE", "startDelay": 0 }, { "taskReferenceName": "${workflow.input.motif}_order_end", "name": "Order_end", "type": "SIMPLE", "startDelay": 0 } ], "schemaVersion": 2 }

Regards,

nicoSalsa avatar Jun 16 '17 09:06 nicoSalsa

Could you provide some more context on why the reference name needs to be dynamic, can the same be achieved with static reference name?

v1r3n avatar Jun 21 '17 18:06 v1r3n

If we take the example of a claim in a bank. It may concern a lot of things (problem of cash, credit card, bank transfer...) There are a lot of cases. For each case, i need to make an endpoint call to trigger external workflow. This call depends on the reason of the claim and i would like to see quickly and easily, on my workflow's design, the reason of the claim. I think that making dynamical the field "TaskReferenceName" may be a good solution. Maybe you will say me to make a decision task but there are really too many cases to design it.

nicoSalsa avatar Jun 26 '17 14:06 nicoSalsa

Isn't taskReferenceName supposed to be globally unique? @v1r3n can likely correct this, but I have understood it to be the specific reference to a given step in a workflow definition. If you want to reuse the same step over and over, you'd have different taskReferenceName values but the same name value, as the name refers to the WorkflowTask definition that has the blueprint for the given task you're trying to re-use.

Sounds like you could register your own WorkflowSystemTask and WorkflowTask definition, pass the variable in as an input parameter, and have your custom WorkflowSystemTask run the logic for making a call to the external workflow based off your own rules.

You could then back that with a dynamic task based off the output of your custom task so it will run the correct Order_end task logic that you want.

mashurex avatar Jul 29 '17 05:07 mashurex