Class AsyncAgentInvokeJobHandler
java.lang.Object
com.flowable.agent.engine.impl.job.AbstractAgentJobHandler
com.flowable.agent.engine.impl.job.AsyncAgentInvokeJobHandler
- All Implemented Interfaces:
org.flowable.job.service.impl.nontx.NonTransactionalJobHandler<AbstractAgentJobHandler.AgentJobHandlerResult>, org.flowable.job.service.JobHandler
- Author:
- Filip Hrisafov
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractAgentJobHandler
AbstractAgentJobHandler.AgentJobHandlerResult -
Field Summary
FieldsFields inherited from class AbstractAgentJobHandler
agentEngineConfiguration, logger -
Constructor Summary
ConstructorsConstructorDescriptionAsyncAgentInvokeJobHandler(AgentEngineConfiguration agentEngineConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterExecute(org.flowable.job.service.impl.persistence.entity.JobEntity job, String configuration, AbstractAgentJobHandler.AgentJobHandlerResult agentJobHandlerResult, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) getType()handleGuardrailViolation(AgentInvocationContext agentInvocationContext, FlowableGuardrailViolationException ex, IntentEvaluationTrigger intentEvaluationTrigger, tools.jackson.databind.JsonNode jobConfiguration) Invoked when the agent invocation (which runs in the non-transactional phase of the job) raises a guardrail business error.protected voidpropagateGuardrailViolationToCallback(AgentInstanceEntity agentInstance, FlowableGuardrailViolationException ex, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) Routes a guardrail business error raised by the asynchronous agent invocation to the waiting process/case, so it can be caught by a BPMN error boundary event or a CMMN fault sentry (mirroring what happens synchronously).Methods inherited from class AbstractAgentJobHandler
auditExchange, execute, executeNonTransactionally, getAgentInvocationContextJson, getIntentEvaluationTrigger, invokeAgent
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
AsyncAgentInvokeJobHandler
-
-
Method Details
-
getType
-
handleGuardrailViolation
protected AbstractAgentJobHandler.AgentJobHandlerResult handleGuardrailViolation(AgentInvocationContext agentInvocationContext, FlowableGuardrailViolationException ex, IntentEvaluationTrigger intentEvaluationTrigger, tools.jackson.databind.JsonNode jobConfiguration) Description copied from class:AbstractAgentJobHandlerInvoked when the agent invocation (which runs in the non-transactional phase of the job) raises a guardrail business error. The default behaviour simply re-throws, subclasses can override to handle the error differently.- Overrides:
handleGuardrailViolationin classAbstractAgentJobHandler
-
afterExecute
public void afterExecute(org.flowable.job.service.impl.persistence.entity.JobEntity job, String configuration, AbstractAgentJobHandler.AgentJobHandlerResult agentJobHandlerResult, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) - Specified by:
afterExecutein interfaceorg.flowable.job.service.impl.nontx.NonTransactionalJobHandler<AbstractAgentJobHandler.AgentJobHandlerResult>- Specified by:
afterExecutein classAbstractAgentJobHandler
-
propagateGuardrailViolationToCallback
protected void propagateGuardrailViolationToCallback(AgentInstanceEntity agentInstance, FlowableGuardrailViolationException ex, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) Routes a guardrail business error raised by the asynchronous agent invocation to the waiting process/case, so it can be caught by a BPMN error boundary event or a CMMN fault sentry (mirroring what happens synchronously). This is the error-path counterpart ofAgentUtil.handleAgentInstanceCallback(AgentInstance, AgentInvocationResult, CommandContext): the agent invocation ran in the non-transactional phase of the job, so the error cannot be propagated on the original stack and must be re-injected into the parent scope here, in a transaction. If nothing catches it, the propagation throws and the job fails (retry / dead-letter).
-