Click or drag to resize

RuntimeServiceCreateGroup Method

Creates a group. 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: 7.18.0.0 (7.18.0.20200311)
Syntax
public int CreateGroup(
	string groupDefinition
)

Parameters

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

Return Value

Type: Int32
Returns the new group 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.

ReplaceIfExists (bool)Sets whether or not to replace a group with the same name. Default = false
IgnoreMissingAssociations (bool)Sets whether or not to return an error when an association (user) is missing from the target. Default = true

Sample group definition with Usernames:
XML
<Group>
  <Name>My group</Name>
  <Description>My group's description</Description>  
  <Directory>
    <Name>WORKFLOWGEN</Name>
  </Directory>
  <Email>MyGroupEmail@WorkflowGen.com</Email>
  <LDAP_ADsPath>ADs Path</LDAP_ADsPath>
  <DistinguishedName>Distinguished name</DistinguishedName>
  <CommonName>Common name</CommonName>
  <Code>Code</Code>
  <SystemIdentifier>System identified</SystemIdentifier>
  <Synchronized>Y</Synchronized> <!-- Y, N -->
  <Users>
    <User>
      <Username>Username1</Username>
    </User>
    <User>
      <Username>Username2</Username>
    </User>
  </Users>
</Group>

Sample group definition with DataSourceQuery:
XML
<Group>
  <Name>My group</Name>
  <Description>My group's description</Description>  
  <Directory>
    <Name>WORKFLOWGEN</Name>
  </Directory>
  <Email>MyGroupEmail@WorkflowGen.com</Email>
  <LDAP_ADsPath>ADs Path</LDAP_ADsPath>
  <DistinguishedName>Distinguished name</DistinguishedName>
  <CommonName>Common name</CommonName>
  <Code>Code</Code>
  <SystemIdentifier>System identified</SystemIdentifier>
  <Synchronized>Y</Synchronized>
  <DataSourceQuery>DEPARTMENT = 'Accounting'</DataSourceQuery>
</Group>

Sample code:
RuntimeServiceWebService.RuntimeService myRuntimeService = new RuntimeServiceWebService.RuntimeService();
RuntimeServiceWebService.GroupHeader myGroupHeader = new RuntimeServiceWebService.ImportGroupHeader();
myRuntimeService.GroupHeaderValue = myImportGroupHeader;

myGroupHeader.ReplaceIfExists = replaceIfExists;
myGroupHeader.IgnoreMissingAssociations = ignoreMissingAssociations;

int groupId = myRuntimeService.CreateGroup(groupDefinition);


See Also