Workflow Interface
The Workflow interface describes a hosted control that acts as a workflow control. The interface implements the methods of the previous IHostedApplication3 interface.
The following figure shows the public structure of the interface:
|
Element |
Description |
|---|---|
|
ControlParent property |
Contains the parent container of the hosted control |
|
CurrentWorkflow property |
Contains the current active workflow. |
|
isControlEnabled property |
Contains a Boolean value indicating if the hosted control is enabled. |
|
isControlVisible property |
Contains a Boolean value indicating if the hosted control is visible. |
|
isForced property |
Contains a Boolean value indicating if the workflow is forced. |
|
WorkflowNotStarted |
Contains a Boolean value indicating if the workflow has not started. |
|
Clear method |
The method clears the contents of the workflow. |
|
IsWorkflowPending method |
The method returns whether the workflow XML in the Session's Workflow string property a valid pending workflow. |
|
StartWorkflowById method |
The method starts a workflow using the ID of the workflow passed to the method. |
|
StartWorkflowByIndex method |
The method starts a workflow using the index value passed to the method. |
|
StartWorkflowByName method |
The method starts a workflow using the name of the workflow passed to the method. |
|
WorkflowUpdate method |
The method refreshes the workflow view. |
The following code snippet illustrates a sample StartWorkflowById method. The ID of the workflow to be started is passed as the argument workflowID in the sample.
public void StartWorkflowByID(int workflowID)
{
foreach (WorkflowData workflow in AllWorkflows)
{
if (workflow.WorkflowId == workflowID)
{
StartWorkflowByName(workflow.WorkflowName);
break;
}
}
}
The following code snippet illustrates a sample StartWorkflowByName method. The name of the workflow to be started is passed as the argument name in the sample.
public void StartWorkflowByName(string name)
{
for (int index = 0; index < comboAvailableWorkflows.Items.Count; index++)
{
if (comboAvailableWorkflows.Items[index].ToString() == name)
{
StartWorkflowByIndex(index);
break;
}
}
}