Link Search Menu Expand Document

Java Delegate Checker

The Java Delegate Checker processes BPMN models and checks, whether the following conditions apply to Service Tasks, Send Tasks, Receive Tasks, Script Tasks or Business Rule Tasks:

  • Wrong reference to Java Class
  • Wrong reference in Bean mapping
  • Wrong or no interfaces (Needs to be JavaDelegate, SignallableActivityBehavior, AbstractBpmnActivityBehavior)
  • If delegate does not implement one of the interfaces directly it needs to extend the class “AbstractBpmnActivityBehavior”
  • Interface ActivityBehaviour should not be used
  • No reference to a Java Class or Delegate (Bean)
  • No implementation specified

All Elements are also check on their ExecutionListener:

  • No implementation specified
  • Class not found, although specified as implemented
  • Class doesn’t implement the ExecutionListener interface

Assumptions

  • The BPMN-models have to be in the classpath at build time
  • The java classes (delegates) have to be in the classpath at build time

Configuration

The rule should be configured as follows:

<rule>
  <name>JavaDelegateChecker</name>
  <state>true</state>
</rule>

Via <state>true</state> the check can be enabled.

Via <state>false</state> the check can be disabled.

Error messages:

task ‘%taskName%’ with no class name/delegate expression/expression/dmn reference/external topic/code reference
No reference to source code has been deposited. An implementation must be created.

class for task ‘%taskName’ not found
A Java class has been specified that does not exist. Check whether the package-path has changed (e.g. in the context of a refactoring) or the file has been accidentally deleted.

class for task %taskName% does not implement/extends the correct interface/class
A Java class has been specified that doesn’t implement the JavaDelegate or SignallableActivityBehavior interface or extends the AbstractBpmnActivityBehavior class.
The Java class have to be changed, so that it implements/extends the correct interface/class.

Couldn’t find correct beanmapping for delegate expression in task ‘%taskName’
Bean-name coudn’t be found in the beanmapping.xml

Examples


No implementation specified
No value in JavaClass
 
Class specified as implementation, but not found
Missing java class
 
class does not implement/extends the correct interface/class
Doesn't implement javaDelegate interface
 
Couldn’t find correct beanmapping for delegate expression in task ‘Service Task 1’
Wrong beanname