Set Custom Attributes

API Type

Web Services

Description

Sets names and values for multiple custom attributes for a specified custom ID.

Syntax

public virtual void SetCustomAttrs(string customID, NameValue[] nameValues)

Parameters

Name Description

customID

Definition:
A work object ID specified within a process instance.
Type
string
Allowed Values:
One valid work object ID.

attributes

Definition:
Name-value pairs associated with a custom ID.
Type
NameValue
Allowed Values:
A valid custom ID with an associated name.

Output

None.

Example

IWFWorkflowService svc = GetWorkflowService();
string customID = ..// for example, "InfoPath:011eaf6c46ac4723b25b4db5772d9912"

NameValue[] attributes = new NameValue[] 
    {
    new NameValue("CustomAttributeName1","CustomAttributevalue1"),
    new NameValue("CustomAttributeName2",false),
    new NameValue("CustomAttributeName3", 10.0)
	};

try
	{
    svc.SetCustomAttrs(customID, attributes);
	}

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

Supported Versions

3.2.0.4 and higher