Working With $Cursor Context Object

Using $Cursor for actions/conditions on process step

  • Start creating an action. Switch to Advanced mode (1)
  • Choose $Cursor context object (2)
  • Choose item from context object items picklist (3)

Cursor values:

  • Assignee - assignee value of an active cursor. Value depends on cursor Assignee Type: if assignee type is User, Group, Chatter Group, Queue, Role or Profile cursor assignee will store corresponding record IDs; if assignee type is "Call Apex", assignee will store result of apex method execution (string with comma separated user IDs or single user ID); if cursor assignee type is "Field", assignee will store string value of the corresponding field.
  • AssigneeType - assignee type of an active cursor. Can store one of the following values: User, Field, Group, ChatterGroup, Queue, Role, Profile, Call Apex.
  • Buffer - total amount of all process resolved tasks "buffers" (values representing time left in case task was resolved earlier than it's Due Date).
  • DueDate - date that represents an amount of cursor Start Date and Step Duration i.e., date on which current task falls due.
  • Duration - duration of current step.
  • Flow (several fields) - some fields of the process (flow), which a cursor related to.
  • FlowInstance (several fields) - some fields of the process (flow) instance, which cursor related to.
  • Id - cursor ID.
  • IsSystem - is current cursor step is system-driven.
  • MajorityType - "Majority Proceed" type. Can store one of the following values: "one can ok", "all must ok". This means that at least one assignee should complete/approve step to proceed, or all assignees must do this.
  • Risk - integer value indicating current task risk level in percents. When taks becomes active on time Risk value is 0, then it is increasing dynamically to become 100 when current DateTime meets task DueDate and the taks is still active.
  • RiskWithBuffer - current step risk value with buffer.
  • StartDate - date when the current task becomes active.
  • Status - current cursor status. Can store one of the following values: Pending, In Progress, Complete.
  • Step (several fields) - step, which is stored in current cursor.

On process actions with 'Before Step' type Cursor items represent values stored by cursor being linked to the previous process step, otherwise cursor items store values of a current cursor state.

Flow (Process version) values:

  • Flow.Description - related flow description.
  • Flow.Id - Id of a related flow object.
  • Flow.Name - related flow name.
  • Flow.ObjectType - related flow object type value.
  • Flow.ProcessId - related process Id.

FlowInstance values:

  • FlowInstance.Id - Id of current flow instance.
  • FlowInstance.IsActive - checkbox indicating wether flow is active or not.
  • FlowInstance.IsCompleted - checkbox indicating wether flow is completed or not.
  • FlowInstance.LockParent - checkbox used when working with subflows. It is indicating wether parent flow should be locked when subflow is in progress or should not.
  • FlowInstance.LockParentStepID - Id of a step locked by subflow.
  • FlowInstance.Managers - flow instance managers value.
  • FlowInstance.NumberActiveBranches - number of flow instance active brances.
  • FlowInstance.NumberBranches - total number of flow instance branches.
  • FlowInstance.ObjectId - Id of a flow instance source object.
  • FlowInstance.ObjectName - name of a flow instance source object.
  • FlowInstance.ParentId - Id of parent flow instance (used when working with subflows).
  • FlowInstance.ParentStepId - Id of a step in parent flow instance that has "Start Subflow" action on it.
  • FlowInstance.Variables - JSON containing all flow instance variables using {"key" : "value"} structure.

Step values:

  • Step.AssignTo - related step assignee. Value depends on Step.AssignType: if step assign type is User, Group, Chatter Group, Queue, Role or Profile  assignTo will store corresponding record IDs; if assign type is "Call Apex", assignTo will store apex class name; if assign type is "Field", assignTo will store field API name.
  • Step.AssignType - type of a related step assignment. Can store one of the following values: User, Field, Group, Chatter Group, Queue, Role, Profile, Call Apex.
  • Step.Branch - label of a corresponding process branch.
  • Step.Branch.Id - Id of a corresponding process branch.
  • Step.Description - related step description.
  • Step.Duration - duration of an active step.
  • Step.Id - related step Id.
  • Step.Milestone - step milestone name.
  • Step.Name - related step name.
  • Step.Swimlane - step swimlane name.
  • Step.Swimlane.AssignTo - swimlane assignee value.
  • Step.Swimlane.AssignType - swimlane assignment type. Can store one of the following values: User, Field, Group, ChatterGroup, Queue, Role, Profile, Call Apex.
  • Step.Swimlane.Id - related step swimlane ID value.
  • Step.Type - type of a current step. Will store one of the following values: Manual, Approval, Automatic.

Using $Cursor for Rules/Actions on connectors

When $Cursor context object is used for connectors Rules/Actions setup all "Step" section values refers to the target step e.g. the step connector comes to.

Other than that cursor values will stay the same (i.e. will refer to the step connector comes from).

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.