Class AbstractCamelCommand

  • All Implemented Interfaces:
    org.kie.api.executor.Command, org.kie.internal.runtime.Cacheable
    Direct Known Subclasses:
    DeploymentContextCamelCommand, GlobalContextCamelCommand

    public abstract class AbstractCamelCommand
    extends Object
    implements org.kie.api.executor.Command, org.kie.internal.runtime.Cacheable
    Camel jBPM Command which allows to call Camel routes with a direct endpoint.

    The command passes the retrieved from the CommandContext to the route that has a consumer on the endpoint-id that can be passed with the camel-endpoint-id WorkItem parameter. E.g. when a the value "myCamelEndpoint" is passed to the {link WorkItem} via the camel-endpoint-id parameter, this Command will send the WorkItem to the Camel URI direct:myCamelEndpoint.

    The body of the result Message of the invocation is returned via the Response parameter. Access to the raw response Message is provided via the Message parameter. This gives the user access to more advanced fields like message headers and attachments.

    • Constructor Detail

      • AbstractCamelCommand

        public AbstractCamelCommand()
    • Method Detail

      • execute

        public org.kie.api.executor.ExecutionResults execute​(org.kie.api.executor.CommandContext ctx)
                                                      throws Exception
        Specified by:
        execute in interface org.kie.api.executor.Command
        Throws:
        Exception
      • getProducerTemplate

        protected abstract org.apache.camel.ProducerTemplate getProducerTemplate​(org.kie.api.executor.CommandContext ctx)