Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By rkiransasi
#785111
Hi,
How can I claim a case via trigger? The requirement is that case will be assigned to an user/group using Self service value based assignment. If its assigned to an user, the user need not claim the case. Using trigger, i want to make the user claim it and then the user aill do his actions from the inbox.

Can you please give code examples too?
#786649
1.) Get the info of the task first
2.) Perform WSDL reassign case
http://wiki.processmaker.com/index.php/ ... Case.28.29

As per the documentation it requires sessionId => generated using LOGIN wsdl, caseId => this is equivalent of the @@APPLICATION, delIndex=> how many task the user has been, userIdSource => user who have the case, userIdTarget => user to assign the case.

Here is my sample code
Code: Select all
 
//get the info of the current case 
$app_uid = @@APPLICATION;
$index = @@INDEX;
$result = executeQuery("SELECT * FROM APP_DELEGATION where APP_UID = '$app_uid' and DEL_INDEX ='$index'");
$from_user = $result[1]['USR_UID']; //this is the current user

//do you know your USR_UID of the user you are reassigning the case? if YEs then just declare the variable below else do a query
$user  = 'michael.timoteo'; //this is the user who you are going to assign
$result_user = executeQuery("SELECT * FROM rbac_users where USR_USERNAME='$user'"); //for v3 for version 2 use rb_workflow.USERS
$user_uid = $user[1]['USR_UID']; //if you already know the USR_UID then just paste the value here and comment out the $user and $result_user 
$user_password = $user[1]['USR_PASSWORD'];
$user_name = $user[1]['USR_USERNAME'];

//perform login WSDL
 $client = new SoapClient('http://myserver.com/sysworkflow/en/green/services/wsdl2'); //change this one
 $params = array(array('userid'=>$user_name, 'password'=>'md5:'.$user_password));
 $result = $client->__SoapCall('login', $params); 
 if ($result->status_code == 0)
 {
    $sessionId = $result->message;
}
else
{
    die("Unable to connect to ProcessMaker.\nError Message: {$result->message}");
}
//perform reassign 
reassignCase($sessionId ,$app_uid  ,$index , 
                        $from_user, $user_uid); 
I hope this works.

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[…]