How to fetch subprocess id based Parent Process
788981Dec 16 2010 — edited Dec 16 2010Hi All,
I have a requirement wherein i need to abort child instance based on parent process id. We have couple of subprocesses created in the Process. I am using following code but somehow it is giving empty values for child process Id. Any help on this would be highly appreciated.
logMessage "Handle Expired Items Activity - Start"
cbp as BusinessProcess
instancesArry as String[String]
do
connectTo cbp
using url = Fuego.Server.directoryURL,
user = "testuser",
password = "testuserx",
process = "/OSResearch"
instancesArry = this.children
logMessage "No of child instances are" + length(instancesArry)
logMessage "Current instance id is..." + this.id.id
logMessage "let us see some details from instance Array."
logMessage "OS-RSOSR : Children:" + children
logMessage "\n OS-RSOSR : Keys:" + children.keys
logMessage "\n OS-RSOSR : Length" + length(children)
logMessage "\n OS-RSOSR : Instance id of child: " + children["keys"]
if children["keys"] = null or children["keys"] = "" then
logMessage "OS-RSOSR : Child is completed"
else
logMessage "OS-RSOSR : came to else block so we have instances related to child process"
// BusinessProcess bp;
// bp.connectTo(url : Fuego.Server.directoryURL, user : "testuser", password : "testuserx",
// process : "/OSResearchPrep");
instance as Fuego.Papi.Instance
instance = getInstance(cbp, instance : children["keys"])
logMessage "OS-RSOSR : run Instance: " + instance.id
using severity = DEBUG
logMessage "OS-RSOSR : Status: " + instance.status + "; inside the child process in the activity: " + instance.activityName
abort instance
// bp.disconnectFrom();
end
on a as Any
logMessage "OS-RSOSR: Exception inside Handle Expired Items Activity is " + String(a)
using severity = DEBUG
// setting the current activity name.
lienValidationSF.lienInfo.activityName = "Handle Expired Items"
throw OSBusinessException(a)
on exit
if cbp != null then
disconnectFrom cbp
end
end
logMessage "OS-RSOSR : Handle Expired Items Activity - End"
Edited by: Sunil on Dec 16, 2010 7:13 AM