Using a Script to Create Property Sets, Set Values in PS, Add Child PS, and Call BS with InputPS
The following example script shows how to create property sets, set values in
PropertySets
, add child PS to parent psInputs
, and call
the business service with the Input PropertySets
:
//Create Property Sets
var psRequest = app.NewPropertySet();
var psAgentNumTag = app.NewPropertySet();
var sAgentID;
//Set values in PropertySets
sAgentID = app.LoginName();
psRequest.SetType("XMLHierarchy");
psAgentNumTag.SetType("DataAgentNumber");
psAgentNumTag.SetValue(sAgentID);
psRequest.AddChild(psAgentNumTag);
//Add child PS to parent psInputs
psInputs.AddChild(psRequest); //Pass in Property Set
psInputs.SetProperty("RequestURLTemplate", requestURLTemplate); //Pass in string
psInputs.SetProperty("RequestSubType", reqSubType);
psInputs.SetProperty("ReqType", reqType);
psInputs.SetProperty("MessageName", msgName);
psInputs.SetProperty("CICSServiceName", CICSServiceName);
psInputs.SetProperty("ProcessName", processName);
psInputs.SetProperty("Request File Name", reqFileName);
psInputs.SetProperty("Response File Name", resFileName);
//Invoke the business service with the Input PropertySets.
var svc = TheApplication().GetService(“Workflow Process Manager”);
svc.InvokeMethod("RunProcess", psInputs, psOutputs); //Call the Workflow
var sErr = psOutputs.GetProperty("status"); //Check the Workflow status