Package com.ssgllc.fish.config.mcp
Class McpBpmConfig.BpmTools
java.lang.Object
com.ssgllc.fish.config.mcp.McpBpmConfig.BpmTools
- Enclosing class:
McpBpmConfig
Tool implementations for BPM operations.
Backed by CustomBpmDeploymentService.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapper -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbytesToString(byte[] bytes) Decodes a byte array to a UTF-8 string.protected StringProduces a standard{"error":"<message>"}JSON response from an exception.getBpmModelByKey(String key, String typeCode) getBpmModelForEditor(String modelId) getProcessDefinitionBpmn(String definitionIdentifier) Returns the raw BPMN 2.0 XML string for the named process deployment.protected StringhandleTool(Callable<Object> action) Invokesaction, serializes the result withtoJson(java.lang.Object), and returns it.importBpmModelFromBpmn(String bpmnXml, String name, String key, String featureBranch) setBpmModelActive(String modelId, boolean active, String featureBranch) protected StringSerializesvalueto a compact JSON string (no indent).upsertBpmModelDefinition(String key, String name, String typeCode, String definition, String featureBranch)
-
Field Details
-
mapper
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Details
-
getProcessDefinitionBpmn
@Tool(name="get-process-definition-bpmn", description="Get the BPMN XML for a process deployment.") public String getProcessDefinitionBpmn(@ToolParam(description="Process deployment ID") String definitionIdentifier) Returns the raw BPMN 2.0 XML string for the named process deployment. The returned string is the XML content directly (not JSON-wrapped).- Parameters:
definitionIdentifier- deployment ID as stored in the process repository- Returns:
- BPMN 2.0 XML string, or a JSON error object if the deployment is not found
-
getBpmModelByKey
@Tool(name="get-bpm-model-by-key", description="Get a BPM model (process/form/decision) by key and type code. typeCode is PROCESS, FORM, or DECISION.") public String getBpmModelByKey(@ToolParam(description="Model key") String key, @ToolParam(description="Type code: PROCESS, FORM, or DECISION") String typeCode) -
getBpmModelForEditor
-
upsertBpmModelDefinition
@Tool(name="upsert-bpm-model-definition", description="Create or update a BPM model definition, adding a new version. typeCode is PROCESS, FORM, or DECISION. featureBranch attributes the change to a config feature branch.") public String upsertBpmModelDefinition(@ToolParam(description="Model key") String key, @ToolParam(description="Model name") String name, @ToolParam(description="Type code: PROCESS, FORM, or DECISION") String typeCode, @ToolParam(description="Model definition (BPMN/DMN XML or form JSON)") String definition, @ToolParam(required=false,description="Config audit feature branch") String featureBranch) -
importBpmModelFromBpmn
@Tool(name="import-bpm-model-from-bpmn", description="Import a BPM process model from BPMN 2.0 XML, creating or versioning the model with the given key. featureBranch attributes the change to a config feature branch.") public String importBpmModelFromBpmn(@ToolParam(description="BPMN 2.0 XML") String bpmnXml, @ToolParam(description="Model name") String name, @ToolParam(description="Process key") String key, @ToolParam(required=false,description="Config audit feature branch") String featureBranch) -
setBpmModelActive
@Tool(name="set-bpm-model-active", description="Activate or archive a BPM model by id. featureBranch attributes the change to a config feature branch.") public String setBpmModelActive(@ToolParam(description="BpmModel id") String modelId, @ToolParam(description="true to activate, false to archive") boolean active, @ToolParam(required=false,description="Config audit feature branch") String featureBranch) -
toJson
Serializesvalueto a compact JSON string (no indent). Returns{"error":"serialization failed"}if serialization throws.- Parameters:
value- the object to serialize; may benull- Returns:
- compact JSON string
-
bytesToString
Decodes a byte array to a UTF-8 string. Used to convert binary report output to a returnable string.- Parameters:
bytes- raw bytes- Returns:
- decoded string
-
handleTool
Invokesaction, serializes the result withtoJson(java.lang.Object), and returns it. Any exception thrown by the action is caught and converted to a standard{"error":"<message>"}response viaerrorJson(java.lang.Exception). Use this in every@Toolmethod to eliminate identical try/catch boilerplate.- Parameters:
action- the tool logic to invoke; may throw any exception- Returns:
- compact JSON string — the serialized result on success, or an error object on failure
-
errorJson
Produces a standard{"error":"<message>"}JSON response from an exception. Falls back to the simple class name whenThrowable.getMessage()is null.- Parameters:
e- the exception to convert- Returns:
- JSON error string
-