Create Work Item

API Type

Web Services

Description

Creates a manual work item.

Syntax

public virtual WFEvent CreateWorkItem(string ActivityInstanceID, string WorkToPerform, string UserID, WFTimeDuration Length, string ClientData)

Parameters

Name Description

ActivityInstanceID

Definition:
The unique ID for an activity instance.
Type
string
Allowed Values:
A valid activity instance ID.

WorkToPerform

Definition:
Represents the task that performed by the participants of the activity.
Type
string
Allowed Values:
A valid work to perform name.

UserID

Definition:
Specifies the user associated with the work item.
Type
string
Allowed Values:
A valid user ID.

Length

Definition:
Specifies the length of time duration.
Type
string
Allowed Values:
A valid time duration length.

ClientData

Definition:
Specifies the client data, which identifies a client for AgilePoint Server.
Type
string
Allowed Values:
A string that contains the client data.

If this value is null, the system will keep existing client data. Otherwise the relevant data is overwritten.

Output

WFEvent object that provides the status of the transaction. The possible statuses are:

  • Sent - Indicates event has been sent to engine for processing.
  • Failed - Indicates event failed to process.
  • Processed - Indicates event has been processed successfully.
  • Canceled - Indicates event was canceled.
  • Deferred - Indicates event does not need to be sent immediately.

Example

IWFWorkflowService svc = GetWorkflowService();
string ActivityInstanceID = … // for example, "0172460E0AF943C6A6520044452BCAB3";
string WorkToPerform = … // for example, "SubmitRequest";
//different WorkToPerform can be used if desired

WFTimeDuration Length = new WFTimeDuration("15", WFTimeUnit.DAY, true );// business time
string UserID = @"[DOMAIN NAME]\username"; //the participant of the linked work item

try
	{
    WFEventevt = svc.CreateWorkItem(ActivityInstanceID,
    WorkToPerform, UserID, Length, null);
	}

catch(Exception ex)
	{
    Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
    }

Supported Versions

3.2.0.4 and higher