Class AffectationUserTask

Direct Known Subclasses:
CheckUpdatedRecordsValidationReportUserTask, CheckValidationReportUserTask

public class AffectationUserTask extends CommonUserTask
Represents a common user task extension.

This extension handles the creation of the work item by checking if a user is defined for this work item. If defined, the work item is allocated to this user and an allocation notification is sent. Else, a "No user has been defined" error is thrown.

The following should be added in the work item configuration under Extension:

  • Rule: com.apgar.common.lib.workflow.usertask.AffectationUserTask
  • Parameter name: user (e.g., ${user})
Author:
APGAR Consulting
  • Constructor Details

    • AffectationUserTask

      public AffectationUserTask()
  • Method Details

    • handleCreate

      public void handleCreate(UserTaskCreationContext context) throws OperationException
      Executes the handleCreate method of the superclass while sending a notification mail for the work item owner.

      This method checks whether a user exists for work item allocation. If a user exists, an allocation notification is sent. Else, an exception is thrown.

      Overrides:
      handleCreate in class CommonUserTask
      Parameters:
      context - the context for work items creation
      Throws:
      OperationException - if a user for this work item is not set; in this case, the user task is set to an error state.
    • getUser

      public String getUser()
      Gets owner of the work item.
      Returns:
      the unique identifier of the user (usually its login)
    • setUser

      public void setUser(String user)
      Sets the owner of the work item.
      Parameters:
      user - the unique identifier of the user (usually its login)