Package com.axelor.meta.web
Class MetaWorkflowTaskController
java.lang.Object
com.axelor.meta.web.MetaWorkflowTaskController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(ActionRequest request, ActionResponse response) Cancel a pending task (admin only).voidclaim(ActionRequest request, ActionResponse response) Claim a pooled task for the current user.voidcomplete(ActionRequest request, ActionResponse response) Complete the task with a comment.voidcompleteTask(ActionRequest request, ActionResponse response) Approve the task: straight through when itscommentModeasks for no comment on a completion, otherwise via the comment dialog.voidcountMyTasks(ActionRequest request, ActionResponse response) How many approvals the current user can act on -- the nav-header notification badge, pushed over the tags websocket channel alongside the team-task and mail counts.voidforceCompleteTask(ActionRequest request, ActionResponse response) Force-complete the task (admin).voidmyTasks(ActionRequest request, ActionResponse response) Open the actionable-by-me grid for the current user.voidopenRecord(ActionRequest request, ActionResponse response) Open the underlying business record in its own form.voidopenTask(ActionRequest request, ActionResponse response) Open a single task's approval form directly (not the record's task grid) — the target of a dropdown row's body click.voidpendingCountForRecord(ActionRequest request, ActionResponse response) Pending-approval count for one business record — powers the record form's toolbar badge.voidprepareForm(ActionRequest request, ActionResponse response) onLoad: hide toolbar buttons the current user can't use right now.voidreassign(ActionRequest request, ActionResponse response) Reassign a pending task (admin or current assignee) to a new user/role/group.voidreject(ActionRequest request, ActionResponse response) Reject the task with a required comment, then resume the run (routing on the rejection is a downstream decision).voidrejectTask(ActionRequest request, ActionResponse response) Reject the task, prompting for a comment only whencommentModerequires one.voidtasksForRecord(ActionRequest request, ActionResponse response) Open the pending approvals for one business record — the target of the record form's toolbar "Approvals" button.voidtasksListForRecord(ActionRequest request, ActionResponse response) Pending tasks on one business record as lightweight DTO rows for the record form's approvals dropdown.voidworkflowModels(ActionRequest request, ActionResponse response) Models that have at least one active workflow.
-
Constructor Details
-
MetaWorkflowTaskController
public MetaWorkflowTaskController()
-
-
Method Details
-
myTasks
Open the actionable-by-me grid for the current user. -
countMyTasks
How many approvals the current user can act on -- the nav-header notification badge, pushed over the tags websocket channel alongside the team-task and mail counts.Counts exactly what
myTasks(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)lists (same predicate, seeWorkflowTaskQueries.myTasksDomain(com.axelor.auth.db.User)), so the badge never promises rows the grid then withholds. Unauthenticated callers get 0 rather than an error: the channel fans this out to every session and a missing user is not a fault. -
tasksForRecord
Open the pending approvals for one business record — the target of the record form's toolbar "Approvals" button. The record's model/id arrive as context (_recordModel/_recordId) since a task references its record polymorphically. -
pendingCountForRecord
Pending-approval count for one business record — powers the record form's toolbar badge. Themodel/recordIdarrive as client-supplied context, so this authorizes by record read access exactly astasksForRecord(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)does; a caller who cannot read the record (or supplies no record) gets 0. Guarding here closes the IDOR the client's own count query would otherwise leave open, since task read access alone does not gate the polymorphic record. -
tasksListForRecord
Pending tasks on one business record as lightweight DTO rows for the record form's approvals dropdown. Authorizes by record read access exactly aspendingCountForRecord(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)(client- supplied model/id ⇒ IDOR guard); a caller who cannot read the record — or supplies none — gets an empty list. Each row carries the friendly snapshot fields plus server-computed action flags (viaWorkflowTaskQueries.rowsForRecord(java.lang.String, java.lang.Long, com.axelor.auth.db.User)), so the client never decides who may act. -
workflowModels
Models that have at least one active workflow. The client fetches this once and caches it, so the per-record pending-count query is skipped on forms whose model can never have an approval. -
prepareForm
onLoad: hide toolbar buttons the current user can't use right now. -
openRecord
Open the underlying business record in its own form. -
openTask
Open a single task's approval form directly (not the record's task grid) — the target of a dropdown row's body click. Opensmeta-workflow-approval-formas a popup preselected on this task via_showRecord, keeping its toolbar so the approver can act from the detail view. Record-access gated like every other per-task operation. -
completeTask
Approve the task: straight through when itscommentModeasks for no comment on a completion, otherwise via the comment dialog. Same forrejectTask(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)andforceCompleteTask(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)— the dialog exists to collect a required comment, so a task that requires none never shows one. -
rejectTask
Reject the task, prompting for a comment only whencommentModerequires one. -
forceCompleteTask
Force-complete the task (admin). A forced completion is a completion, so it follows thecompletehalf ofcommentModeexactly ascompleteTask(com.axelor.rpc.ActionRequest, com.axelor.rpc.ActionResponse)does. -
complete
Complete the task with a comment. When context contains_force=true(the force-complete dialog), delegates toWorkflowTaskService.forceComplete(java.lang.Long, java.lang.String, com.axelor.auth.db.User)so admin authorization is checked instead. -
reject
Reject the task with a required comment, then resume the run (routing on the rejection is a downstream decision). Surfaces the service's required-comment error and keeps the popup open. -
claim
Claim a pooled task for the current user. -
reassign
Reassign a pending task (admin or current assignee) to a new user/role/group. -
cancel
Cancel a pending task (admin only).
-