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.
User avatar
By jemiris
#813013
My Problem,

How to create a task dynamically using REST API :?:

1. Only i can you process id, and user id
2. The task id has to created dynamically
Task.JPG
Task.JPG (95.05 KiB) Viewed 4209 times
User avatar
By amosbatto
#813044
I can't find the REST endpoints to dynamically create tasks in the Community Edition source code at:
workflow/engine/src/ProcessMaker/Services/Api/Project

I know the Projects team has dynamically created processes using REST, but I suspect that they must have created custom REST endpoints to do it. I emailed the developers to ask them how they did it.

What are you trying to do? You can probably create a fixed process with gateways to skip tasks and then pass variables to the new case to skip the unwanted tasks in the process.
User avatar
By amosbatto
#813061
The projects team used custom REST endpoints and the code is proprietary so I can't share it.

The best thing for you to do is export a process and study the format of the .pmx file. Then, dynamically construct a .pmx file and use the POST /project/import endpoint to import the .pmx file.

In your file, you will need to use all new unique IDs when importing a process. The following function can be used to generate your IDs:
Code: Select all
function generateUniqueID () {
        do {
            $sUID = str_replace( '.', '0', uniqid( rand( 0, 999999999 ), true ) );
        } while (strlen( $sUID ) != 32);
        return $sUID;
        
        //if wanting all uppercase:
        //return strtoupper(substr(uniqid(rand(0, 9), false),0,14));
} 
What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]

To convert MBOX to PST, start by downloading and i[…]

My Assignment Services stands out as one of the be[…]

Erectile Dysfunction, commonly known as impotence,[…]