Workflow Start Event Triggers before Add Asset is complete
Hello,
I have two workflows that trigger one after another using the start event “Asset Added” for asset type Data Issue. My second workflow appears to be triggering before the Data Issue has been entirely created.
My initial workflow is a modified Issue Creation Workflow. This script contains a logger that informs you when the data issue creation is complete.
The second workflow is a modified issue management workflow that starts with a script task that looks for a potential reviewer. There are several “reviewer checks” and loggers in this script that ultimately assign a reviewer. If no reviewer is found, a fall back user is set as the reviewer.
When I run the two workflows in sequence, the second workflow “reviewer checks” and loggers appear to execute before the issue creation logger has executed. The checks return null results, even when they should be positive, because the Data Issue is still being “built”. If I trigger the second workflow manually after the data issue is created, then the workflow works as designed.
I think the issue is with the start event, any advice would be greatly appreciated! Thanks!
arthurburkhardt
·5 years ago · EditedProbably what happens is that the issue is being modified multiple times during the first workflow, and the trigger happens before the end of the workflow.
I would suggest to use a workflowInstanceApi call to start the workflow specifically when you want it to start.
So, the last step before ending the 1st workflow would be a script task triggering the second workflow.
https://collibra-developer-portal.s3-eu-west-1.amazonaws.com/docs/workflows/Default.htm#Workflows/ExecutionLogic/ref_startworkflowinstance-delegate.htm