Revise Java service task: introduce BpmnJavaDelegation and field injection

Description

There are different strategies to delegate to java code:

  • expect an interface and call a known method (e.g. ActivityBehavior)

  • evaluate an expression

  • call a method on an object (probably evaluation of expr is sufficient)

1) For all configuration strategies that expect an interface to be implemented, it should be documented that ActivityBehavior should be implemented. But each time when we mention that interface in the docs, we should add that we have a class called org.activiti.bpmn.BpmnJavaDelegation as part of the engine api that can be used for this. That base abstract class should have an abstract method perform(DelegateExecution). Both ActivityBehavior.execute and EventListener.notify delegate to perform. The ActivityBehavior.execute also should include the default BPMN outgoing behavior. That way those implementations can be used as ActivityBehavior and as EventListener.

2) For all configuration strategies of delegation code for objects that we instantiate, a list of field injection configurations should be supported as follows:
<field name="myField"><string>blabla</string></field>
For now, we'll only support strings. This is part of the larger goal to allow users to write a simple ActivityBehavior and then plug it into the engine and into the designer without any other requirements.

Related discussion: http://forums.activiti.org/en/viewtopic.php?f=4&t=261

Assignee

Joram Barrez

Reporter

Tom Baeyens

Labels

None

Components

Fix versions

Priority

Major
Configure