...
- 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
- After exporting the JAR, copy it to
<AM_HOME>/repository/components/lib
. Log in to APIM management console (
https://<Server Host>:9443/carbon
) and select Browse under Resources.
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 language xml <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
andemailPassword
properties will be assigned to the appropriate variables defined in the class through the publicsetter
methods of those variables.
...