Package com.axelor.workflow.task
Class WorkflowTaskService
java.lang.Object
com.axelor.workflow.task.WorkflowTaskService
- All Implemented Interfaces:
TaskBoundaryDelivery,RecordWake
Claims, completes and governs approvals, resuming the parked workflow when one closes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAct(MetaWorkflowTask task, User user) Whetherusermay act: the assignee, a member of the assigned role or group, or an admin.Admin: abandon the run without resuming it.Claim a pooled task with a conditional update; a no-op when this user already holds it.static booleancommentRequired(MetaWorkflowTask task, String action) Whetheraction("complete" or "reject") needs a comment, per the task'scommentMode, which defaults to "reject".Complete a task and resume from itsnext.forceComplete(Long taskId, String comment, User by) Admin: force completion past assignment andwhen.interruptTask(Long taskId) Take the boundary whose deadline came due on a parked approval, for the scheduler.static booleanlabel()Names this source in the orchestrator's log when it fails.booleanownsTask(MetaWorkflowTask task, User user) Whetheruserowns the task now: its assignee, the user who claimed it, or an admin.Reassign a pending task to a user, role or group, clearing any claim.Reject a task and resume from itsnext; routing on the rejection is the graph's.voidRecord-change wake for approvals: re-check each pendingautoCompletetask on the record, its condition boundaries first, and complete it on the spot when itswhenholds.takeBoundary(Long taskId, String boundaryId, MessageDelivery message) Take a named boundary on a parked approval, for a message that matched its subscription.voidRe-check whatever this source watches for one record, resuming what has become due.
-
Constructor Details
-
WorkflowTaskService
public WorkflowTaskService()
-
-
Method Details
-
label
Description copied from interface:RecordWakeNames this source in the orchestrator's log when it fails.- Specified by:
labelin interfaceRecordWake
-
wake
Description copied from interface:RecordWakeRe-check whatever this source watches for one record, resuming what has become due.- Specified by:
wakein interfaceRecordWake
-
canAct
Whetherusermay act: the assignee, a member of the assigned role or group, or an admin. -
ownsTask
Whetheruserowns the task now: its assignee, the user who claimed it, or an admin. Acting requires ownership, so a candidate claims first. -
claim
Claim a pooled task with a conditional update; a no-op when this user already holds it. -
complete
Complete a task and resume from itsnext. Refused withWorkflowTaskConditionNotMetwhile itswhendoes not hold on the record now. -
reject
Reject a task and resume from itsnext; routing on the rejection is the graph's. Refused when the node disallows rejection. -
reassign
Reassign a pending task to a user, role or group, clearing any claim. -
cancel
Admin: abandon the run without resuming it. Refused when the node disallows cancelling; read from the task's snapshot so a task whose workflow no longer compiles can still be cleared. -
forceComplete
Admin: force completion past assignment andwhen. Refused only when the node disallows it. -
interruptTask
Take the boundary whose deadline came due on a parked approval, for the scheduler. The approval is withdrawn, not answered, and the walk leaves by the boundary. -
takeBoundary
Take a named boundary on a parked approval, for a message that matched its subscription.- Specified by:
takeBoundaryin interfaceTaskBoundaryDelivery
-
resumeConditionTasksForRecord
Record-change wake for approvals: re-check each pendingautoCompletetask on the record, its condition boundaries first, and complete it on the spot when itswhenholds. A failing task is logged and skipped. -
commentRequired
Whetheraction("complete" or "reject") needs a comment, per the task'scommentMode, which defaults to "reject". Public for the views, which open the comment dialog only when one is needed. -
isAdmin
-