SelectAvailableAssignment

Node Action:

This node action receives an Assignment ID string, converts the ID string into a Guid, searches the Available Jobs List for a matching Guid, and selects the matching assignment.

Parameters:

se_type

SelectAvailableAssignment

se_type = SelectAvailableAssignment

se_determineAssignmentId

(ctx, log) => { return \"assignmentId\"; }

A lambda used to return an Assignment ID string to the node action.

The Assignment ID string is parsed into a Guid and used to search for a valid assignment.

Example:

Unassign: This example unassigns the selected assignment in the current user's My Jobs tab, refreshes the job lists, then selects the new assignment in the Available Jobs tab.

digraph workflow {
  
  entry[
    label = "Unassign Button"
    se_type0 = SessionOperationTrigger
    se_displayName0 = "Unassign"
    se_sortOrder0 = 50
    se_visibilityCondition0 = "(ctx, log) => {
      return ctx.Event.assignment.assignedTo == ctx.User.UserId && ctx.Event.isSessionOpen == false;
    }"
  ]
  
  unassign[
    se_type0 = Api,
    se_method0 = POST
    se_modifyRequest0 = "(request, ctx, log) => {
       request.RequestUri = new Uri($\"api/v1/assignments/{ctx.Event.assignment.id}/unassign\", UriKind.RelativeOrAbsolute);       
    }",
    se_resultVariable0 = NewAssignment
    se_service0 = Editor
  ]
  
  refreshUI[
    se_type0 = RefreshMyJobsList,
    
    se_type1 = RefreshAvailableJobsList,

    se_type2 = SelectAvailableAssignment,
    se_determineAssignmentId2 = "(ctx, log) => {
      return ctx.State.NewAssignment.id.ToString();
    }"
  ]

  exit[
    shape=invhouse, 
    color="#22FF44", 
    style=filled
  ]   
   
  entry->unassign
  unassign->refreshUI
  refreshUI->exit
}
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?