SelectMyAssignment

Node Action:

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

Parameters:

se_type

SelectMyAssignment

se_type = SelectMyAssignment

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:

Take Ownership: This example assigns the selected assignment in the Available Jobs tab to the current user, refreshes the job lists, then selects the new assignment in the My Jobs tab.

digraph workflow {
  
  entry[
    label = "Take Ownership Button"
    se_type0 = SessionOperationTrigger
    se_displayName0 = "Take Ownership"
    se_sortOrder0 = 10
    se_visibilityCondition0 = "(ctx, log) => {
      return ctx.Event.assignment.assignedTo != ctx.User.UserId;
    }"
  ]
  
  takeOwnership[    
    se_type0 = Api,
    se_method0 = POST
    se_modifyRequest0 = "(request, ctx, log) => {
      request.RequestUri = new Uri($\"api/v1/assignments/{ctx.Event.assignment.id}/assign?to={ctx.User.UserId}\", UriKind.RelativeOrAbsolute);      
    }",
    se_resultVariable0 = NewAssignment
    se_service0 = Editor
  ]
  
  notifyUser[
    se_type = NotifyUser,
    label = "Notify user"
    se_determineMessage = "(ctx, log) => {
      return $\"Session {ctx.Event.session.name} is now assigned to you.\";
    }",
    se_notificationType = "Information",
    se_showToast = true
  ]

  refreshUI[
    se_type0 = RefreshMyJobsList,
    
    se_type1 = RefreshAvailableJobsList,

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

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

Was this helpful?