Activate all workflows
1. in simulator create new script with method Service_PreInvoke
2. in methods create new one ActAll
3. in simulator run new script with method ActAll by button Run
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) {
if (MethodName=="ActAll")
{
var sErr=""
var bo=TheApplication().GetBusObject("Front Office Workflow");
var bc=bo.GetBusComp("Repository Workflow Process Read Only");
var sId;
bc.ClearToQuery();
bc.SetViewMode(AllView);
bc.ActivateField("Status");
bc.SetSearchExpr("[Status] = LookupValue ('WFR_DSGN_STAT_CD','COMPLETED')");
bc.ExecuteQuery(ForwardOnly);
var irec=bc.FirstRecord();
while (irec) {
sId=bc.GetFieldValue("Id");
try {
bc.InvokeMethod("Activate");
}
catch (e) {
sErr+="|Id: " + sId + " >> " + e.toString();
}
irec=bc.NextRecord();
}
Outputs.SetProperty("SErrors", sErr);
return (CancelOperation);
}
return (ContinueOperation);
}