Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

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 1053 times
In the exclusive gateway, you can use the following routing rule:
routingRuleToSkipToEnd.png
routingRuleToSkipToEnd.png (28.03 KiB) Viewed 1053 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.
concatenate in grid control

Hi, I have a problem and I will be approciated if […]

Ok, Then, did you ensure that: 1. This requested p[…]

Hello, I'm using ProcessMaker 3.3.10-community, an[…]

SOAP-ERROR: Parsing WSDL

Thanks AJ and Amos, i don't know how to answer Am[…]