Hello everyone,
I was wondering if it is possible to assign a task to the user you executed a workflow or submitted an adaptive form. I'm trying to recreate that scenario, but from the options of the assign task it doesn't look possible. Does anybody know how can I implement this>
Best regards,
Solved! Go to Solution.
Views
Replies
Total Likes
Yes.
You can do it in 2 ways:
1. Create a ECMA script and assign the task required to the user who started the last step/workflow. The workflow initiator id would be present in the workflow metadata by the property name "initiatorId". Now, you can add this ECMA script in the process step of your workflow.
2. You can achieve the same through Java and the property would be the same, just the fetching of workflow metadata would be different.
Yes.
You can do it in 2 ways:
1. Create a ECMA script and assign the task required to the user who started the last step/workflow. The workflow initiator id would be present in the workflow metadata by the property name "initiatorId". Now, you can add this ECMA script in the process step of your workflow.
2. You can achieve the same through Java and the property would be the same, just the fetching of workflow metadata would be different.
MetaDataMap vars = wfd.getMetaDataMap();
String initiatorId = vars.get("initiatorId", "undefined").trim();
log.info(" InitiatorId is: " + initiatorId);
We created a custom workflow step in Java. This is the second step in our workflow. The initiatorId is undefined. When is initiatorId set?
This is how I did it in a custom java component:
String wfinitiatorId = workItem.getWorkflow().getInitiator();
log.info(" Initiator id is: " + wfinitiatorId);
Thanks! I was able to assign it to the initiator using this code for my java component!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies