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

Moderators: ArturoRobles, ArturoRobles

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.
#793718
Hello Support Process Maker,
My problem:
1. Is there possible to import the process using session ID in my endpoints(REST API)?
2. I need to import process only using onlyusername, password and session id not with the client id, client secret and access token.
3. Give me an answer to solve this problem
#793732
Yes amosbatto, In version 3, also it is possible to do automatic login with the session ID. Because i have the no.of workspaces. I answer for ur question
I have the no.of workspaces. So every time i can't create the client id and client secret for the every workspaces it's difficult
.

My Problem:
1. I Logged in using session id success fully.
2. The only thing i need to Import the process using session id
4. Could you tell me how to import the process using session id

I'm expecting the soultion from support could u please help me. :?: :oops:
#793753
I tried the code for automatic login on the wiki and it didn't work, but now I see that the code just needs to be updated for a SHA256 password, instead of MD5. Recent versions of MySQL uses SHA256 for passwords. Here is the code that works:
Code: Select all
<?php
ini_set("soap.wsdl_cache_enabled", "0");
//ini_set('error_reporting', E_ALL); //uncomment to debug
//ini_set('display_errors', True);  //uncomment to debug
     
$client = new SoapClient('http://localhost:320/sysworkflow/en/neoclassic/services/wsdl2');
$pass = 'md5:' . hash('sha256', 'admin');
$params = array(array('userid'=>'admin', 'password'=>$pass));
$result = $client->__SoapCall('login', $params);
 
if ($result->status_code == 0) {
    $sessionId = $result->message;
    header("Location: http://localhost:320/sysworkflow/en/neoclassic/cases/main?sid=$sessionId");
}
else {
    die("<html><body><pre> Unable to connect to ProcessMaker.\n" .
        "Error Message: $result->message");
}
?>
However, there is no web service to import Processes. You can find code to import a Process in
workflow/engine/methods/processes/processes_Import_Ajax.php

You can create a trigger with similar code and then execute using the executeTrigger() web service.
#793772
Thank u for the support amosbatto. I used the code to import the process but It doesn't import. I don't which parameters i missed while importing of the process

Code Response:

Notice: Undefined index: PROCESS_FILENAME in C:\Bitnami\processmaker-3.1.3.b1-0\apps\processmaker\htdocs\workflow\engine\methods\processes\processes_Import_Ajax.php on line 269

Notice: Undefined index: PROCESS_FILENAME in C:\Bitnami\processmaker-3.1.3.b1-0\apps\processmaker\htdocs\workflow\engine\methods\processes\processes_Import_Ajax.php on line 270

Notice: Undefined index: PROCESS_FILENAME in C:\Bitnami\processmaker-3.1.3.b1-0\apps\processmaker\htdocs\workflow\engine\methods\processes\processes_Import_Ajax.php on line 272
{"success":true,"catchMessage":"The filename is empty!","ExistProcessInDatabase":"","ExistGroupsInDatabase":"","response":"The filename is empty!"}

The 500 Internal Server Error is the general catch[…]

Really very nice blog information for this one and[…]

This is a long, lengthy and cumbersome process. T[…]

Great read for when on the road. The book provides[…]