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.
By jbernues
#827223
I have recently started working with Processmaker in order to build an app, but as of now, I am only testing it. Everything is going well but I have stumbled across a problem I am not able to solve.

In this test pool I made, when goods arrive, they are sorted to any of the 4 warehouses depending on product and quantity and depending on the final review of the manager through a checklist. The process will stop or return again to the starting point to be re-done. ]: https://i.stack.imgur.com/hRJ8x.png

There are 4 checks with keys 0-3 and their labels in 'Storage Succes'. My idea was for the manager to approve all 4 of the checks, showing that the process went right. Then, a trigger placed before the routing would see if there was any check not filled and if that would have happened, it would have restarted the process from the start. Otherwise, the process could end without any problem.

This is the trigger I wrote:
a. At first, I tried using the empty() php function, but that didn't work.
b. Then I tried simply equaling position to value like this:

if (@@checkgroupVar001[0] == 0 && @@checkgroupVar001[1] == 1 && @@checkgroupVar001[2] == 2 && @@checkgroupVar001[3] == 3 ) {
@@checklistFull == 1
}else{
@@checklistFull == 0
}

Since the key value I wrote was the same as the position, I figured it would work, but once again I get the Whoops!.
I created the variable checkListFull using the variable menu, so there should not be any problem as well...
Last, I placed a routing rule at the last gateway stating that the process would end given that @@checklistFull == 1 and it would be restarted if @@checklistFull == 0.

Obviously there is something not being done properly, I'm inclined to think that it must be the trigger or that variable, but I have not wrote php in a long time, so this could also be just me not remembering something basic.

Either way, thank you so much in advance for your help!
Happy evening and holidays!

------------------------------------------EDIT---------------------------------------------
I tried moving the trigger around, instead of just leaving it before the routing I put it before assignment and after Dynaform too. I also tried to send @@checklistFull as hidden because I thought that the variable could not be getting to the gateway properly, but in a previous trial i made a checkbox work for this same purpose, so I am still trying.


---------------------------------------EDIT 2-------------------------------------------------------
After thinking, I decided that my issue could be solved using a simple checkbox (Y/N) as I did in previous examples, but since this was a test, I am still curious about how can this be done, even knowing this may not be the correct flow! Any answers are still welcome.
#827242
Hi programerboy! Thank you for the reply. This is the process I was trying to do. As I said, I know this is quite an unnecessary one and that there are many other ways to accomplish what I try to do, but since I wasn't able to do it this way, I really want to know the way to do it.
This is my process and once again, thank you!
Attachments
(143.93 KiB) Downloaded 266 times
#827248
Today I came back to try and solve this issue again and I can confirm that the problem resides within the trigger. By creating extra tasks, I checked that the "Whooops!" error message only appears whenever the trigger is activated. Any wxtra help will be appreciated!
#827253
Hi,
You have an error in trigger "checklistCheck" and should be corrected as follows:
Code: Select all
if (@@checkgroupVar001[0] && @@checkgroupVar001[1] && @@checkgroupVar001[2] && @@checkgroupVar001[3]) {
	@@checklistFull == 1;
}else{
	@@checklistFull == 0;
}
https://pmlearning.info
Thanks
Last edited by programerboy on Wed Apr 07, 2021 1:12 am, edited 1 time in total.

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]