Using the FWProcessInstance API

Learn about the FWProcessInstance API

Last published at: July 30th, 2024

Get a specific Process Instance

FWProcessInstance oInst = oRuntime.GetInstance(“id of the instance”);

Gets the specific Process instance object 

 

Execute a Process Instance

Bool bFlag = oInst.Execute();

Executes the Process instance 

 

Execute a Process Instance

Hashtable oInParms = new Hashtable(); 

oInParms[“varA”] = “some value”; 

bFlag = oInst.Execute(oInParms);

Sets the default values of the Process instance variables using InParms and executes the Process instance 

 

Get the definition for the Process instance

FWProcessDefinition oDef = oInst.GetDefinition(); Insert your text here

Returns the Process definition object for the instance 

 

Get the parent instance

FWProcessInstance oParentInst = oInst.GetParentInstance();

Returns the parent instance for the selected instance

 

Get Sub-Process instances

List oList = oInst.GetSubWokflowInstances();

Returns a list of sub-Process instances for the current instance 

 

Check if the Process instance has sub-process

Bool bFlag = oInst.InstanceHasSubWorklfows();

Returns True/False indicating if the Process instance has child Process 

 

Get a list of tasks for the Process instance

DataTable oTaskListData = oInst.GetTasks();

Returns a data list table of tasks for the current instance 

 

Close all open tasks for the Process instance

Bool bFlag = oInst.CloseAllOpenTasks();

Closes all open tasks for the current instance 

 

Get properties for the Process instance

Hashtable oProps = oInst.GetProperties();

Hashtable oProps = oInst.GetProperties(“instanceName”, “defID”);

Gets all properties for the Process instance

Returns property information for only selected properties

 

Update properties of the Process instance

Hashtable oProps = new Hashtable(); 

oProps[“instanceName”] = “FMLA Leave 0045”; 

bool bFlag = oInst.UpdateProperties(oProps);

Updates the provided properties for the Process instance 

 

Update the Process instance XML

Bool bFlag = oInst.UpdateInstanceXML(“xml string”);

Updates the XML for the Process instance 

 

Get all start variables for the Process instance

Hashtable oVars = oInst.GetStartupVariables();

Gets a list of startup variables for the Process instance 

 

Get a list of required variables for the Process instance

List oList = oInst.GetRequiredVariables();

Gets a list of all required variables 

 

Get UI model for the Process instance

clsModel oModel = oInst.GetUIModel();

Returns the UI modeling object for the current instance 

 

Add a message to execution iteration

bool bFlag= oInst.AddMessageToExecutionIteration(“id of the step”, “execution iteration #”, “message key”, “message”);

Adds messages to the execution iteration information 

 

Generate a graphical view of the Process instance

bool bFlag = oInst.GenerateModelGraphic(“show execution path”, “image output file path”, “image file path”);

Generates a graphical view of the instance using the PNG file format 

 

Generate execution view of the Process instance

bool bFlag=oInst.GenerateModelExecutionViewGraphic(“image output file path”, “image file path”, “string to hold the image map”);

Generates an execution view of the instance using the PNG file format 

 

Get execution log messages

DataTable oDT = oInst.GetLogMessages(); Insert your text here

Gets a list of all execution log messages for the instance 

 

Reset the Process instance

Bool bFlag = oInst.Reset();

Resets the Process instance to the start, also updates the instance using the latest definition 

 

Reset the Process instance back to a figure

Bool bFlag = oInst.ResetBackToFigure(“id of the execution iteration”);

Bool bFlag = oInst.ResetBackToFigure(“id of the figure”, “iteration #”);

Resets the Process instance back to the selected figure 

Resets the Process instance back to the selected figure and iteration