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 azalea45
#826314
Hi All,

We are using Processmaker 3.2-community edition. I have a fairly straight forward process where I have a field called Submission_Date in my form. I need to pause the case in the next users paused items until such time as the Submission_Date arrives. I have used the following trigger to try and pause the task
Code: Select all
if (isset(@@Submission_Date) and !empty(@@Submission_Date)) {
$unpauseDate = date("Y-m-d", strtotime(@@Submission_Date));
var maxpause = PMFPauseCase (@@APPLICATION, @%INDEX, @@USER_LOGGED, $unpauseDate);
	die();
This is based on the example from the pmusers group. I have also included the form that Submission_Date is generated from.

The second issue is that once unpaued thre are 3 possible routes that the form can take

The form is unpaused on the submission date>
The form is submitted early
The form is submitted late.

Depending on the relative date the form would take one of three different routes.

I'm sure that the solution is simple but I just can't see the wood for the trees.
Attachments
(15.32 KiB) Downloaded 215 times
User avatar
By amosbatto
#826332
azalea45 wrote: Tue Sep 03, 2019 6:10 am
Code: Select all
if (isset(@@Submission_Date) and !empty(@@Submission_Date)) {
$unpauseDate = date("Y-m-d", strtotime(@@Submission_Date));
var maxpause = PMFPauseCase (@@APPLICATION, @%INDEX, @@USER_LOGGED, $unpauseDate);
	die();
You are mixing PHP and JavaScript. If you run your case in Debug Mode, you will see an error message in the __ERROR__
variable.

Do it this way:
Code: Select all
if (isset(@@Submission_Date) and !empty(@@Submission_Date)) {
   $unpauseDate = date("Y-m-d", strtotime(@@Submission_Date));
   @@ret = PMFPauseCase (@@APPLICATION, @%INDEX, @@USER_LOGGED, $unpauseDate);
   header("Location: casesListExtJsRedirector");
   die();
}
User avatar
By amosbatto
#826335
azalea45 wrote: Tue Sep 03, 2019 6:10 am The second issue is that once unpaued thre are 3 possible routes that the form can take

The form is unpaused on the submission date>
The form is submitted early
The form is submitted late.

Depending on the relative date the form would take one of three different routes.
You put your "submission_date" field in a grid. Do you have multiple rows in your grid?

Let's assume that you only allow one row in your grid, then you can create three different paths in your process and use an exclusive gateway to decide which path to take.

Your three conditions in the exclusive gateway would be:

If today is the submission date:
!empty(@=gridVar) and date('Y-m-d') == substr(@=gridVar[1]['submission_date'], 0, 10)

If today is after the submission date:
!empty(@=gridVar) and date('Y-m-d') > substr(@=gridVar[1]['submission_date'], 0, 10)

If today is before the submission date:
!empty(@=gridVar) and date('Y-m-d') < substr(@=gridVar[1]['submission_date'], 0, 10)

DO we have to pay tax for trade https://www.getfir[…]

Mosquito Zapper Reviews

https://www.facebook.com/sammosquitozapper https:[…]

https://www.facebook.com/sammosquitozapper https:[…]

Are you looking for a simple method to import EML […]