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
解決済! 解決策の投稿を見る。
トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。
表示
返信
いいね!の合計
Hi @ChaithraS
Maybe you can try OR-Split with Nops process to end the workflow for else condition
OR-Split
Noop
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...
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?
表示
返信
いいね!の合計
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.
Hi @ChaithraS
Maybe you can try OR-Split with Nops process to end the workflow for else condition
OR-Split
Noop
Thanks @arunpatidar @Tethich
We proceeded with OR split with no-ops step.
Please note that in sp12 Jobhandler class, workitem is made null and the same Object is used in next line to print logger, hence the null exception. This issue is fixed in the higher SPs.
@ChaithraS Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
表示
返信
いいね!の合計