0

Id like to submit contacts in one process, and choose from them in an other process using ProcessMaker 4 v4.1.21-RC7 community edition. And I'm not able to do that, or at least I don't have the knowledge right now. According to my understanding I can't use collection and data connector in the free version. How can I reach 'Requests' data with this version?

I played around with Select List datasources, but no luck at all. I used Processmaker a few years ago and the opensource version seemed much powerful... I bet without going enterprise - witch is bananas for the use case we'd like to implement now - we should use some scripts. But how can I reach all the requests from a script? THX

2 Answers2

0

You can try is to be able to use the scripts, to be able to call the api that processmaker has internally, from there you can get the "data" of each one of the requests. To access the api documentation: http://yourhost/api/documentation#/Processes/getProcessById

Attached the screenshots of the documentation page

Request

Response

Please review the following code to implement it in the script Review Code

<?php
$apiInstance = $api->processRequests();

$processRequestId = 3;
$processRequest = $apiInstance->getProcessRequestById($processRequestId);

$result = [
    'status' => $processRequest->getStatus(),
    'processId' => $processRequest->getProcessId()
];

// Include data, participants, and user that started the request
$include = 'data,participants,user';
$result = $apiInstance->getProcessRequestById($processRequestId, $include);

$result = [
    'status' => $result->getStatus(),
    'data' => $result->getData(),
    'user' => $result->getUser()['username'],
    'participants' => array_map(function($user) {
        return $user['username'];
    }, $result->getParticipants()),
];

return ['processRequest' => $result];
0

There is now a very easy way to create dependent select list controls in ProcessMaker. I recommend reading this example. It is now extremely easy to use. Note that you do need to use Collections and that is an enterprise feature.

breale
  • 21
  • 1