Discussion about developing the ProcessMaker application and suggestions for improving it

Moderator: amosbatto

By nnorman
#826265
Hello,

I created a process that starts with an empty event type follows by an empty task that is set up to fire a couple of triggers but none of the triggers were fired and the case stalls at this empty task, see attached screen shot. New cases are generated by calling REST endpoint on /api/1.0/workflow/cases from an external web form. Will you please share any tips and advice you have? Thank you so much!
Attachments
hr_new_case.PNG
hr_new_case.PNG (43.55 KiB) Viewed 177 times
User avatar
By amosbatto
#826268
The first task in a process has to be a normal task which is assigned to a user.

There are two way to deal with this problem:
Option 1:
Install the extraRest plugin.
You can create the new case using REST:
POST /cases
Then, use the following endpoint to execute triggers in that new case:
PUT extrarest/case/{app_uid}/execute-trigger/{tri_uid}
With this trigger, a user who is the ProcessMaker can execute triggers in cases assigned to other users, so make sure that the user in your script on your external web site is assigned as a Process Supervisor.

Second Option:
Use Web Entry to start the case from your external web site. You can add an iframe to your external web site that displays the Web Entry form. Then, select the option for multiple forms in the Web Entry properties (even of you only have one form). Then set a trigger to fire after the Dynaform or before assignment in the Web Entry dialog box.
webEntryTriggerAfterForm.png
webEntryTriggerAfterForm.png (79.55 KiB) Viewed 169 times
By nnorman
#826382
Thank you so much Amosbatto for your suggestions!!! We will look into both options and see which one we'll use. I'll post result soon.

amosbatto wrote: Fri Aug 30, 2019 8:57 pm The first task in a process has to be a normal task which is assigned to a user.

There are two way to deal with this problem:
Option 1:
Install the extraRest plugin.
You can create the new case using REST:
POST /cases
Then, use the following endpoint to execute triggers in that new case:
PUT extrarest/case/{app_uid}/execute-trigger/{tri_uid}
With this trigger, a user who is the ProcessMaker can execute triggers in cases assigned to other users, so make sure that the user in your script on your external web site is assigned as a Process Supervisor.

Second Option:
Use Web Entry to start the case from your external web site. You can add an iframe to your external web site that displays the Web Entry form. Then, select the option for multiple forms in the Web Entry properties (even of you only have one form). Then set a trigger to fire after the Dynaform or before assignment in the Web Entry dialog box.

webEntryTriggerAfterForm.png
By nnorman
#826448
Hi Amosbatto,

We decided to go with Second Option (we couldn't import the extraREST) but the trigger still didn't fired. I guess I don't quite understand the web entry configuration on the start task especially when we're using an external web form. Attached is screen shot of how I am configuring the web entry start task, what should I use for step 1 Approver Review Form (Dynaform) since it's not a Processmaker native dynaform? Also since the start task is a web entry, can the next task be a script task? Your help is much appreciated!!!!

amosbatto wrote: Fri Aug 30, 2019 8:57 pm The first task in a process has to be a normal task which is assigned to a user.

There are two way to deal with this problem:
Option 1:
Install the extraRest plugin.
You can create the new case using REST:
POST /cases
Then, use the following endpoint to execute triggers in that new case:
PUT extrarest/case/{app_uid}/execute-trigger/{tri_uid}
With this trigger, a user who is the ProcessMaker can execute triggers in cases assigned to other users, so make sure that the user in your script on your external web site is assigned as a Process Supervisor.

Second Option:
Use Web Entry to start the case from your external web site. You can add an iframe to your external web site that displays the Web Entry form. Then, select the option for multiple forms in the Web Entry properties (even of you only have one form). Then set a trigger to fire after the Dynaform or before assignment in the Web Entry dialog box.

webEntryTriggerAfterForm.png
Attachments
hr_new_case_1.PNG
hr_new_case_1.PNG (51.54 KiB) Viewed 111 times
User avatar
By amosbatto
#826453
nnorman wrote: Tue Sep 10, 2019 4:45 pm (we couldn't import the extraREST)
Was there an error when you tried to import it?
If so, what what was the error and what is your environment?
I have mostly tested extraRest in PM 3.3.X (manual install) with Debian 9.5 and PHP 5.6.38, so I'm curious if there are environments where it fails
nnorman wrote:I guess I don't quite understand the web entry configuration on the start task especially when we're using an external web form.
Web Entry will give you a URL. You can then either add a link to your external web site which directs to that URL or embed the web entry in your web site with an <iframe>. Here are HTML examples:
Code: Select all
<a href="http://example.com/sysworkflow/en/neoclassic/5392182485d78006f8a9444090008315/4361649365d780125533392014593841.php">application form</a>

<iframe src="http://example.com/sysworkflow/en/neoclassic/5392182485d78006f8a9444090008315/4361649365d780125533392014593841.php" width="99%">
nnorman wrote: Also since the start task is a web entry, can the next task be a script task?
No, you can't use a script task as the first task. You have to use a trigger instead of a script task.
By nnorman
#826633
Thank you so much Amos!!

Sorry for the delay...I got pulled into another project and just now able to get back to this project.

We have the installation through a third party and they disable the import function so we can't import plugins without them checking it first.... sigh...

We updated our process and make the first task a user task on a dynaform - Review Form. Maybe I'm missing something but when we post the variables from our external web form to the Review Form on PM using REST we get nothing. The variables are the same. Do I need to have javascript on the Review Form to see the POST variables?

Really appreciate your help!!!
--Nini
User avatar
By amosbatto
#826634
nnorman wrote: Mon Sep 23, 2019 2:19 pm We updated our process and make the first task a user task on a dynaform - Review Form. Maybe I'm missing something but when we post the variables from our external web form to the Review Form on PM using REST we get nothing. The variables are the same. Do I need to have javascript on the Review Form to see the POST variables?
Which version of PM are you using? There are some critical REST bugs in version 3.3.10 and later. The case has to exist in the database in order for you to be able to use REST endpoints to interact with the case. At exactly what point are you trying to call the REST endpoints?

You need to enable Debug Mode in ProcessMaker and look at the variables that were created when the first task in the process starts. You can also press F12 in your web browser, and go to the "Network" tab of your web browser debugger to see what is getting submitted to ProcessMaker REST endpoints by the Web Entry form.

Hi, Is there any way to show my custom column only[…]

Send for clarification

Hi, I know this is an old post but i could not fin[…]

add dropdown to search process

Please replay if there is any solution!!!!

Amosbatto, PMUsers.com is down.

Hi Amos, I appreciate you setting up a tips and t[…]