Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following diagram illustrates steps explain the process of creating and scheduling a custom task implementation.

Image Removed

The main steps while writing a task are as follows:

  1. Write the Task class
  2. Customize the task
  3. Compile and bundle the task
  4. Add the task to the WSO2 ESB class path
  5. Configure and schedule the task in ESB Console

:

Table of Contents

...

Step 1. Write the Task Class
Anchor
Writing the Task class
Writing the Task class

...

In addition to the execute() method, it is also possible to make the class implement a JavaBean interface. The WSO2 ESB EI console can then be used to configure the properties of this JavaBean.

...

It is possible to pass values to a task at run time using property elements. When creating a Task object, WSO2 ESB EI will initialize the properties with the given values in the configuration file. For those properties given as XML elements, properties need to be defined within the Task class using the following format:

...

Code Block
<property name="message">
<m0:getQuote xmlns:m0="http://services.samples/xsd">
<m0:request>
<m0:symbol>IBM</m0:symbol>
</m0:request>
</m0:getQuote>
</property>

 

...

Step 3. Compile and bundle the task
Anchor
compile
compile

Assemble the compiled class Task as a JAR file.

...

Step 4. Add to the WSO2

...

EI Class Path
Anchor
Packaging the Custom Mediator
Packaging the Custom Mediator

After compiling and bundling the Task class, you need to add it to the WSO2 ESB EI class path. Place the JAR file to the repository/components/in the lib directory of the ESBWSO2 EI.

The Task class will be available for use from the next time you start WSO2 ESBEI.

Info
titleNotice

It is required to restart the ESB WSO2 EI for the JAR containing the task implementation to be picked up by the server runtime. An OSGi bundle containing the task implementation will be created automatically and it will be deployed in the server.

...

Step 5. Configure and Schedule in

...

WSO2 EI Console
Anchor
below
below

See Adding and Scheduling Tasks.

...