Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

Creates a new Process based on a provided workflow and a file.


This Process can be inserted into the database by calling the InsertProcess method.

Classes: CustomNode, CaptureImporter


Overloads

CreateProcessByWorkflowName Method#CreateProcessByWorkflowName(string, string)

Creates a new Process based on a workflow by name.

Creates a new Process beginning at a specific node in the workflow by name.



CreateProcessByWorkflowName(string, string) 
Anchor
CreateProcessByWorkflowName(string, string)
CreateProcessByWorkflowName(string, string)

Creates a new Process based on a file path in the workflow by name.

Code Block
public Process CreateProcess(string path);


Parameters

value string

File to spawn the new process from.

value string

Name of workflow to base the process on.

Returns

Process

A new process held in memory.


Example

The following example demonstrates creating a new process from a file and then inserting that process into the database.

Code Block
var filePath = @"C:\Documents\invoice.pdf";
var process = CreateProcess(filePath);
Database.InsertProcess(process);

Remarks

This method assumes there is a single initiator on the node from which to begin the process.

Throws an Exception if the targeted workflow is not found.

Throws an InvalidOperationException if there are multiple initiators on the process.

The original file that is targeted by this method for process is removed when the new process is created.

The returned Process will not exist in the database unless inserted using the InsertProcess method on the Database class.

Use care when creating processes from files without subsequently inserting them into the database. In these cases, the original file used to create the process is lost.


CreateProcessByWorkflowName(string, string, string) 
Anchor
CreateProcessByWorkflowName(string, string, string)
CreateProcessByWorkflowName(string, string, string)

Creates a new Process beginning at a specific node in the workflow by name.

Code Block
public Process CreateProcess(string path, string workflowName, string startNode);


Parameters

value string

File to spawn the new process from.

value string

Name of workflow to base the process on.

value string

Name of the node at which to begin the process.

Returns

Process

A new process held in memory.


Example

The following example demonstrates creating a new process from a file, beginning at the node "Target Node", and then inserting that process into the database.

Code Block
var filePath = @"C:\Documents\invoice.pdf";
var process = CreateProcess(filePath, "Target Node");
Database.InsertProcess(process);

Remarks

Throws an Exception if the targeted workflow is not found.

Throws an Exception if the targeted node is not found.

The original file that is targeted by this method for process is removed when the new process is created.

The returned Process will not exist in the database unless inserted using the InsertProcess method on the Database class.

Use care when creating processes from files without subsequently inserting them into the database. In these cases, the original file used to create the process is lost.