Versions Compared

Key

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

This page describes how to write a custom task. To better illustrate the topic, we provide instructions based on the example.

...

The main steps while writing a task are as follows:

...

Table of Contents

...

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

...

Info

When creating the customized schedule tasks, if the injecting sequence of the message flow contains Publish Event mediators, set the following property in the Synapse message context:

mc.setProperty("CURRENT_TASK_EXECUTING_TENANT_IDENTIFIER",PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());

Also, add the following dependency to the POM file of the custom task project: WSO2 Carbon - Utilities bundle (symbolic name: org.wso2.carbon.utils)

...