Class TaskUtil
java.lang.Object
com.ssgllc.fish.service.util.published.TaskUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroupIdentityLink(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.voidupdateFormVariables(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.
-
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
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
-