CreateProcessByWorkflowName Method
Creates a new Process based on a provided workflow and file.
This Process can be inserted into the database by calling the InsertProcess method.
Classes: CustomNode, CaptureImporter
Overloads
CreateProcessByWorkflowName(string, string)
Creates a new Process based on a file path in the workflow by name.
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.
Example
The following example demonstrates creating a new process from a file and then inserting that process into the database.
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.
This method supports a null or empty string path argument. This will create a process without a document.
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)
Creates a new Process beginning at a specific node in the workflow by name.
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.
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.
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.
This method supports a null or empty string path argument. This will create a process without a document.
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.