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

Moderator: amosbatto

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).

You can create a process like this:
SkippableTaskWithWaitingLoop.png (26.66 KiB) Viewed 1378 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 (22.49 KiB) Viewed 1378 times
And here are the routing rules of the second gateway which decide whether to skip Task 6 or not:
DoTaskRoutingRule2.png (21.13 KiB) Viewed 1378 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 (11.9 KiB) Viewed 1378 times
And here would be your gateway's routing rules:
doTaskRoutingRule.png (22.6 KiB) Viewed 1378 times
Here are two sample processes:
(114.46 KiB) Downloaded 79 times

You do not need to know that much JavaScript to us[…]

Changing the login page

@amosbatto: Thankyou so much, it has been removed […]

I have another scenario in my process where I sh[…]

How to end a task with coding?

What version of ProcessMaker are you using? There[…]