Versions Compared

Key

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

...

  1. Compile the class and export it as a JAR file. Make sure you have the following JARs in the classpath before compilation.
    • <AM_HOME>/repository/components/plugins/org.wso2.carbon.apimgt.impl_1.2.1.jar
    • <AM_HOME>/repository/components/plugins/org.wso2.carbon.apimgt.api_1.2.1.jar
    • javax.mail.jar: see https://java.net/projects/javamail/pages/Home to download the JAR
  2. After exporting the JAR, copy it to <AM_HOME>/repository/components/lib.
  3. Log in to APIM management console (https://<Server Host>:9443/carbon) and select Browse under Resources.

     

  4. Go to /_system/governance/apimgt/applicationdata/workflow-extensions.xml resource, disable the Simple Workflow Executor and enable WS Workflow Executor. Also specify the service endpoint where the workflow engine is hosted and the credentials required to access the said service via basic authentication (i.e., username/password based authentication). For example:

    Code Block
    languagexml
    <WorkFlowExtensions>
    ...
        <!--SubscriptionCreation executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionCreationSimpleWorkflowExecutor"/-->
        <SubscriptionCreation executor="org.wso2.sample.workflow.SubsCreationEmailSender">
           <Property name="adminEmail">to_user@email.com</Property>
           <Property name="emailAddress">from _user@email.com</Property>
           <Property name="emailPassword">from_user_password</Property>
        </SubscriptionCreation>
    ...
    </WorkFlowExtensions>

    Note that the adminEmail, emailAddress and emailPassword properties will be assigned to the appropriate variables defined in the class through the public setter methods of those variables.

...