The detailed procedure is as follows
First, create a new process like this:
Assign an administrator user to the task, then create the following variables:
Once you have done that, you need to create a new dynaforms and assign the recently created variables to their corresponding web controls:
Keep in mind that for the role dropdown, the options need to be:
Key: PROCESSMAKER_ADMIN
Label: ADMIN
Key:PROCESSMAKER_OPERATOR
Label:OPERATOR
Key: PROCESSMAKER_MANAGER
Label: MANAGER
Once you have completed all that you need to assign that dynaform to the task.
Finally, you need to create a new trigger and assign it to fire after the dynaform, the code of the trigger should look like this:
Code: Select allclient = new SoapClient( 'http://172.16.21.24/sysworkflow/en/classic/services/wsdl2' );
$params = array( array( 'userid' => 'admin', 'password' => 'admin' ) );
$result = $client->__SoapCall( 'login', $params );
$sessionID = $result->message;
$params = array( array( 'sessionId'=>$sessionID, 'userId'=>@@userID, 'firstname'=>@@firstName,
'lastname'=>@@lastName, 'email'=>@@email, 'role'=>@@role, 'password'=>@@password) );
$result = $client->__SoapCall( 'createUser', $params );
if( $result->status_code == 0 ){
@@response = "$result->message\nUser UID: $result->userUID";
} else {
@@response = "An error occurred\nError Number:$result->status_code\nError Message: $result->message";
}
Once again, keep in mind you need to use your own IP and credentials in the parts
Code: Select allclient = new SoapClient( 'http://172.16.21.24/sysworkflow/en/classic/services/wsdl2' );
and
Code: Select all$params = array( array( 'userid' => 'admin', 'password' => 'admin' ) );
After everything is set you can create a new case for this process, the dynaform will not have any validation regarding length for the email control so you will be able to create users with any kind of email you desire.