Resuming a task within switch executes all tasks in hierarchy of parent switch
Opened this issue · 0 comments
I am executing the following yaml
label: one-level-switch
inputs:
-
name: idType
label: Type of Id - User/Service
type: string
required: true -
name: retainId
label: Name of IdType
type: string
required: true -
name: leadApproval
label: Platform Lead Approval
type: string
required: true -
name: targetServerIP
label: Target Server IP
type: string
required: true -
name: requestorId
label: Requestor Id
type: string
required: true -
name: wfRequestId
label: WorkFlow Id
type: string
required: true -
name: transactionType
label: Transaction Type
type: string
required: true -
name: requestId
label: Request Id
type: string
required: true
outputs:
- name: myMagicNumber
value: ${randomNumber}
tasks:
-
label: Is ServiceId configured
name: serviceIdOutcome
type: jio/ngo/checkIdConfiguration
id_type: service
retainId: ${retainId }
wfRequestId: ${wfRequestId}
exec: async
route:
endpoint: /people/myspan/checkIdConfiguration
endpointType: REST
inbox:
stat:
checkIdOutput: ${checkIdOutput} -
label: Print a greeting 1
type: io/print
text: At ${serviceIdOutcome.checkIdOutput} - ${serviceIdOutcome} -
label: Service Switch
type: switch
expression: ${serviceIdOutcome.checkIdOutput}
cases:-
key: Y
tasks:- label: Print a greeting
type: io/print
text: No Change
- label: Print a greeting
-
key: N
tasks:-
label: Domain Lead Approval
name: domainLeadApproval
type: jio/ngo/DomainLeadApproval
requestId: ${requestorId}
inbox: Domain-Lead-Inbox
userId: ${requestorId}
domainLeadOutcome: ${domainLeadOutcome}
approver: ${leadApproval} -
type: jio/ngo/id/ProfileChange
label: Profile Change On Target Server
text: Profile Change On Target Server
serverIp: ${targetServerIP}
retainId: ${retainId }
wfRequestId: ${wfRequestId}
exec: async
route:
endpoint: /people/myspan/profileChange
endpointType: REST
inbox:
stat:
default:
-
-
tasks:
- label: Print a greeting
type: io/print
text: ServiceId Default Case
- label: Print a greeting
-
-
name: updateIdMaster
type: jio/ngo/CloseTransaction
value: "Pre: ${message}"
url: api-url(to be put)
requestId: ${requestId}
domainLeadResponse: ${domainLeadApproval.domainLeadOutcome}
exec: async
route:
endpoint: /people/myspan/updateIdMasterAndSendMail
endpointType: REST
inbox:
stat:
I am facing below errors -
- Firstly the resolution of variable "serviceIdOutcome.checkIdOutput" is uneven. It sometimes resolves sometimes not.
- Secondly I am pausing task( using cordinator.stop() ) at intermediate level (in my case - Domain Lead Approval ) for approval as per my requirement. When i resume task at this stage, the workflow executes once again from start( Which is incorrect in terms of execution, Ideally it should complete my existing task and move on to next one.)
- Third, if I have multiple switch cases , each task in switch starts with taskNumber 1. So as in "task_exection" table for task "Is ServiceId configured" we have tasknumber as 1 and also for "Domain Lead Approval" we have taskNumber 1. Ideally it should be incremental one, which is also one of the case in which my workflow fails to execute in expected flow.