Class TaskUtil

java.lang.Object
com.ssgllc.fish.service.util.published.TaskUtil

@Component public class TaskUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.flowable.form.api.FormService
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroupIdentityLink(String taskId, String roleName, String type)
    Adds a group identity link of the given type to a task, making it accessible to users holding the role.
    void
    updateFormVariables(org.flowable.task.service.impl.persistence.entity.TaskEntity task, Map<String,Object> variablesToUpdate)
    Updates form variables for the given task by applying the provided values and preserving existing ones.
    Only fields present in the form and the update map are modified.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • formService

      @Autowired protected org.flowable.form.api.FormService formService
  • Constructor Details

    • TaskUtil

      public TaskUtil()
  • Method Details

    • updateFormVariables

      public void updateFormVariables(org.flowable.task.service.impl.persistence.entity.TaskEntity task, Map<String,Object> variablesToUpdate)
      Updates form variables for the given task by applying the provided values and preserving existing ones.
      Only fields present in the form and the update map are modified.
      Parameters:
      task - The task whose form variables are to be updated.
      variablesToUpdate - A map of field names and their new values.

      Groovy example:
      formUtil.updateFormVariables(task, ["field1": "newVal", "field2": 42])
      Note: No update occurs if the task has no form or no fields.
    • addGroupIdentityLink

      public void addGroupIdentityLink(String taskId, String roleName, String type)
      Adds a group identity link of the given type to a task, making it accessible to users holding the role. Works for open and completed tasks (a completed task — e.g. one copied to another process by a case merge — gets the historic link only). Does nothing if the task already has the link.
      Groovy example:
      taskUtil.addGroupIdentityLink(taskId, "ROLE_ICP", "candidate")
      Returns: nothing; the task becomes visible to users with ROLE_ICP
      Parameters:
      taskId - the id of the task (open or completed)
      roleName - the role granting access (e.g. "ROLE_ICP")
      type - the identity link type: "candidate" for candidate-group access, "viewable" for view-only access