Class ProcessesMcpTool
- All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin
A process type (WorkFlow) is backed by a Task/Kanban project
(WorkFlow.projectId); a request (Work) IS a task
(Work.taskId) whose status is the task's Kanban column (default
columns: Request, RequestInProgress, Validated, Refused, Canceled).
Every method acts as the current user: the current user's social identity id
is resolved and passed to the self-scoping ProcessesService calls
(getWorks / getWorkById filter by createdBy), so
platform ACLs are enforced.
Approver actions ride the existing Task MCP tools by design: to respond
to a pending request, the agent calls the eXo Task tools on the request's task
id (update_task_status to Validated/Refused, add_task_comment).
This class deliberately does NOT duplicate that task-write path; it only
surfaces the pending requests to act on via getPendingApprovals().
-
Field Summary
Fields inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
DEFAULT_LIMIT, DEFAULT_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionProcessesMcpTool(org.exoplatform.processes.service.ProcessesService processesService, org.exoplatform.task.service.TaskService taskService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, ProcessSpaceScopeResolver processSpaceScopeResolver) -
Method Summary
Modifier and TypeMethodDescriptioncancelWorkRequest(long requestId) getMyRequests(String status) getRequestDetails(long requestId) listProcesses(Long spaceId) Lists the enabled process types (request types) the current user can see, so the agent can discover what a user may request and get the process id to pass to submit_work_request.submitWorkRequest(long processId, String title, String description) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
getCurrentUserAclIdentity, getCurrentUserLocale, getCurrentUserLocale, getCurrentUserName, getLocale
-
Constructor Details
-
ProcessesMcpTool
public ProcessesMcpTool(org.exoplatform.processes.service.ProcessesService processesService, org.exoplatform.task.service.TaskService taskService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, ProcessSpaceScopeResolver processSpaceScopeResolver) - Parameters:
processesService- reads and writes the processes and requeststaskService- reads the pending requests' tasksidentityManager- resolves the current user's identityspaceService- reads a listed space and its membersprocessSpaceScopeResolver- tells the space of a process, so that a space's listing names only the processes its lookup accepts
-
-
Method Details
-
listProcesses
Lists the enabled process types (request types) the current user can see, so the agent can discover what a user may request and get the process id to pass to submit_work_request. With a space, it lists only the processes of that space, by the rule of the "process" resolver, so the listing never names a process the space scope refuses; an unknown space, or one the user isn't a member of, lists none. The space's processes are read page by page over the user's processes, a process met twice is listed once, and the reading stops once 200 are found. The process query has no order, so a page boundary may still skip a process. READ.- Parameters:
spaceId- the space whose processes to list, null or not positive for every process the user can see- Returns:
- at most 200 processes
- Throws:
IllegalAccessException- when the processes can't be read
-
getMyRequests
- Throws:
Exception
-
getRequestDetails
public RequestModel getRequestDetails(long requestId) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
submitWorkRequest
public RequestModel submitWorkRequest(long processId, String title, String description) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
cancelWorkRequest
public RequestModel cancelWorkRequest(long requestId) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
IllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getPendingApprovals
- Throws:
Exception
-