Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By azatrath
#812496
hello,

i need a simple process, but need to finish same case 19 times. Task 1 have to completed 19 times for each machine. i want to ask can i execute SQL insert fuction during process?
think about it simple process with 1 task. and there is a button "Save information" will save all data to sql and clear task. with that i dont need to start same prcess each time.

i hope it is possible, i appreciate your help
Attachments
Adsız.png
Adsız.png (6.66 KiB) Viewed 3554 times
User avatar
By amosbatto
#812511
If it is the same person who will be working on the process 19 times, then you can create a looparound in your process and use a counter to keep track of how many times the process is looped. You can write the data to a table in your database with executeQuery() in a trigger before looping again.

If it is 19 different people, then you need to create an array of 19 user IDs in a trigger and set the user to assign to the first task for each loop through the process. If you want 19 different people to be able to execute the same task at the same time, then you need to use a parallel task.

If you don't know whether it will be the same user or different users who will execute the process for a total of 19 times per machine, then you should use the table in your database to keep track of how many times the process has been executed per machine and determine whether the process can be executed or not.

Tell me what is your situation and I can give you an example process.
looparoundAndParallel.png
looparoundAndParallel.png (17.44 KiB) Viewed 3546 times
By azatrath
#812513
amosbatto wrote:If it is the same person who will be working on the process 19 times, then you can create a looparound in your process and use a counter to keep track of how many times the process is looped. You can write the data to a table in your database with executeQuery() in a trigger before looping again.

If it is 19 different people, then you need to create an array of 19 user IDs in a trigger and set the user to assign to the first task for each loop through the process. If you want 19 different people to be able to execute the same task at the same time, then you need to use a parallel task.

If you don't know whether it will be the same user or different users who will execute the process for a total of 19 times per machine, then you should use the table in your database to keep track of how many times the process has been executed per machine and determine whether the process can be executed or not.

Tell me what is your situation and I can give you an example process.
looparoundAndParallel.png
ty amos for replying.

sorry for miss-information I need first situation. same user 19 different machine. i am stuck with that looping 19 times :/
User avatar
By amosbatto
#812542
1. Create an integer variable in your process named nLoops.

2. Create this trigger:
Code: Select all
if (!isset(@%nLoops)) {
   @%nLoops = 0;
}
@%nLoops++;
 
Set this trigger to fire before assignment in the task before the exclusive gateway (which is called "Task 1" in the graphic I gave you in the previous post).

3. In the routing rules of the exclusive gateway, set these conditions:
exclusiveRoutingRulesToLoop.png
exclusiveRoutingRulesToLoop.png (22.4 KiB) Viewed 3529 times
(25.01 KiB) Downloaded 260 times
By azatrath
#812553
amosbatto wrote:1. Create an integer variable in your process named nLoops.

2. Create this trigger:
Code: Select all
if (!isset(@%nLoops)) {
   @%nLoops = 0;
}
@%nLoops++;
Set this trigger to fire before assignment in the task before the exclusive gateway (which is called "Task 1" in the graphic I gave you in the previous post).

3. In the routing rules of the exclusive gateway, set these conditions:
exclusiveRoutingRulesToLoop.png
Loop_around-1.pmx
amos ty for your help again. how can i clear all form ?
User avatar
By amosbatto
#812555
To clear a form in a trigger, you can set every variable used in a form to an empty string, if fired by before the form:
Code: Select all
@@var1 = '';
@@var2 = '';
You can also reset the form to its original values with this JavaScript:
Code: Select all
$("#cancelButton").find("button").click( function() {
     $("form")[0].reset()
});
where you have a button on the form with the ID "cancelButton".

If you have existing values set from a previous form in the current form, then you have to set the values to empty like this:
Code: Select all
$("#clearButton").find("button").click( function() {
     $("#var1").setValue('');
     $("#var2").setValue('');
});
Where you have a button on the form with the ID "clearButton".
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[…]