conductor task 可以设置返回状态,包括 IN_PROGRESS, FAILED, FAILED_WITH_TERMINAL_ERROR, COMPLETED
默认是COMPLETED。
PS:同时可以同setReasonForIncompletion 设置错误原因。
FAILED_WITH_TERMINAL_ERRORFAILED_WITH_TERMINAL_ERROR 返回错误并且终止;不会进行retry,即task定义里面的retry相关配置不起作用
FAILEDFAILED 的时候task相关retry配置:
{
"name": "leaderRatify",
"retryCount": 3,
...
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 600,
"responseTimeoutSeconds": 1200
},
是会起作用的。
try次数都使用完毕后整个workflow才会进入fail状态
如果一个task的optional设置为true,FAILED的时候整个workflow还会继续,同时workflow的状态是completed。
以下为workflow配置
{
"updateTime": 1540448903202,
"name": "LeaveWithOptionTrue",
"description": "a demo for workflow",
"ownerEmail": "test@qq.com",
"version": 2,
"workflowStatusListenerEnabled": true,
"tasks": [
{
"name": "leaderRatify",
"taskReferenceName": "leaderRatify",
"inputParameters": {
"staffName": "${workflow.input.staffName}",
"staffDepartment": "${workflow.input.staffDepartment}"
},
"optional": true,
"type": "SIMPLE",
"startDelay": 1
},
{
"name": "managerRatify",
"taskReferenceName": "managerRatify",
"inputParameters": {
"managerName": "${leaderRatify.output.leaderName}",
"managerDepartment": "${leaderRatify.output.leaderDepartment}"
},
"optional": true,
"type": "SIMPLE",
"startDelay": 0
}
],
"outputParameters": {
"leaderName": "${leaderRatify.output.leaderName}",
"leaderDepartment": "${leaderRatify.output.leaderDepartment}",
"managerAgree": "${managerRatify.output.managerAgree}",
"managerDisagree": "${managerRatify.output.managerDisagree}",
"inputArgs": "${managerRatify.output.inputArgs}"
},
"restartable": true,
"schemaVersion": 2
}
ps:task的定义是可以随时更新,无版本号



