Launches a process specified by Name.

Namespace: ININ.IceLib.ProcessAutomation
Assembly: ININ.IceLib.ProcessAutomation (in ININ.IceLib.ProcessAutomation.dll) Version: 0.0.0.0 (22.3.0.218)

Syntax

C#
public ProcessInstance LaunchProcessByName(
	string processName,
	ProcessLaunchParameters launchParameters
)
Visual Basic
Public Function LaunchProcessByName ( _
	processName As String, _
	launchParameters As ProcessLaunchParameters _
) As ProcessInstance

Parameters

processName
Type: System..::..String
The process Name.
launchParameters
Type: ININ.IceLib.ProcessAutomation..::..ProcessLaunchParameters
The parameters needs to be set while launching the process.

Return Value

The created Process Instance.

Remarks

NOTE: See the ININ.IceLib.ProcessAutomation namespace documentation for additional details on the required licenses for this method.

The name of the process needs to exactly match the name given to the process by the process designer.

Ensure the process is published in Interaction Process Automation and ensure that the launching user has "Launch Process" access control rights in Interaction Administrator, otherwise the launch will fail.

Examples

The following code can be used to connect to the IC server, connect as the specified user, and launch a process with a set of initial data.
CopyC#
Session session = new Session();
session.Connect(...);
ProcessManager wfManager = ProcessManager.GetInstance(session);
ProcessLaunchParameters parameters = new ProcessLaunchParameters();

// This creates an XmlDocument to be passed into the launch as the initial values
// for process input variables.  See the documentation for InputDocument for the example
// code for CreateInputXmlDocument().
parameters.InputDocument = CreateInputXmlDocument();
try
{
    ProcessInstance instance = wfManager.LaunchProcessByName("Sample Process Launch", parameters);
    if (instance != null)
    {
        Console.WriteLine("Process started Id: " + instance.NumericId);
    }
    else
    {
        Console.WriteLine("Failed to start process. LaunchProcessByName returned a null instance.");
    }
}
catch (Exception exception)
{
   Console.WriteLine("Caught an exception while starting the process: " + exception.Message);
}

Exceptions

ExceptionCondition
System..::..ArgumentExceptionAn argument was invalid.
System..::..ArgumentNullExceptionA parameter is a null reference (Nothing in Visual Basic).
ININ.IceLib.Connection..::..RequestTimeoutExceptionThe request timed out while waiting for a response.
ININ.IceLib.Connection..::..SessionDisconnectedExceptionThe Session does not have a valid connection.
System..::..ObjectDisposedExceptionThe Session has been disposed.

Version Information

Supported for IC Server version 2015 R1 and beyond.
For 4.0, supported for IC Server version 4.0 GA and beyond.
For 3.0, supported for IC Server version 3.0 SU 8 and beyond.

See Also