Class AdHocToolDescriptor
java.lang.Object
org.cibseven.connect.ai.agent.agentic.AdHocToolDescriptor
One startable activity of an agentic ad hoc sub process, described as a tool for a
language model: what it is called, what it does, which values it may be given and
which variables it declares as its result.
Built at parse time from the model and stored on the scope's activity
under CATALOG, so the catalogue exists before any instance runs and a
broken declaration refuses the deployment rather than a turn; on a parse again of a
deployment made while the agent was off, the broken tool is left out instead
(CIB7-2367). Read at run time to
build one tool specification per entry — the activity is the tool, so a
wrong activity name is not expressible for the model at all.
Written and read at two different times: AgenticAdHocParseListener builds
the catalogue while the model is deployed, and the connector's
AdHocToolProvider reads it on every turn. Both live in this module; the
scope's activity is what the two share.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne declared input parameter of a tool, declared withtoolParameter(toolCall.<name>, ...)in one of its input mappings (CIB7-2136). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyKey<List<AdHocToolDescriptor>>Where the catalogue sits on the scope's activity: a list of these, in model order, one per directly startable child.The types a parameter may declare — JSON schema scalars, because that is what a tool specification can say and what an activation can carry as a variable.static final StringThe local variable that carries every argument of one tool call, as a map from parameter name to value (CIB7-2136), on the performance of a tool that declares a parameter. -
Constructor Summary
ConstructorsConstructorDescriptionAdHocToolDescriptor(String activityId, String name, String documentation, List<String> resultVariables, boolean blockedWhileOthersRun, List<AdHocToolDescriptor.Parameter> parameters) AdHocToolDescriptor(String activityId, String name, String documentation, List<String> readVariables, List<String> resultVariables, boolean blockedWhileOthersRun, List<AdHocToolDescriptor.Parameter> parameters) -
Method Summary
Modifier and TypeMethodDescriptionstatic booleananyParameters(List<AdHocToolDescriptor> catalog) Whether any tool of the catalogue declares a parameter (CIB7-2136): then the scope keeps an emptyTOOL_CALL_VARIABLE, so a tool started by something other than the agent reads its parameters as null instead of failing on the missing map.The BPMN activity id — the tool's name, and what an activation request names.The element's documentation text, ornullwhen it has none.getName()The label from the diagram, ornullwhen the element has none.The declared input parameters, possibly empty, never null.The process variables this activity reads, as far as its model says: what its mappings name (CIB7-2169).The process variables this activity declares as its result, in document order, without duplicates.booleanWhether this activity may only start while nothing else in the scope runs.static ObjectValuetoolCallValue(Map<String, Object> arguments) The valueTOOL_CALL_VARIABLEholds for a call's arguments: aTreeMap, Java-serialized whatever the engine's default serialization format.
-
Field Details
-
CATALOG
Where the catalogue sits on the scope's activity: a list of these, in model order, one per directly startable child. -
PARAMETER_TYPES
The types a parameter may declare — JSON schema scalars, because that is what a tool specification can say and what an activation can carry as a variable. In this order, which is the order a deployment error lists them in. -
TOOL_CALL_VARIABLE
The local variable that carries every argument of one tool call, as a map from parameter name to value (CIB7-2136), on the performance of a tool that declares a parameter. Its input mapping reads it astoolCall.<name>, so what comes from the model is told apart from what comes from the process, and no parameter shadows a process variable of the same name. The name is reserved: no parameter may carry it.- See Also:
-
-
Constructor Details
-
AdHocToolDescriptor
-
AdHocToolDescriptor
-
-
Method Details
-
toolCallValue
The valueTOOL_CALL_VARIABLEholds for a call's arguments: aTreeMap, Java-serialized whatever the engine's default serialization format. Under JSON a map read back in a later command holds an Integer where the call set a Long, and a plain read oftoolCall.<name>hands that on; Java serialization keeps the types, and every engine can write it, Spin or not, as it writes the chat log and the conversation. ATreeMaphas the same serialized form however it was built, so a read does not write it again. -
anyParameters
Whether any tool of the catalogue declares a parameter (CIB7-2136): then the scope keeps an emptyTOOL_CALL_VARIABLE, so a tool started by something other than the agent reads its parameters as null instead of failing on the missing map. Not where aTOOL_CALL_VARIABLEis visible already: in a scope that is itself the tool of an outer agent such a tool reads the outer call's map, and in a process with a variable of that name, that variable. -
getActivityId
The BPMN activity id — the tool's name, and what an activation request names. -
getName
The label from the diagram, ornullwhen the element has none. -
getDocumentation
The element's documentation text, ornullwhen it has none. -
getReadVariables
The process variables this activity reads, as far as its model says: what its mappings name (CIB7-2169). Shown to the model in the description, so it knows what a call uses. -
getResultVariables
The process variables this activity declares as its result, in document order, without duplicates. What the agent is shown when the activity finishes — a declaration, not a measurement. -
isBlockedWhileOthersRun
public boolean isBlockedWhileOthersRun()Whether this activity may only start while nothing else in the scope runs. -
getParameters
The declared input parameters, possibly empty, never null.
-