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

Moderators: ArturoRobles, ArturoRobles

#795736
I have a process that will be essentially a timer-event with a script task. In my script, I verify for a condition. If true, i want to create a TASK (entry-point or not) for a case that WAS ALREADY CREATED BEFORE THE SCRIPT TASK RAN. I can't seem to find any way to do that. I don't want to use PMFRedirectToStep() since it redirects the active user and there is no real active user (and it's etter if i just create a parallel task that can be seen in the inbox of the user)

I'm trying to do that so my intermediate timer event from all my cases are not required and I would only need one of them (easier to search and users don,t have to see that).

Thanks
#795750
You can create a process like this:
SkippableTaskWithWaitingLoop.png
SkippableTaskWithWaitingLoop.png (26.66 KiB) Viewed 2032 times
In this process, it loops indefinitely until the variable @@doTask is set. If set to "yes", then Task 6 will be executed. If set to "no", then Task 6 will be skipped.

Here are the routing rules of the first gateway which is used to loop until @@doTask is set:
LoopingRoutingRule.png
LoopingRoutingRule.png (22.49 KiB) Viewed 2032 times
And here are the routing rules of the second gateway which decide whether to skip Task 6 or not:
DoTaskRoutingRule2.png
DoTaskRoutingRule2.png (21.13 KiB) Viewed 2032 times
If you think that the loop-around is ugly, then you can get rid of it and use PMFPauseCase() in a trigger before routing in the first task to pause the case. Then, in your external process which has a loop with a script task, use PMFSendVariables() to set the @@doTask variable, and then call PMFUnpauseCase() and then PMFDerivateCase() to move the case to the gateway. If you use this method, then here would be your process:
SkippableTaskProcess.png
SkippableTaskProcess.png (11.9 KiB) Viewed 2032 times
And here would be your gateway's routing rules:
doTaskRoutingRule.png
doTaskRoutingRule.png (22.6 KiB) Viewed 2032 times
Here are two sample processes:
(114.46 KiB) Downloaded 141 times
disable value in dropdown

Check box is more helpful rather than drop down op[…]

Timeout Not Sending Email

I would like to thank you for the efforts you have[…]

use 'insert into' in a trigger

Is your syntax correct? Shouldn't you be using s[…]

issue with processmaker 3.2

You mean the code in the trigger below? That is t[…]