Class AbstractServiceDelegate

java.lang.Object
dev.dsf.bpe.v1.activity.AbstractServiceDelegate
All Implemented Interfaces:
org.camunda.bpm.engine.delegate.JavaDelegate, org.springframework.beans.factory.InitializingBean

public abstract class AbstractServiceDelegate extends Object implements org.camunda.bpm.engine.delegate.JavaDelegate, org.springframework.beans.factory.InitializingBean
Abstract implementation of the JavaDelegate interface with added error handling and convenient access to process execution variables with the variables parameter of the doExecute(DelegateExecution, Variables) method.

Configure BPMN service tasks with an implementation of type 'Java class' with the fully qualified class name of the class extending this abstract implementation.

Configure your service task implementation as a Bean in your spring Configuration class with scope "prototype".

See Also:
  • Field Details

  • Constructor Details

    • AbstractServiceDelegate

      public AbstractServiceDelegate(ProcessPluginApi api)
      Parameters:
      api - not null
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • execute

      public final void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
      Specified by:
      execute in interface org.camunda.bpm.engine.delegate.JavaDelegate
      Throws:
      Exception
    • doExecute

      protected abstract void doExecute(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) throws org.camunda.bpm.engine.delegate.BpmnError, Exception
      Implement this method to execute custom business logic within BPMN service tasks.
      Parameters:
      execution - Process instance information and variables
      variables - DSF process variables
      Throws:
      org.camunda.bpm.engine.delegate.BpmnError - Thrown when an error boundary event should be called
      Exception - Uncaught exceptions thrown by this method will result in Task status failed for all current in-progress Task resource with the exception message added as an error output. An exception (not BpmnError) thrown by this method will also result in the process instance stopping execution and being deleted.