Context :
1. AEM is running on sp12
2. Workflows are not transient and we do not want to convert them to transient since we need the history.
Problem : We have a workflow where we need to introduce process step and have below logic in it :
if(custom field is valid){
proceed with usual flow;
}else{
terminate/complete the workflow;
}
I have used "wfSession.terminateWorkflow(wfSession.getWorkflow())" to terminate the workflow. Ideally this method should abort the workflow and not retry it. However, in sp12 there seems to be an issue that it retries and then marks it as abort. I found a discussion if workflow is made transient, issue will be resolved. Is there any other solution to close/terminate the workflow other than making it transient in sp12.
https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/2879
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @ChaithraS
So just to confirm, the workflow is not marked as transient when it was created:
https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/ext...
Now, based on docs, the complete and terminate operations should archive the workflow instance:
https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/ext...
Have you tried to call complete method and see if the issue still shows ?
https://developer.adobe.com/experience-manager/reference-materials/6-4/javadoc/com/adobe/granite/wor...
If yes, therefore if the issue confirms is in sp12, meaning that is not in your control, what you can do, until it gets fixed, is to try to save the workflow history just before it gets completed/terminated. This can be done using getHistory() method https://developer.adobe.com/experience-manager/reference-materials/6-4/javadoc/com/adobe/granite/wor...
Views
Replies
Total Likes
Hi @Tethich
1. Yes. workflows are not marked transient when they were created and we do not want to change it now.
2. Workflow.complete completes only current step, however we want to complete the entire workflow. Is there any option to do that?
3. Since non-transient workflows are already saved, do we need to do it explicitly?
Views
Replies
Total Likes
2. No aware of it yet.
3. You don't need to save it if they are non-transient. But if there is a known bug in sp12 as you say, I only thought a way to overcome this is to use getHistory() method to grab the worlflow history and then save it to some location from where you can refer it when you need.
Views
Replies
Total Likes
Hi @ChaithraS
Maybe you can try OR-Split with Nops process to end the workflow for else condition
OR-Split
Noop
Views
Replies
Total Likes