Conductor: Is Expression supported in Decision System task?

Created on 21 Feb 2018  路  7Comments  路  Source: Netflix/conductor

Hi @v1r3n ,
Can you let me know if the expression support is added in Decision Task? Something like ${workflow.input.number}%2=0
(This may be a continuation to defect https://github.com/Netflix/conductor/issues/161 )

Thanks.

question

Most helpful comment

@jagadeeshb22 In case you hadn't found an example yet, here's one I'm using:

{
            "name": "verifyCreditDecision",
            "taskReferenceName": "verifyCreditDecision",
            "inputParameters": {
              "taskStatus": "${Get_Workflow_Details.output.response.body.tasks[?(@.referenceTaskName == 'Verify_Credit' && @.status == 'COMPLETED')].status}"
            },
            "type": "DECISION",
            "caseExpression": "$.taskStatus.length > 0 ? 'Task Completed' : 'Task Not Completed'",
            "defaultCase": [
              {
                "name": "verifyCreditNotExecutedSoNotCompensating",
                "taskReferenceName": "verifyCreditNotExecuted",
                "inputParameters": {
                },
                "type": "EVENT",
                "sink": "conductor"
              }
            ],
            "decisionCases": {
              "Task Completed": [
                {...

All 7 comments

@ReddySrini Yes. You can use caseExpression with a javascript to achieve this.
The output of the expression evaluation should be the case branches.

@ReddySrini ,
Can you please give an example using the caseExpression with javascript to achieve this.

@jagadeeshb22 In case you hadn't found an example yet, here's one I'm using:

{
            "name": "verifyCreditDecision",
            "taskReferenceName": "verifyCreditDecision",
            "inputParameters": {
              "taskStatus": "${Get_Workflow_Details.output.response.body.tasks[?(@.referenceTaskName == 'Verify_Credit' && @.status == 'COMPLETED')].status}"
            },
            "type": "DECISION",
            "caseExpression": "$.taskStatus.length > 0 ? 'Task Completed' : 'Task Not Completed'",
            "defaultCase": [
              {
                "name": "verifyCreditNotExecutedSoNotCompensating",
                "taskReferenceName": "verifyCreditNotExecuted",
                "inputParameters": {
                },
                "type": "EVENT",
                "sink": "conductor"
              }
            ],
            "decisionCases": {
              "Task Completed": [
                {...

@patrickbadley -- Awesome. Thank you..!
How can we get the output of the 'Task Completed' case.
Do we need to use it's task reference name in the output?
It could be great if you provide that information as well.

In simple words ---- How can we get the execute task output?
The sample issue is - #566

@cyzhao,
Do you have any idea on this?

+1

@jagadeeshb22 is there any resolution?

@sev7nf -
Yes, there is a solution to get the executed output. For that we need to remove the "outputParameters" field in workflow definition. so that, the output will come from the last executed task automatically as per the netflix documentation -- https://netflix.github.io/conductor/metadata/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HardiChandra picture HardiChandra  路  3Comments

RemcoBuddelmeijer picture RemcoBuddelmeijer  路  6Comments

mrik974 picture mrik974  路  5Comments

yosiat picture yosiat  路  4Comments

eder-santos picture eder-santos  路  5Comments