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.
#812437
I have created a sample process that you can use:
(26.64 KiB) Downloaded 370 times
Assign the first task in the process to users who have the PM_CANCELCASE in their roles. Then run a case and select a user. When you click on "Cancel/Delete Cases", it should display how many cases have been Cancelled and Deleted.
deletedCases.png
deletedCases.png (22.86 KiB) Viewed 6393 times
This deleted cases when they are in the first task in their process and cancels all other cases that are in subsequent tasks.

If you really want to destroy the records of the cases (which is NOT recommended), then you can enter the database and manually delete the cases by entering these commands:
mysql -u root -p
mysql> USE wf_workflow
mysql> DELETE FROM APP_CACHE_VIEW WHERE USR_UID='1234567890abcde1234567890abcde';
mysql> DELETE FROM APP_DELEGATION WHERE USR_UID='1234567890abcde1234567890abcde';
mysql> EXIT
This will leave records in the other tables that point to APP_DELEGATION records that don't exist, which is why I don't recommend it. It is far better to use the option in the PM interface to delete all cases for a selected process.
#812444
amosbatto wrote:I have created a sample process that you can use:
Bulk_Case_Management-2.pmx
Assign the first task in the process to users who have the PM_CANCELCASE in their roles. Then run a case and select a user. When you click on "Cancel/Delete Cases", it should display how many cases have been Cancelled and Deleted.
deletedCases.png
This deleted cases when they are in the first task in their process and cancels all other cases that are in subsequent tasks.

If you really want to destroy the records of the cases (which is NOT recommended), then you can enter the database and manually delete the cases by entering these commands:
mysql -u root -p
mysql> USE wf_workflow
mysql> DELETE FROM APP_CACHE_VIEW WHERE USR_UID='1234567890abcde1234567890abcde';
mysql> EXIT
This will leave records in the other tables that point to APP_DELEGATION records that don't exist, which is why I don't recommend it. It is far better to use the option in the PM interface to delete all cases for a selected process.
When using this process on the admin account, I get the following error.

Fatal error: Call to a member function toArray() on null in /opt/processmaker_workflow/workflow/engine/classes/class.case.php on line 2202

and for one of the other uses, it just cancels the same cases each time.
#812454
Fatal error: Call to a member function toArray() on null in /opt/processmaker_workflow/workflow/engine/classes/class.case.php on line 2202
What version of PM are you using? In version 3.2.1, line 2202 is in the function startCase():
$this->getExecuteTriggerProcess($sAppUid, 'CREATE');

The code I gave you shouldn't be calling startCase().
#812464
amosbatto wrote:
Fatal error: Call to a member function toArray() on null in /opt/processmaker_workflow/workflow/engine/classes/class.case.php on line 2202
What version of PM are you using? In version 3.2.1, line 2202 is in the function startCase():
$this->getExecuteTriggerProcess($sAppUid, 'CREATE');

The code I gave you shouldn't be calling startCase().
I am using 3.1.3 Enterprise Edition
#812486
amosbatto wrote:There seems to be a bug in PMFCancelCase(). I couldn't get it to cancel all the cases.
I changed the trigger code to use Cases::cancelCase(), which isn't based on web services.

Try this new version of the process and tell me if it works for you:
Bulk_Case_Management-4.pmx

It works, thanks!

To convert MBOX to PST, start by downloading and i[…]

My Assignment Services stands out as one of the be[…]

Erectile Dysfunction, commonly known as impotence,[…]

Want to create your own meme coin?

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