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

Moderator: amosbatto

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.
User avatar
By jemiris
#816294
Hi Support,

Please look at the below screen
tasks order.png
tasks order.png (75.65 KiB) Viewed 902 times
My Problem:
In the REST API need to get the same process tasks order. After changed the process tasks order my result should be Task3, Task2, Task1, and Task4. It's possible with processmaker. But in the default, I am not sure from which order it comes. please give a solution :?:
User avatar
By amosbatto
#817685
Which REST endpoint are you using?
If I recall correctly, the tasks are listed in the order that they were created in the TASK table in the database.
User avatar
By amosbatto
#822556
No, it isn't possible with the existing REST endpoints. The only way to do it is run a case and check the output after calling Route case: PUT extrarest/case/{app_uid}/route-case at each task in the case.

Do you want me to create an endpoint that returns the routing info for all the tasks in the process?
That way you wouldn't have to run a case to get the routing info. (You will still have to look through the list and figure out which is the next task, but at least you will have all the info to figure it out.)
User avatar
By jemiris
#823047
amosbatto wrote: Fri Jan 25, 2019 1:31 am No, it isn't possible with the existing REST endpoints. The only way to do it is run a case and check the output after calling Route case: PUT extrarest/case/{app_uid}/route-case at each task in the case.

Do you want me to create an endpoint that returns the routing info for all the tasks in the process?
That way you wouldn't have to run a case to get the routing info. (You will still have to look through the list and figure out which is the next task, but at least you will have all the info to figure it out.)
Yes it's possible for you to give me which is the next task
User avatar
By jemiris
#823080
Thanks for the support. :P

Here i have question and my expectations.
My Questions:
1. In this (https://www.pmusers.com/index.php/Extra ... route-case) API, i have to pass the application Id which means (@@APPLICATION) :?:
2. As of my knowledge with processmaker if i execute the process only then i get the @@APPLICATION ID right :?:
3. But here before i could execute the process i would like to get the TASK1, TASK2 and TASK3 with correct orders as a (task wise). :?:
4. Can i get the next task of the each task without application id(@@APPLICATION), instead can i pass the process id(@@PRO_UID Process Id)
User avatar
By amosbatto
#823090
1. In this (https://www.pmusers.com/index.php/Extra ... route-case) API, i have to pass the application Id which means (@@APPLICATION) :?:
Yes, you can use the @@APPLICATION system variable to get the ID of the current case.
2. As of my knowledge with processmaker if i execute the process only then i get the @@APPLICATION ID right :?:
You need to have an open case to use this endpoint.
(Trying to figure this out without using the code for case routing is extremely complicated, so I used the case routing code. At any rate, you need to have a real case to figure out the next task if you have gateways with conditions or Value Based Assignment.)
3. But here before i could execute the process i would like to get the TASK1, TASK2 and TASK3 with correct orders as a (task wise). :?:
This code only works for the currently open task in the case to get its next task.

For example if you have this process:
[task1] -> [task2] -> [task3]
and "task1" is currently open in your case, then you can only call this endpoint for delegation index of 1 (which is "task1").
You can't use the delegation index of 2 (which is "task2") before "task2" is open in the case.
4. Can i get the next task of the each task without application id(@@APPLICATION), instead can i pass the process id(@@PRO_UID Process Id)
No, you need to have a case ID (which is @@APPLICATION).

PS: If you need the list of tasks which were executed in a case, then see:
https://wiki.processmaker.com/3.0/REST_ ... 7D.2Ftasks

Thank you i will be testing that

The check box is in the grid. I need to change th[…]

You need to use database queries in triggers to ge[…]

i still got error after add this header, This […]