Skip to main content

Implementing Tasks

After defining a TaskElement, you will need to implement the actual functionality as a customization.

By default, an implementation class {TaskElement}Impl is provided. This class contains a anchor:custom-perform where the custom implementation can be added.

public class InvoiceSenderImpl implements InvoiceSender {

public TaskResult<Void> perform(ParameterContext<InvoiceDetails> targetParameter) {
UserContext userContext = targetParameter.getUserContext();
Context context = targetParameter.getContext();
TaskResult<Void> taskResult = TaskResult.success();
if (logger.isDebugEnabled()) {
"Performing the InvoiceSenderImpl implementation"
try {
// @anchor:perform:start
// @anchor:perform:end
// anchor:custom-perform:start
// anchor:custom-perform:end
// @anchor:post-perform:start
// @anchor:post-perform:end
} catch (Exception e) {
// @anchor:perform-error:start
// @anchor:perform-error:end
// anchor:custom-perform-error:start
// anchor:custom-perform-error:end
taskResult = TaskResult.error();
if (logger.isErrorEnabled()) {
"Exception in InvoiceSenderImpl implementation", e
return taskResult;


The target DataElement instance can be accessed from the ParameterContext:

InvoiceDetails invoice = targetParameter.getValue();

To make changes to the database, you can use the LocalAgent class:

InvoiceLocalAgent agent = InvoiceLocalAgent.getInvoiceAgent();
Other elements

You can also access agents from other DataElements. When using the agent from a DataElement from another Component, you should use the {DataElement}Agent from the Proxy Layer, not the {DataElement}LocalAgent.

Custom Implementation in Ext

It it also possible to implement the Task in a custom class in the ext directory. This has some benefits:

  • You don't need to worry about missing import statements.
  • You can give it a concrete name to set it apart from other implementations.
  • It can be more concise.

Ext implementations will need to be added to the switch in the {TaskElement}Bean.


noDelegation TaskElement

When added, no dedicated {TaskElement}Impl implementation class will be generated. Customization can still be added to the {TaskElement}Bean. Using the implementation class is preferred as it is decoupled from EJB.

includeRemoteAccess TaskElement

Creates an Agent class for this TaskElement, which exposes the Task to the Control Layer and other Components. Also provides a struts-endpoint from which the task can be executed.