Class Assignment

java.lang.Object
com.appiancorp.suiteapi.process.Assignment
All Implemented Interfaces:
JSONable, JSONCacheable, XMLable, AppianTypeHolder, Serializable

public class Assignment extends Object implements JSONCacheable, XMLable, AppianTypeHolder
Holds the configuration for the assignment of an attended node. An assignment can be to users, groups, roles, or rules. A role is someone associated with the process, such as the initiator. A rule is a function that runs to determine assignment, such as one that picks the person who costs the least or is least burdened from a database. Once the assignee pool has been configured (the assignees field in this object), the assignment function must run to choose a number of users from the pool. The task is ultimately assigned to the users chosen by the assignment function.

Multiple instances of a node can run in a process because of Spawning, Recurrence or Loops in the process model. In these cases, the process engine provides separate assignment functions which can be used to either distribute the tasks across the users in the assignment pool or assign the next instance of the tasks to the user who completed previous instances of the task. It should be noted that assignment can be distributed only when the node is set to spawn and task can be assigned to previous assignee only when node is not set to spawn.

See Also:
  • Field Details

    • ASSIGNEE_TYPE_EXPRESSIONS

      public static final int ASSIGNEE_TYPE_EXPRESSIONS
      Constant indicating that an assignment is to an expression
      See Also:
    • ASSIGNEE_TYPE_USERS

      public static final int ASSIGNEE_TYPE_USERS
      Constant indicating that an assignment is to a user.
      See Also:
    • ASSIGNEE_TYPE_GROUPS

      public static final int ASSIGNEE_TYPE_GROUPS
      Constant indicating that an assignment is to a group.
      See Also:
    • ASSIGNEE_TYPE_ROLE

      public static final int ASSIGNEE_TYPE_ROLE
      Constant indicating that an assignment is to a role.
      See Also:
    • ASSIGNEE_TYPE_FUNCTION

      @Deprecated public static final int ASSIGNEE_TYPE_FUNCTION
      Deprecated.
      This assignment type is not used.
      Constant indicating that an assignment is chosen by a function.
      See Also:
    • ASSIGNEE_TYPE_ACTOR

      public static final int ASSIGNEE_TYPE_ACTOR
      Constant indicating that an assignment is to an actor
      See Also:
    • PRIVILEGE_REJECT_ONLY

      public static final Long PRIVILEGE_REJECT_ONLY
      Allowed only to reject the task.
    • PRIVILEGE_REASSIGN_WITHIN_POOL

      public static final Long PRIVILEGE_REASSIGN_WITHIN_POOL
      Allowed to reject the task and to reassign the task within the assignment pool.
    • PRIVILEGE_REASSIGN_TO_ANY

      public static final Long PRIVILEGE_REASSIGN_TO_ANY
      Allowed to reject the task and to reassign the task to anyone.
    • ACCEPT_AUTO_ALWAYS

      public static final int ACCEPT_AUTO_ALWAYS
      Constant indicating that acceptance always happens automatically.
      See Also:
    • ACCEPT_AUTO_IF_ONLY_ASSIGNEE

      public static final int ACCEPT_AUTO_IF_ONLY_ASSIGNEE
      Constant indicating that acceptance happens automatically only if the size of the assignment pool is 1.
      See Also:
    • ACCEPT_MANUAL

      public static final int ACCEPT_MANUAL
      Constant indicating that acceptance must be performed manually by the runtime user.
      See Also:
    • MULTIPLE_INSTANCE_PREVIOUS_ASSIGNEE

      public static final int MULTIPLE_INSTANCE_PREVIOUS_ASSIGNEE
      Constant indicating that the new instance of the task should be assigned to the previous assignee of this task. This option will be ignored when the node is set to spawn multiple instances.
      See Also:
    • MULTIPLE_INSTANCE_DISTRIBUTE_ASSIGNEE

      public static final int MULTIPLE_INSTANCE_DISTRIBUTE_ASSIGNEE
      Constant indicating that the spawned instances of the tasks should be distributed across the users in the assignment pool. When the node is not set to spawn multiple instances, then this assignment option is ignored.
      See Also:
  • Constructor Details

    • Assignment

      public Assignment()
  • Method Details

    • getHiddenAttributes

      public HashSet getHiddenAttributes()
      Description copied from interface: JSONable
      Returns the set of attributes (properties) that should not be included in the JSON representation of the object.
      Specified by:
      getHiddenAttributes in interface JSONable
      Returns:
      the set of hidden attributes
    • getAssignees

      public Assignment.Assignee[] getAssignees()
      Returns the assignees for this Assignment
      Returns:
      assignees for the Assignment
    • setAssignees

      public void setAssignees(Assignment.Assignee[] assignees_)
      sets the assignees for this Assignment
      Parameters:
      assignees_ - the assignees to set for this Assignment
    • getAssignmentFunction

      @Deprecated public ActivityClass getAssignmentFunction()
      Deprecated.
      Use getAssignees instead; see setAssignmentFunction(com.appiancorp.suiteapi.process.ActivityClass) for an alternative method of setting the assignment.
      Returns:
      the ActivityClass which is the AssignmentFunction for this assignment
    • setAssignmentFunction

      @Deprecated public void setAssignmentFunction(ActivityClass assignmentFunction_)
      Deprecated.
      Instead, set the assignment by calling setAssignees(com.appiancorp.suiteapi.process.Assignment.Assignee[]) with an Assignee of type ASSIGNEE_TYPE_EXPRESSIONS with the value set to an expression.
      sets the AcitvityClass which is the assignment function for this assignment
      Parameters:
      assignmentFunction_ - the assignment activity class for this assignment
    • toXML

      public String toXML()
      Description copied from interface: XMLable
      Generates an XML representation of this object (including all child objects). A typical implementation is to create a new StringBuilder and call toXML( StringBuilder ) on it.
      Specified by:
      toXML in interface XMLable
      Returns:
      converts this assignment into xml and returns it as a string
    • toXML

      public void toXML(StringBuilder buffer_)
      Appends an XML representation of this object to the given buffer.
      Specified by:
      toXML in interface XMLable
      Parameters:
      buffer_ - The buffer on which to append the XML representation.
    • getAssignmentPosition

      @Deprecated public Long getAssignmentPosition()
      Deprecated.
      The value retrieved by this method is not used.
      Returns:
      the index into the list of preactivites at which assignment is performed.
    • setAssignmentPosition

      @Deprecated public void setAssignmentPosition(Long assignmentPosition_)
      Deprecated.
      The value set by this method is not used.
      Determines when assignment should run in the list of preactivities.
      Parameters:
      assignmentPosition_ - zero-based index into the list of preactivities, determining when assignement should be performed.
    • getAcceptMode

      public Long getAcceptMode()
      Returns:
      accept mode, as one of the ACCEPT_XXX constants.
    • setAcceptMode

      public void setAcceptMode(Long acceptMode_)
      sets the acceptmode
      Parameters:
      acceptMode_ - the acceptMode to set, which should be one of the ACCEPT_XXX constants.
    • getMultipleInstanceAssigneeType

      public Integer getMultipleInstanceAssigneeType()
      Returns the type of the Assignee function to use when multiple instances of are nodes executed in a process.
      See Also:
    • setMultipleInstanceAssigneeType

      public void setMultipleInstanceAssigneeType(Integer multipleInstanceAssigneeType_)
      Sets the type of the Assignee function when multiple instances of the nodes are executed in a process
      Parameters:
      multipleInstanceAssigneeType_ - Assignment.MULTIPLE_INSTANCE_PREVIOUS_ASSIGNEE or Assignment.MULTIPLE_INSTANCE_DISTRIBUTE_ASSIGNEE
    • fillInAppianTypes

      public void fillInAppianTypes(AppianTypeCache cache_)
      Adds the primary keys of each assignees that is a user or group to the appian type cache.
      Specified by:
      fillInAppianTypes in interface AppianTypeHolder
      Parameters:
      cache_ - cache of Appian-typed objects.