Class NontransactionalAgentInvocationContext
java.lang.Object
com.flowable.agent.engine.impl.runtime.invocation.BaseAgentInvocationContext
com.flowable.agent.engine.impl.runtime.invocation.NontransactionalAgentInvocationContext
- All Implemented Interfaces:
AgentInvocationContext
An implementation of the
AgentInvocationContext interface that is used to invoke agent operations
when there is no database transaction active (as to not block the database transaction).
Instead of using runtime data, this one is based on a JSON document.
When an agent operation for example needs to be executed outside a transaction, the operation call is 'prepared'
up to the point that the invocation can happen, and then everything is stored in a JSON document.
Later on, the JSON is then used to execute the call without blocking the database transaction.-
Nested Class Summary
Nested classes/interfaces inherited from interface AgentInvocationContext
AgentInvocationContext.MediaItem -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected AgentDefinitionModelprotected AgentInstanceprotected booleanstatic final Stringprotected List<org.flowable.content.api.ContentItem> static final Stringstatic final Stringstatic final Stringstatic final Stringprotected GuardrailResultstatic final Stringprotected final tools.jackson.databind.node.ObjectNodestatic final Stringprotected List<KnowledgeBaseDefinition> static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected List<AgentInvocationContext.MediaItem> static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Collection<String> Fields inherited from class BaseAgentInvocationContext
agentEngineConfiguration -
Constructor Summary
ConstructorsConstructorDescriptionNontransactionalAgentInvocationContext(AgentEngineConfiguration agentEngineConfiguration) NontransactionalAgentInvocationContext(AgentEngineConfiguration agentEngineConfiguration, tools.jackson.databind.node.ObjectNode jsonNode) -
Method Summary
Modifier and TypeMethodDescriptionList<org.flowable.content.api.ContentItem> Returns variables that are exclusively passed to guardrail agents.tools.jackson.databind.node.ObjectNodegetMedia()protected StringgetProperty(String propertyName) booleanWhether the automatic (async) evaluator dispatch is suppressed for this invocation.protected ObjectnodeToValue(tools.jackson.databind.JsonNode node) protected voidputVariableValue(tools.jackson.databind.node.ObjectNode node, String key, Object value) Writes a variable value to a JSON object node, handling the supported agent parameter types.voidsetAgentDefinitionModel(AgentDefinitionModel agentDefinitionModel) voidsetAgentInstance(AgentInstance agentInstance) voidsetAgentOperationKey(String agentOperationKey) voidsetContentItems(List<org.flowable.content.api.ContentItem> contentItems) protected voidsetCreationTime(Date creationTime) voidsetEventCompletion(String eventDefinitionKey, String eventCorrelationKey) voidsetGuardrailResult(GuardrailResult guardrailResult) voidsetGuardrailVariables(Map<String, Object> guardrailVariables) voidsetInvocationId(String invocationId) voidsetKnowledgeBaseDefinition(KnowledgeBaseDefinition knowledgeBaseDefinition) voidsetKnowledgeBaseDefinitions(List<KnowledgeBaseDefinition> knowledgeBaseDefinitions) voidsetOutputSchema(String outputSchema) voidsetParentDeploymentId(String parentDeploymentId) protected voidsetProperty(String propertyName, String value) voidsetResolvedInputParameters(Map<String, Object> resolvedInputParameters) voidsetSkipEvaluators(boolean skipEvaluators) voidsetSystemMessage(String systemMessage) voidsetTenantId(String tenantId) voidsetUserGroupKeys(Collection<String> groupKeys) voidvoidsetUserMessage(String userMessage) static tools.jackson.databind.node.ObjectNodetransformToNonTransactionalJson(AgentInvocationContext invocationContext, AgentEngineConfiguration agentEngineConfiguration) Methods inherited from class BaseAgentInvocationContext
invoke
-
Field Details
-
jsonNode
protected final tools.jackson.databind.node.ObjectNode jsonNode -
INVOCATION_ID
- See Also:
-
CREATION_TIME
- See Also:
-
AGENT_INSTANCE_ID
- See Also:
-
AGENT_DEFINITION_ID
- See Also:
-
AGENT_OPERATION_KEY
- See Also:
-
AGENT_OPERATION_OUTPUT
- See Also:
-
AGENT_OUTPUT_SCHEMA
- See Also:
-
KNOWLEDGE_BASE_DEFINITION_IDS
- See Also:
-
USER_MESSAGE
- See Also:
-
SYSTEM_MESSAGE
- See Also:
-
TENANT_ID
- See Also:
-
USER_ID
- See Also:
-
PARENT_DEPLOYMENT_ID
- See Also:
-
USER_GROUP_KEYS
- See Also:
-
MEDIA
- See Also:
-
MEDIA_NAME
- See Also:
-
MEDIA_MIME_TYPE
- See Also:
-
MEDIA_DATA
- See Also:
-
MEDIA_CONTENT_ITEM_ID
- See Also:
-
CONTENT_ITEM_IDS
- See Also:
-
EVENT_DEFINITION_KEY
- See Also:
-
EVENT_CORRELATION_KEY
- See Also:
-
GUARDRAIL_VARIABLES
- See Also:
-
SKIP_EVALUATORS
- See Also:
-
agentInstance
-
agentInstanceLoaded
protected boolean agentInstanceLoaded -
agentDefinitionModel
-
knowledgeBaseDefinitions
-
userGroupKeys
-
mediaItemList
-
contentItemList
-
guardrailVariables
-
guardrailResult
-
-
Constructor Details
-
NontransactionalAgentInvocationContext
-
NontransactionalAgentInvocationContext
public NontransactionalAgentInvocationContext(AgentEngineConfiguration agentEngineConfiguration, tools.jackson.databind.node.ObjectNode jsonNode)
-
-
Method Details
-
getInvocationId
-
setInvocationId
- Specified by:
setInvocationIdin classBaseAgentInvocationContext
-
getCreationTime
-
setCreationTime
-
getAgentInstanceId
-
getAgentInstance
-
setAgentInstance
- Specified by:
setAgentInstancein classBaseAgentInvocationContext
-
getAgentDefinitionModel
-
setAgentDefinitionModel
- Specified by:
setAgentDefinitionModelin classBaseAgentInvocationContext
-
getAgentOperationKey
-
setAgentOperationKey
- Specified by:
setAgentOperationKeyin classBaseAgentInvocationContext
-
getOutputSchema
-
setOutputSchema
- Specified by:
setOutputSchemain classBaseAgentInvocationContext
-
getUserMessage
-
setUserMessage
- Specified by:
setUserMessagein interfaceAgentInvocationContext- Specified by:
setUserMessagein classBaseAgentInvocationContext
-
getSystemMessage
-
setSystemMessage
- Specified by:
setSystemMessagein classBaseAgentInvocationContext
-
getKnowledgeBaseDefinitions
-
setKnowledgeBaseDefinition
- Specified by:
setKnowledgeBaseDefinitionin classBaseAgentInvocationContext
-
setKnowledgeBaseDefinitions
-
getTenantId
-
setTenantId
- Specified by:
setTenantIdin classBaseAgentInvocationContext
-
getUserId
-
setUserId
- Specified by:
setUserIdin classBaseAgentInvocationContext
-
getParentDeploymentId
-
setParentDeploymentId
- Specified by:
setParentDeploymentIdin classBaseAgentInvocationContext
-
getMedia
-
getUserGroupKeys
-
setUserGroupKeys
- Specified by:
setUserGroupKeysin classBaseAgentInvocationContext
-
getContentItems
-
setContentItems
- Specified by:
setContentItemsin classBaseAgentInvocationContext
-
getEventDefinitionKey
-
getEventCorrelationKey
-
setEventCompletion
- Specified by:
setEventCompletionin classBaseAgentInvocationContext
-
getResolvedInputParameters
-
setResolvedInputParameters
- Specified by:
setResolvedInputParametersin classBaseAgentInvocationContext
-
getGuardrailVariables
Description copied from interface:AgentInvocationContextReturns variables that are exclusively passed to guardrail agents. These are kept separate from the regular input parameters so the parent agent cannot reference them in its system/user message templates. -
setGuardrailVariables
- Specified by:
setGuardrailVariablesin classBaseAgentInvocationContext
-
putVariableValue
protected void putVariableValue(tools.jackson.databind.node.ObjectNode node, String key, Object value) Writes a variable value to a JSON object node, handling the supported agent parameter types. This is the inverse ofnodeToValue(JsonNode). -
getGuardrailResult
-
setGuardrailResult
-
isSkipEvaluators
public boolean isSkipEvaluators()Description copied from interface:AgentInvocationContextWhether the automatic (async) evaluator dispatch is suppressed for this invocation. Defaults tofalse(auto-dispatch on). -
setSkipEvaluators
public void setSkipEvaluators(boolean skipEvaluators) - Specified by:
setSkipEvaluatorsin classBaseAgentInvocationContext
-
nodeToValue
-
getProperty
-
setProperty
-
getJsonNode
public tools.jackson.databind.node.ObjectNode getJsonNode() -
transformToNonTransactionalJson
public static tools.jackson.databind.node.ObjectNode transformToNonTransactionalJson(AgentInvocationContext invocationContext, AgentEngineConfiguration agentEngineConfiguration)
-