Click or drag to resize

RuntimeServiceCreateParticipant Method

Creates a participant. 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 CreateParticipant(
	string participantDefinition
)

Parameters

participantDefinition
Type: SystemString
Definition of the participant to create. Element names are case sensitive.

Return Value

Type: Int32
The new participant 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 participant with the same name. Default = false.
IgnoreMissingAssociations (bool)Sets whether or not to return an error when an association (user, group, directory) is missing from the target. Default = true.
Sample global participant definition:
XML
<Participant>
  <Name>MYGLOBALPARTICIPANT</Name>
  <Description>My desc</Description>
  <Type>HUMAN</Type>                         <!-- HUMAN, ROLE, COORDINATOR -->
  <Scope>GLOBAL</Scope>                      <!-- GLOBAL, PROCESS -->
  <Associations>
    <Users>
      <User>                                                   
        <Username>wfgen_admin</Username>                 
      </User>                                                  
    </Users>                                                   
    <Groups />                                                 
    <Directories />                                            
    <Coordinators />
  </Associations>
  <Process />
</Participant>
Sample process specific implementation of a global participant definition:
XML
<Participant>
  <Name>MYGLOBALPARTICIPANT</Name>
  <Description>My desc</Description>
  <Type>HUMAN</Type>                         <!-- HUMAN, ROLE, COORDINATOR -->
  <Scope>GLOBAL</Scope>                      <!-- GLOBAL, PROCESS -->
  <Associations>
    <Users>
      <User>
        <Username>wfgen_admin</Username>
      </User>
    </Users>
    <Groups />
    <Directories />
    <Coordinators />
  </Associations>
  <Process>
    <Name>MYPROCESS</Name>
    <Version>1</Version>
  </Process>
  <Role>SUPERVISOR</Role>                              <!-- REQUESTER, ACTOR, SUPERVISOR -->
  <ViewGraphics>Y</ViewGraphics>                       <!-- Y, N -->
  <ReassignAction>Y</ReassignAction>                   <!-- Y, N -->
  <CancelRequest>Y</CancelRequest>                     <!-- Y, N -->
  <ViewStatistics>Y</ViewStatistics>                   <!-- Y, N -->
  <CommentsPermissions>RW</CommentsPermissions>        <!-- R, RW  -->
  <DatasourceQuery>
  </DatasourceQuery>
</Participant>
Note: CommentsPermissions can also be empty or ommitted, which indicates no comments permissions (neither read nor write)
Sample code:
RuntimeServiceWebService.RuntimeService myRuntimeService = new RuntimeServiceWebService.RuntimeService();
RuntimeServiceWebService.ParticipantHeader myParticipantHeader = new RuntimeServiceWebService.ParticipantHeader();
myRuntimeService.ParticipantHeaderValue = myParticipantHeader;

myParticipantHeader.ReplaceIfExists = replaceIfExists;
myParticipantHeader.IgnoreMissingAssociations = ignoreMissingAssociations;

int myCreatedParticipantId = myRuntimeService.CreateParticipant(participantDefinition);

See Also