Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Overview

Initiates a new instance by specified arguments.

WorkItem myWorkItem.Initiate(inputData: ( string | Xml ), process: string, options: InitiateOptions)

Arguments

( string | Xml ) inputData
Input data to pass new workflow instance in xml string or xml object.
string process
Specifies the process of new instance. Can be Name or Id number of process. If not specified current process is used.
Specifies the options of new instance.

Returns

Instance of initiated workflow's first work item in 'Created' or 'Waiting' state.

Example

Basic Usage

var formData = '<Root><Name>Lady</Name><Surname>Gaga</Surname></Root>';
var childWorkItem = $WorkItem.Initiate(formData, 'My Process');

Example

Initiate by Task Name

var formData = '<Root><Name>Lady</Name><Surname>Gaga</Surname></Root>';
var childWorkItem = $WorkItem.Initiate(formData, 'My Process', {
      task : 'My Task'
});

Example

Initiate with User and Culture

var formData = '<Root><Name>Lady</Name><Surname>Gaga</Surname></Root>';
var initiator = $Membership.Administrator;
var childWorkItem = $WorkItem.Initiate(formData, 'My Process', {
        task : 'My Task',
        initiator : initiator.id,
        culture: 'tr-TR'
});

Types

InitiateOptions

{ // Culture of new instance. If not specified uses the current instance culture. Culture : string // Identity of initiator. If not specified null value used. Initiator : string // Parent work item. If not specified current work item is set as parent. Parent : string // Name or Id of task to be initiated. If not specified, uses the Initiator task if found only one exist, otherwise throws error. Task : string // Specifies the initiate in test mode or not. If not specified uses the current instance's test mode state. TestMode : boolean // Version of process to initiate Version : string }

  • No labels