Asynchronous Modes - redhat-consulting/jbpm-ee GitHub Wiki
jBPM-EE offers APIs for interacting with jBPM asynchronously, provided as Local and Remote EJB interfaces. This approach can be valuable when kicking off or modifying workflow state in bulk.
Note: The jBPM Asynchronous Modes are provided for limited, bulk execution use cases. It is recommended to leverage the Synchronous APIs for the 99% use case, especially in situations that require responses. The Synchronous model is easier for developers to interact with and provides distributed, coordinated transactions with the calling application.
- Local EJB Interface:
org.jbpm.ee.services.ejb.local.AsyncCommandExecutorLocal
- Remote EJB Interface:
org.jbpm.ee.services.ejb.remote.AsyncCommandExecutorRemote
Pictured in the diagram below, the calling application interacts with the AsyncCommandExecutor bean, which transparently queues commands and the command's response via JMS. Note that because of the semantics of JMS, the jBPM-EE execution of the Command objects will be executed in a separate transaction from the calling application.
The AsyncCommandExecutor
service provides a execute
method, which returns a unique request identifier. The pollResponse
method may be used to asynchronously poll for a response to the request, provided the unique request identifier. The AsyncCommandExecutor
accepts all standard jBPM Command objects.
Below are examples of Command objects that may be used with the AsyncCommandExecutor.
###Process Instance Commands### Provides command operations to interact with Process Instances.
org.drools.core.command.runtime.process.AbortProcessInstanceCommand
org.drools.core.command.runtime.process.AbortWorkItemCommand
org.drools.core.command.runtime.process.CompleteWorkItemCommand
org.drools.core.command.runtime.process.CreateCorrelatedProcessInstanceCommand
org.drools.core.command.runtime.process.CreateProcessInstanceCommand
org.drools.core.command.runtime.process.GetProcessEventListenersCommand
org.drools.core.command.runtime.process.GetProcessIdsCommand
org.drools.core.command.runtime.process.GetProcessInstanceByCorrelationKeyCommand
org.drools.core.command.runtime.process.GetProcessInstanceCommand
org.drools.core.command.runtime.process.GetProcessInstancesCommand
org.drools.core.command.runtime.process.GetWorkItemCommand
org.drools.core.command.runtime.process.RegisterWorkItemHandlerCommand
org.drools.core.command.runtime.process.SetProcessInstanceVariablesCommand
org.drools.core.command.runtime.process.SignalEventCommand
org.drools.core.command.runtime.process.StartCorrelatedProcessCommand
org.drools.core.command.runtime.process.StartProcessCommand
org.drools.core.command.runtime.process.StartProcessInstanceCommand
###Task Commands### Provides command operations to interact with Process Instance Tasks.
org.jbpm.services.task.commands.ActivateTaskCommand
org.jbpm.services.task.commands.AddTaskCommand
org.jbpm.services.task.commands.ClaimNextAvailableTaskCommand
org.jbpm.services.task.commands.ClaimTaskCommand
org.jbpm.services.task.commands.CompleteTaskCommand
org.jbpm.services.task.commands.DelegateTaskCommand
org.jbpm.services.task.commands.ExitTaskCommand
org.jbpm.services.task.commands.FailTaskCommand
org.jbpm.services.task.commands.ForwardTaskCommand
org.jbpm.services.task.commands.GetAttachmentCommand
org.jbpm.services.task.commands.GetContentCommand
org.jbpm.services.task.commands.GetTaskAssignedAsBusinessAdminCommand
org.jbpm.services.task.commands.GetTaskAssignedAsPotentialOwnerCommand
org.jbpm.services.task.commands.GetTaskByWorkItemIdCommand
org.jbpm.services.task.commands.GetTaskCommand
org.jbpm.services.task.commands.GetTasksByProcessInstanceIdCommand
org.jbpm.services.task.commands.GetTasksByStatusByProcessInstanceIdCommand
org.jbpm.services.task.commands.GetTasksByVariousFieldsCommand
org.jbpm.services.task.commands.GetTasksOwnedCommand
org.jbpm.services.task.commands.NominateTaskCommand
org.jbpm.services.task.commands.ReleaseTaskCommand
org.jbpm.services.task.commands.ResumeTaskCommand
org.jbpm.services.task.commands.SkipTaskCommand
org.jbpm.services.task.commands.StartTaskCommand
org.jbpm.services.task.commands.StopTaskCommand
org.jbpm.services.task.commands.SuspendTaskCommand