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 acloud
#814196
I have to developing a Rest Client to invoke process maker API. This is the scenario

Start--> Submit Request ---> Validate Request --> Assign Reviewer --> Review Document --> <GateWay> if YES ---> Prepare Response ---> Provide Response

1.If I login process maker http://{ip}:8080 and walk the case thru it works
2. I want to write a Rest client to assign the Task from Submit Request to Validate Request -->Validate Request has the CASE_MANAGER group --> once they done --> the task will move along to --> Review Document (which has the Value Base Assignment @@docReviewer and Assign to another REQUESTER group

3. Currently I am using this API Route Case: PUT /cases/{app_uid}/route-case The document stated that
Route a case (i.e., move the case to the next task in the process according to the routing rules). Cases may only be routed if the logged-in user is the case's currently assigned user. If needing to route a case which is assigned to another user, then first reassign the case to the logged-in user and then route the case. Note that "routing" is also known as "derivating" in ProcessMaker.
4. So if i ran the curl http://ip:8080/api/1.0/workflow/cases/$ ... ssign-case with usr_uid_source, usr_uid_target, it will update the case on the dynaform to own by different user, that NOT what I want to do.
5. Any suggestion how would i move the one task to the next via API Rest not go thru the PROCESS MAKER browser and click Submit on the Dynaform
Thank you
User avatar
By amosbatto
#814209
If you want to download the document using REST in order to review it, you should see this post:
viewtopic.php?f=44&t=730371&p=813778

If you decide to apply the source code changes in that post, I recommend importing my extraRest plugin and using the GET extrarest/session-id endpoint to get the session ID.

As for the problem of routing the cases assigned to other users, you can work around this problem by creating a trigger like this in the process:
Code: Select all
$g = new G();
$g->sessionVarSave();
PMFDerivateCase(@@otherCaseId, @@otherIndex, false, @@otherUserId);   
$g->sessionVarRestore(); 
See: viewtopic.php?f=47&t=713218

Then use PUT /cases/{app_uid}/variables to set the @@otherCaseId, @@otherIndex and @@otherUserId variables. Then, call POST /cases/{app_uid}/execute-trigger/{tri_uid} to execute the above trigger.

When I have some spare time, I will create a custom REST endpoint to route another user's case, but for now you will have to use this method.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]