Aborting workflow action from sub-action

33 views
Skip to first unread message

Mark Orciuch

unread,
May 4, 2021, 3:34:59 PM5/4/21
to dotCMS User Group
Hello,

I am looking for a way to stop workflow action from completing based on some condition in Velocity Script Actionlet. For example, I would like to validate some condition in Velocity Script Actionlet and abort the workflow action if the condition fails. I would like for this to work interactively as well as when the workflow action is invoked via Rest API.

I've scanned the old posts and documentation but did not find anything useful. Many thanks in advance for any helpful hint or technique.

Nathan Keiter

unread,
May 4, 2021, 3:48:22 PM5/4/21
to dotCMS User Group
It looks like workflow actions support two exceptions:


@throws WorkflowActionFailureException
@throws DotContentletValidationException


https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/actionlet/WorkFlowActionlet.java#L95-L110


Throwing these exceptions should bubble up to the caller and be handled appropriately.


Note: I haven't actually tried this before.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 3:34 PM
To: dotCMS User Group
Subject: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hello,

I am looking for a way to stop workflow action from completing based on some condition in Velocity Script Actionlet. For example, I would like to validate some condition in Velocity Script Actionlet and abort the workflow action if the condition fails. I would like for this to work interactively as well as when the workflow action is invoked via Rest API.

I've scanned the old posts and documentation but did not find anything useful. Many thanks in advance for any helpful hint or technique.


--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hKQBLLp3wVH66ha9bYFY3nYI1PHeGq-PB1YwrOPucxWcQpfwpfb-2tCsrWaiasdwO-xvwew3Bl3R2LYOQrBU8G10qugK08DVxGxlTus4yaS2NH4,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,ux65a-LoLrRl20F7ojkwFI0KDx-YUTS5VhgSuldSUSOuVfKCRmikbYK0Nsoiia8seKKILcCeu9XM7SIYyYEgmr1n9V241G4ZBp9TplAS6ZulFSO6C9D2MSPRpTE,&typo=1>.

Mark Orciuch

unread,
May 4, 2021, 4:24:11 PM5/4/21
to dotCMS User Group
Hi Nathan,

Thanks for the tip. How would I "throw" these from Velocity Script Actionlet? Or would I have to create a custom workflow sub-action plugin?

Nathan Keiter

unread,
May 4, 2021, 4:34:35 PM5/4/21
to dotCMS User Group
I'm not sure exactly how to throw an exception in velocity. I'm not sure if those exception classes are available in the velocity context.


Maybe this can help?

https://stackoverflow.com/questions/15659200/how-to-throw-an-user-defined-exception-from-velocity-template-script-vtl


If you get it working, let us know.


Otherwise go the OSGI plugin route.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 4:24 PM
To: dotCMS User Group
Subject: Re: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hi Nathan,

Thanks for the tip. How would I "throw" these from Velocity Script Actionlet? Or would I have to create a custom workflow sub-action plugin?
On Tuesday, May 4, 2021 at 2:48:22 PM UTC-5 nke...@gettysburg.edu wrote:
It looks like workflow actions support two exceptions:


@throws WorkflowActionFailureException
@throws DotContentletValidationException


https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/actionlet/WorkFlowActionlet.java#L95-L110


Throwing these exceptions should bubble up to the caller and be handled appropriately.


Note: I haven't actually tried this before.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,tZ96epItEZxLMIl_LM9UUNA7yH-TI_b_ea2jbZBoO5ruDyvaGwLtpnFm-spGfElpmzol_bdD_xruy0qFiTLidIhefxV9g8j39UgxO4LbqQVprYZM70g,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,Y5bPuM2FYmd9A9DefsmDYWMBbTlEXApi7MM1hi8P9JS4CHgQVUWZt6O4B9OoqOQNNW_W4j_ibKddKqsw66Y48WTr8GYO39gOPoDhWla_Z4ZKEI4S&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 3:34 PM
To: dotCMS User Group
Subject: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hello,

I am looking for a way to stop workflow action from completing based on some condition in Velocity Script Actionlet. For example, I would like to validate some condition in Velocity Script Actionlet and abort the workflow action if the condition fails. I would like for this to work interactively as well as when the workflow action is invoked via Rest API.

I've scanned the old posts and documentation but did not find anything useful. Many thanks in advance for any helpful hint or technique.


--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,Xk07oeLYQ01pcZjcnd8UeUaNaMO43OPRn68bDQ5OJeGMHeAmFkW_Ps9iHZ7MleRfB73KhsgGFtrYspPCoEmzX_RlV-KXKnTcbkh0zJzWmFty&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hKQBLLp3wVH66ha9bYFY3nYI1PHeGq-PB1YwrOPucxWcQpfwpfb-2tCsrWaiasdwO-xvwew3Bl3R2LYOQrBU8G10qugK08DVxGxlTus4yaS2NH4,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com&c=E,1,3EgUkaDLP1swb70lbmUFL722_JtbuSJVIAcV27DIiJf8JcGabp4jpsklsNsAFaC_6puOaYGn2IEOXUS7NI0TfFm3PdyrsXiCQDFIxaFvgshUUoYgPXeMRRk,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,ux65a-LoLrRl20F7ojkwFI0KDx-YUTS5VhgSuldSUSOuVfKCRmikbYK0Nsoiia8seKKILcCeu9XM7SIYyYEgmr1n9V241G4ZBp9TplAS6ZulFSO6C9D2MSPRpTE,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,agVsIZQIK5jKyI5RyZO21riwDN6oAGQCHdN2II1b5T9EEDBL0nsTv58WjvhVukwF18KO8CpZL1ctx7b69gaSa2AbPNsPNGdzpdBo6lRQ5W3_dt7BI_ZSgw,,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/d0c5e991-b313-4ca6-8ae6-7bb7547afdden%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fd0c5e991-b313-4ca6-8ae6-7bb7547afdden%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,aFFT-Jw0vhxt3t3-7nc71qJBLjGQaLR6-h0x14yw3RVS3kSN-VA1yNQcSbnJZBu7OgwNu9p18hiAkOf_SyWhbPj7uPnBOZuze60pfpKOfYpHkA,,&typo=1>.

Mark Orciuch

unread,
May 4, 2021, 4:58:23 PM5/4/21
to dotCMS User Group
Thanks, Nathan. After all these years of using Velocity, didn't know this could be done in Velocity. However, the ExceptionThrower referenced on StackOverflow post would have to be added as custom Velocity tool to be usable. I'm not there yet but hopefully soon.

Nathan Keiter

unread,
May 4, 2021, 5:32:57 PM5/4/21
to dotCMS User Group
Ah, yes I see that now. Probably simpler to go the OSGI route then, since you'd end up using Java in some capacity either way.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 4:58 PM
To: dotCMS User Group
Subject: Re: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Thanks, Nathan. After all these years of using Velocity, didn't know this could be done in Velocity. However, the ExceptionThrower referenced on StackOverflow post would have to be added as custom Velocity tool to be usable. I'm not there yet but hopefully soon.

On Tuesday, May 4, 2021 at 3:34:35 PM UTC-5 nke...@gettysburg.edu wrote:
I'm not sure exactly how to throw an exception in velocity. I'm not sure if those exception classes are available in the velocity context.


Maybe this can help?

https://stackoverflow.com/questions/15659200/how-to-throw-an-user-defined-exception-from-velocity-template-script-vtl


If you get it working, let us know.


Otherwise go the OSGI plugin route.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,yD-o03zyLEbpYDaEkptzGTnLDPkM_sRwF7zOUEkQU2EZxu_v8wbAMsTWFYMlJnNxGjICjPYiyGeoEnBbsdzhDE_L7wTBbSd5W08R0QqYRygTbg,,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,ABnMs2RFF_kTvpdnlyo-6cpN2UnrihRuBgHs2Mx0wCurQTc7bINKQChzTnejqcMe5ip5CxkwWDQMwHa2IN7jB5bf8WmVGWEJpOReNF32&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 4:24 PM
To: dotCMS User Group
Subject: Re: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hi Nathan,

Thanks for the tip. How would I "throw" these from Velocity Script Actionlet? Or would I have to create a custom workflow sub-action plugin?
On Tuesday, May 4, 2021 at 2:48:22 PM UTC-5 nke...@gettysburg.edu wrote:
It looks like workflow actions support two exceptions:


@throws WorkflowActionFailureException
@throws DotContentletValidationException


https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/actionlet/WorkFlowActionlet.java#L95-L110


Throwing these exceptions should bubble up to the caller and be handled appropriately.


Note: I haven't actually tried this before.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993><tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,6di_Hx4067e-ddFIUciGMuBEyu6x5q3D70lizBq8xv_Li561O379dSFUePyr7vS77FwydPDqejCXpc0fja4TO-W-F8E_K8UziBxpmlc5UF8,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,tZ96epItEZxLMIl_LM9UUNA7yH-TI_b_ea2jbZBoO5ruDyvaGwLtpnFm-spGfElpmzol_bdD_xruy0qFiTLidIhefxV9g8j39UgxO4LbqQVprYZM70g,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,Oc28_TJ1nvPXQL7JDfjd9h0Et2UPAS37VJ6kdttjUeybp1S_-Qc_U2eurmgsgoblLDNlat1aX0I7W4m0pUBIICXK1HjxKzQF8wvnhJoEZNYT2A,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,Y5bPuM2FYmd9A9DefsmDYWMBbTlEXApi7MM1hi8P9JS4CHgQVUWZt6O4B9OoqOQNNW_W4j_ibKddKqsw66Y48WTr8GYO39gOPoDhWla_Z4ZKEI4S&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Orciuch <mark_o...@ngsltd.com>
Sent: Tuesday, May 4, 2021 3:34 PM
To: dotCMS User Group
Subject: [dotcms] Aborting workflow action from sub-action

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hello,

I am looking for a way to stop workflow action from completing based on some condition in Velocity Script Actionlet. For example, I would like to validate some condition in Velocity Script Actionlet and abort the workflow action if the condition fails. I would like for this to work interactively as well as when the workflow action is invoked via Rest API.

I've scanned the old posts and documentation but did not find anything useful. Many thanks in advance for any helpful hint or technique.


--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,bVR8okFWHvIuooTjlBmghpYge_G1jB5DhFvHNxmTkkSDjUM_5W28chxMg4KzYH7t996OLS3PdlAspEN1o2xALHnowcgLEt12bvPv2sVUDA,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,Xk07oeLYQ01pcZjcnd8UeUaNaMO43OPRn68bDQ5OJeGMHeAmFkW_Ps9iHZ7MleRfB73KhsgGFtrYspPCoEmzX_RlV-KXKnTcbkh0zJzWmFty&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hKQBLLp3wVH66ha9bYFY3nYI1PHeGq-PB1YwrOPucxWcQpfwpfb-2tCsrWaiasdwO-xvwew3Bl3R2LYOQrBU8G10qugK08DVxGxlTus4yaS2NH4,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com&c=E,1,c5sssjsS7dloGCBn2aOju5jFWiyGZ8nqV3RMsXYOify2hz3ItRW4lUK-XHf77Lhe_PCnALWMyz08kokxd2uTmGyhPFj9XhNuGmtFTkM-3tCrh_qL&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com&c=E,1,3EgUkaDLP1swb70lbmUFL722_JtbuSJVIAcV27DIiJf8JcGabp4jpsklsNsAFaC_6puOaYGn2IEOXUS7NI0TfFm3PdyrsXiCQDFIxaFvgshUUoYgPXeMRRk,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f376e01e3-2356-4a2a-b7c4-1195c7dfde0dn%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,ux65a-LoLrRl20F7ojkwFI0KDx-YUTS5VhgSuldSUSOuVfKCRmikbYK0Nsoiia8seKKILcCeu9XM7SIYyYEgmr1n9V241G4ZBp9TplAS6ZulFSO6C9D2MSPRpTE,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,yboN_EKAVY1AnEJrTCn-m7Uuy5x_sbgR6WrkvAH7TxTrOezESj1BbkQMJa-a42mR8Yk3xO75Zm_-RMTwNv6sgDvkEKlQCropd9QQsg935bT-hzRIpf9BQSRk&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,agVsIZQIK5jKyI5RyZO21riwDN6oAGQCHdN2II1b5T9EEDBL0nsTv58WjvhVukwF18KO8CpZL1ctx7b69gaSa2AbPNsPNGdzpdBo6lRQ5W3_dt7BI_ZSgw,,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/d0c5e991-b313-4ca6-8ae6-7bb7547afdden%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fd0c5e991-b313-4ca6-8ae6-7bb7547afdden%2540googlegroups.com&c=E,1,Qh67HdMsCtTrKmrcAfro4AXN18wyaGq_dQFr3oT70Xxk2lyTWQ8Qs75Z-vv_NL2OiKgyOte51seC-6OhrOYJXH2Hp448ppg-wAbnNr6q3gFl&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fd0c5e991-b313-4ca6-8ae6-7bb7547afdden%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,aFFT-Jw0vhxt3t3-7nc71qJBLjGQaLR6-h0x14yw3RVS3kSN-VA1yNQcSbnJZBu7OgwNu9p18hiAkOf_SyWhbPj7uPnBOZuze60pfpKOfYpHkA,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,77TLDPW94bytiT34DW5hWKiNzC-iI1JnysXcZ65quLqt9dCyzEQNP4IX8Oser9Fs1r8gCj7OFj9F2LwjRvIaCQ9aQzvKinmBXRMluWSKbz24&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b92d632f-2ffc-4229-be9a-413ec549890an%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fb92d632f-2ffc-4229-be9a-413ec549890an%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,4V3wdsSzjv2KDhdSJndgmnNEHPTluPxg4eY4BMmmEmxUzsgcapdUGWI2s1rYwJ0R8nPIFmFMnzHlkQ-v1pzj8r5pcG4GlKbLoRVZmubJ&typo=1>.

jonathan...@dotcms.com

unread,
May 5, 2021, 1:19:42 PM5/5/21
to dotCMS User Group
Hi Mark

I think you can do something such as

```
#if($content.getTitle().startsWith('wrong'))
   $dotlogger.info("Wrong")
  $workflow.abortProcessor()
#else
   $dotlogger.info("OK")
#end
```

  $workflow.abortProcessor()

Will abort the current action,

Thanks,
J

Mark Orciuch

unread,
May 5, 2021, 3:55:18 PM5/5/21
to dotCMS User Group
Great, thanks Jonathan! I will give this a try (although I don't see abortProcessor() method in javadoc for the workflow tool).

Mark Orciuch

unread,
May 5, 2021, 4:29:36 PM5/5/21
to dotCMS User Group
Hi Jonathan,

The $workflow.abortProcessor() works! I followed the Velocity Scriptlet Actionlet with Message sub-action to display $content.result.output with error message. Thanks again.

jonathan...@dotcms.com

unread,
May 6, 2021, 1:46:28 PM5/6/21
to dotCMS User Group
I am glad it worked

Best,
J
Reply all
Reply to author
Forward
0 new messages