Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By rogerdeku
#824379
Hello HeshanKaru1994


Yes you can! cancel a case with a buttom click:

The cancel case action is based on the permission PM_CANCELCASE, which allows a user to cancel cases that have been assigned to them, and current user has Process Supervisor permissions.

Please keep in mind:

A case can't be canceled if more than one parallel thread is being executed (e.g. while using parallel gateways, parallel tasks and/or inclusive gateways).

Please read this guide to know more about it :wink:
https://wiki.processmaker.com/3.1/Cases#Cancel
User avatar
By amosbatto
#824385
If you are using PM 3.3.0 or later, you can cancel cases with parallel tasks.

If you want to do it in a trigger and redirect back to the Inbox, use this code:
Code: Select all
PMFCancelCase(@@APPLICATION);
header("Location: casesListExtJsRedirector");
die();
Your users need the PM_CANCELCASES permission in their roles to cancel cases. You can add a Cancel button to a Dynaform:
https://wiki.processmaker.com/3.2/Submi ... ancel_Case
By HeshanKaru1994
#824391
So here you have to click cancel button and then submit the form. I want the implementation as once you click on the cancel button it routes to the end of the case.
User avatar
By amosbatto
#824398
HeshanKaru1994 wrote: Fri May 10, 2019 1:08 am So here you have to click cancel button and then submit the form. I want the implementation as once you click on the cancel button it routes to the end of the case.
Canceling will stop the case at its current position in the process. Once you cancel the case, you can't route to the end of the case. If you want to route to the last task in the case, then you need to add a path to your process to skip to the last task in the process:
ProcessToSkipToEnd.png
ProcessToSkipToEnd.png (13.73 KiB) Viewed 6799 times
In the exclusive gateway, you can use the following routing rule:
routingRuleToSkipToEnd.png
routingRuleToSkipToEnd.png (28.03 KiB) Viewed 6799 times
Then, add the following controls to your Dynaform in "Task 1":
* A Submit button with the ID "cancelBtn"
* A Hidden field with the ID and variable "routeToLastTask"

Then, add the following JavaScript to your Dynaform:
Code: Select all
$("#cancelBtn").find("button").click( function() {
     $("#routeToLastTask").setValue("yes");
});
By the way, it is much easier to just go to Action > Cancel in the menu, if all you want to do is cancel the case.
User avatar
By charles
#827733
amosbatto wrote:If you are using PM 3.3.0 or later, you can cancel cases with parallel tasks.

If you want to do it in a trigger and redirect back to the Inbox, use this code:
Code: Select all
PMFCancelCase(@@APPLICATION);
header("Location: casesListExtJsRedirector");
die();
Your users need the PM_CANCELCASES permission in their roles to cancel cases. You can add a Cancel button to a Dynaform:
https://wiki.processmaker.com/3.2/Submit_and_Button_Controls#Cancel_Case

The trigger is Not working on my version 3.3.0 even with SuperAdmin user for both paralel and non paralel case.
Any idea?

while without trigger (manual action button) only available on non parallel task. but for paralel task there is not any action cancel button
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]