Click or drag to resize

RuntimeServiceCreateUser Method

Creates a user. Intended for web use only.

Namespace:  Advantys.Workflow.Web.Services.Processes.Runtime
Assembly:  Advantys.Workflow.Web.Services.Processes.Runtime (in Advantys.Workflow.Web.Services.Processes.Runtime.dll) Version: 8.0.6.0 (8.0.6.20210916)
Syntax
public int CreateUser(
	string userDefinition
)

Parameters

userDefinition
Type: SystemString
Definition of the user as an XML string. Element names are case sensitive.

Return Value

Type: Int32
Returns the created user ID.
Remarks
Available since WorkflowGen version: 6.2.0

Optional Parameters.

These parameters can be used in the query string or as parameters of the Headers object in the RuntimeService class instance. See example below.

IgnoreMissingAssociations (bool)Sets whether or not to return an error when an association (group) is missing from the target. Default = true.

Sample user definition with required fields:
XML
<User>  
  <Directory>
    <Name>WorkflowGen</Name>
  </Directory>  
  <LastName>Gate</LastName>
  <Username>MyUsername</Username>
  <Email>b.gate@company.com</Email>
</User>

Complete user definition with updatable fields:
XML
<User>  
  <Directory>
    <Name>WorkflowGen</Name>
  </Directory>  
  <FirstName>First name</FirstName>
  <LastName>Last name</LastName>
  <Username>username</Username>
  <Email>username@company.com</Email>
  <Profile>User</Profile> <!-- User, Administrator -->
  <Active>Y</Active> <!-- Y, N -->
  <Synchronized>Y</Synchronized> <!-- Y, N -->
  <DefaultLanguage>en-CA</DefaultLanguage>
  <DefaultTimeZoneId>9</DefaultTimeZoneId>  
  <Phone>Phone number</Phone>
  <Mobile>Mobile number</Mobile>
  <Fax>Fax</Fax>
  <Pager>Pager</Pager>
  <Office>Office</Office>
  <Department>Department</Department>
  <Company>Company</Company>
  <JobTitle>Job title</JobTitle>
  <EmployeeType>Employee type</EmployeeType>
  <Initials>Initials</Initials>
  <Title>Title</Title>
  <EmployeeNumber>Employee number</EmployeeNumber>
  <PostalAddress>Postal address</PostalAddress>
  <PostalCode>Postal code</PostalCode>
  <City>City</City>
  <State>State</State>
  <Country>Country</Country>
  <LDAP_ADsPath>LDAP ADs path</LDAP_ADsPath>
  <CommonName>Common name</CommonName>
  <DistinguishedName>Distinguished name</DistinguishedName>    
  <ExtendedAttribute1>Extended attribute 1</ExtendedAttribute1>
  <ExtendedAttribute2>Extended attribute 2</ExtendedAttribute2>
  <ExtendedAttribute3>Extended attribute 3</ExtendedAttribute3>
  <ExtendedAttribute4>Extended attribute 4</ExtendedAttribute4>
  <ExtendedAttribute5>Extended attribute 5</ExtendedAttribute5>
  <SystemIdentifier>System identifier</SystemIdentifier>
  <Manager>
    <Username>username1</Username>
  </Manager>  
  <Groups>
    <Group>
      <Name>Group1</Name>
    </Group>
    <Group>
      <Name>Group2</Name>
    </Group>
  </Groups>
</User>

Sample code:
RuntimeServiceWebService.RuntimeService myRuntimeService = new RuntimeServiceWebService.RuntimeService();
RuntimeServiceWebService.UserHeader myUserHeader = new RuntimeServiceWebService.UserHeader();
myRuntimeService.UserHeaderValue = myUserHeader;

myUserHeader.IgnoreMissingAssociations = ignoreMissingAssociations;

int myCreatedUserId = myRuntimeService.CreateUser(userDefinition);

See Also