Hi, could anyone provide a sample of how to find a workflow using c# web services and then delegate the workflow.
Hi Markl
I don't do C# but it shouldn't take too much to port this Powershell snippet:
try {$OTWSws = New-WebServiceProxy -Uri $OT_WS_AUTH} catch { $errmsg = "Could not connect to $OT_WS_AUTH because " + $error[0].Exception.Message LogMessage $errmsg $ERRMSG_E_SYSTEM_ERROR $LOG_ERR return $ERRMSG_E_SYSTEM_ERROR } $authtoken = $OTWSws.authenticateuser($luser,$lpass) try {$sotmem = New-WebServiceProxy -Uri $OT_WS_MEMBER} catch { $errmsg = "Could not connect to $OT_WS_MEMBER because " + $error[0].Exception.Message LogMessage $errmsg $ERRMSG_E_SYSTEM_ERROR $LOG_ERR return $ERRMSG_E_SYSTEM_ERROR } $tmp = $sotmem.getType().namespace $attribute=New-Object($tmp + ".OTAuthentication") $attribute.AuthenticationToken=$authtoken $sotmem.OTAuthenticationValue = $attribute try {$member = $sotmem.getmemberbyloginname('kinch') catch { $errmsg = "Could not find kinch because " + $error[0].Exception.Message LogMessage $errmsg $ERRMSG_E_SYSTEM_ERROR $LOG_ERR return $ERRMSG_E_SYSTEM_ERROR } try {$sotwf = New-WebServiceProxy -Uri $OT_WS_WORKFLOW} catch { $errmsg = "Could not connect to $OT_WS_WORKFLOW because " + $error[0].Exception.Message LogMessage $errmsg $ERRMSG_E_SYSTEM_ERROR $LOG_ERR return $ERRMSG_E_SYSTEM_ERROR } $tmp = $sotwf.getType().namespace $attribute=New-Object($tmp + ".OTAuthentication") $attribute.AuthenticationToken=$authtoken $sotwf.OTAuthenticationValue = $attribute $ph = New-Object($tmp + ".processsearchoptions") $ph.pagesize=20 $ph.RetrieveActivities = $false $ph.RetrieveProcessData = $false $ph.where = "" try {$lwfs = $sotwf.listprocesses($ph)} catch { $errmsg = "Could not retrieve workflow assignment list because " + $error[0].Exception.Message LogMessage $errmsg $ERRMSG_E_LOAD_APPLICATION $LOG_ERR return $ERRMSG_E_LOAD_APPLICATION } foreach ($proc in $lwfs.processes) { if ($proc.'Title' -eq 'workflow to search for') { try ($sotwf.delgateworkitem($proc.processid, $proc.subprocessid, '', $member.ID) } }
RetrieveActivities
RetrieveProcessData = $false $ph.where = ""
You can populate $ph.where to narrow down the results though I'm not 100% of the format of the string, also as getlistprocessesresults() uses a pagehandle, it really should be in a loop in case there are more results then fit within a single page (12 in the above). But this should get you pretty far down the road.