WorkflowDefinitionCreate Method (ConnectionId, SessionId, String, String, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Creates a new workflow definition item

Namespace: ContentStudio.Document.Workflow.Management
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public int Create(
	ConnectionId connectionId,
	SessionId sessionId,
	string name,
	string description,
	string definition
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value typically is retrieved from a call to the OpenSession method
name
Type: SystemString
The name of the workflow definition, this parameter cannot be empty but can be null to avoid changing the name.
The name must be unique thus two Workflow definitions cannot share the same name. The value cannot exceed MAX_WF_NAME_SIZE characters.
description
Type: SystemString
A description of the workflow definition. The value cannot exceed MAX_WF_DESCRIPTION_SIZE characters but can be null to indicate that the description should not be updated.
definition
Type: SystemString
Xml that represents the workflow definition to create. This argument cannot be null and must conform with the schema that can be obtained by using the GetWorkflowSchema method. The xml is formatted using the XSLT stylesheet returned by the GetWorkflowDefinitionXslt method.

Return Value

Type: Int32
the identifier of the workflow item
Exceptions

ExceptionCondition
CSException A business rule was violated in the underlying Content Studio database
NumberMeaning
1509The name may not be empty.
1512The name already in use, choose another name.
2001No valid license found
2002The trial license of Content Studio has expired.
2005No valid license could be found for the actual Content Studio plug-in.
1018 Permission denied. You do not have the group right needed to save executable content.
This exception occurs when a person that does not hold the WriteActiveContent global right and any of the steps in the workflow contains Enabling logic.
CSPermissionDeniedExceptionThe caller has no permission to perform the requested action
CSInvalidSessionExceptionThe session is invalid
CSInvalidParameterExceptionA parameter has an invalid value
SqlExceptionAn error occurred when executing the command against the Content Studio database
XmlSchemaExceptionThe xml contained in the definition does not conform with the schema.
XmlExceptionThe xml contained in the definition argument is invalid.
ArgumentOutOfRangeExceptionThe name or description arguments exceeds the maximum allowed length.
ArgumentNullExceptionThe name arguments is null.
Content Studio permissions

CREATE permission on the workflow definitions root is required in order to create a workflow item.
In Content Studio there is a possibility to write enabling logic code. In CS 4 this was written using a very simple syntax this possibility still exists in CS 5 and later but the enabling logic now can be written using .NET code and the language used is specified in a new optional enablinglogiclanguage attribute. If there is any Enabling logic specified in any step using a .NET programming language the caller must have the WriteActiveContent global right in order to be able to create the workflow definition.
Remarks

A valid license is required in order to save or create a Workflow definition. This license is included in the Enterprise Edition and as a separate license module for other editions.
See Also

Reference