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.
By manalidhuri
#827349
Hii
Im trying to send variable from one process to another using soap service(send variable) where im able to send variable in text field but not in grid text fields.
How can i send variable in grid?
By manalidhuri
#827399
I'm sending variables through $var to another process but it only send variable which are in text field and i want to send in grid also, please check below trigger and provide possible solution.



$parent_application_id=@@APPLICATION;
$parent_case_id=@@APP_NUMBER;
@@parent_case_id=$parent_case_id;
@@parent_application_id=$parent_application_id;
$outdocvar=@@outdocvar;
$BICCODE=@@BICCODE;
$decision=@@decision;


if(@@BICCODE=='condition1' || @@BICCODE=='condition2')
{

$client=new SoapClient('wsdl');
$params = array((array('userid'=>'username', 'password'=>'pswrd')));
$result1 = $client->__SoapCall('login', $params);
@@result1=$result1;

if ($result1->status_code == 0){

$sessionId = $result1->message;
@@msg=$sessionId;

}

else{

echo("Unable to connect to ProcessMaker.\nError Numbern");
}

class variableStruct {

public $name;
public $value;
}

$query = executeQuery("select GRP_UID from GROUPWF where GRP_TITLE in(select GROUPNAME from PMT_M_BICCODE_GROUP_MAP where BICCODE='$BICCODE')");
@@query=$query;
@@groupUID = $query[1]['GRP_UID'];
$groupUID=@@groupUID;

$query2 = executeQuery("SELECT DISTINCT APP_TITLE FROM APP_CACHE_VIEW WHERE APP_UID='$parent_application_id'");
@@query2=$query2;
@@appTitle = $query2[1]['APP_TITLE'];
$appTitle=@@appTitle;



$name = new variableStruct();
$vars = array('CASEID'=>$caseId, 'BICCODE'=>$BICCODE, 'decision'=>$decision, 'Comment'=>$cmnt,'parent_case_id'=>$parent_case_id,'parent_application_id'=>$parent_application_id,'groupUID'=>$groupUID,'sendersrefno'=>$appTitle,'outdocvar'=>$outdocvar);


@@vars=$vars;

$aVars = array();
foreach ($vars as $key => $val)
{
$obj = new variableStruct();
$obj->name = $key;
$obj->value = $val;
$aVars[] = $obj;
}
# process and its first task.

if(@@BICCODE=='condition1')
{
$params = array(array('sessionId'=>$sessionId, 'processId'=>'PRO_UID',
'taskId'=>'TASK_UID', 'variables'=>$aVars));
$result = $client->__SoapCall('newCase', $params);
if ($result->status_code == 0)
print "New case ID: $result->caseId, Case No: $result->caseNumber \n";

else
print "Error creating case: $result->message \n";


$query1 = executeQuery("select APP_UID from APP_CACHE_VIEW where DEL_INDEX='1' and TAS_UID='TASK_UID' and APP_STATUS='DRAFT'");
@@query1=$query1;
@@appUid = $query1[1]['APP_UID'];
$appUid=@@appUid;
}

if(@@BICCODE=='condition2')
{
$params = array(array('sessionId'=>$sessionId, 'processId'=>'PRO_UID',
'taskId'=>'TASK_UID', 'variables'=>$aVars));
$result = $client->__SoapCall('newCase', $params);
if ($result->status_code == 0)
print "New case ID: $result->caseId, Case No: $result->caseNumber \n";

else
print "Error creating case: $result->message \n";


$query1 = executeQuery("select APP_UID from APP_CACHE_VIEW where DEL_INDEX='1' and TAS_UID='TASK_UID' and APP_STATUS='DRAFT'");
@@query1=$query1;
@@appUid = $query1[1]['APP_UID'];
$appUid=@@appUid;
}

$params = array(array('sessionId'=>$sessionId, 'caseId'=>$appUid,'delIndex'=>'1'));
$result = $client->__SoapCall('routeCase', $params);
if ($result->status_code == 0)
print "New case ID: $result->caseId, Case No: $result->caseNumber \n";

else
print "Error creating case: $result->message \n";


}

else if(@@BICCODE=='condition4' || @@BICCODE=='condition5' || @@BICCODE=='condition6')
{


$query = executeQuery("select GRP_UID from GROUPWF where GRP_TITLE in(select GROUPNAME from PMT_M_BICCODE_GROUP_MAP where BICCODE='$BICCODE')");
@@query=$query;
@@groupUID = $query[1]['GRP_UID'];
}
else
{

print "Error creating case: $result->message \n";

}
User avatar
By programerboy
#827411
Hi,
Please check this link:
https://wiki.processmaker.com/3.0/ProcessMaker_WSDL_Web_Services#getVariables.28.29
https://wiki.processmaker.com/3.0/ProcessMaker_WSDL_Web_Services#Other_Programming_Languages

You may need to use the following code before sending grids:
Code: Select all
@@MyGridSerialized = serialize(@=MyGrid);
https://pmlearning.info
Thanks

A BC.Game Clone Script provides an investor with a[…]

Yes, Pain O Soma 500 can indeed help treat muscl[…]

VCCL is a leading web hosting service provider, re[…]

Many options exist for converting EML to CSV files[…]