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