Thursday, March 9, 2017

Installing new features to WSO2 EI

In WSO2 Enterprise Integrator, you cannot install new features via management console. That option has been removed. So in order to install a feature, we must use the POM based feature installation. This is explained in WSO2 docs [1]. There few changes you need to made in order to this POM.xml to work.

  • The "destination" element value should be changed to, "wso2ei-6.0.0/wso2/components".
  • Value of the "dir" attribute in "replace" element should be, "wso2ei-6.0.0/wso2/components/default/configuration/org.eclipse.equinox.simpleconfigurator".
Optionally, Other than downloading p2 repo (which is over 2GB), the URL to P2 repo "" can be set as "metadataRepository" and "artifactRepository".

Following is a sample pom.xml that is used to install HL7 feature in EI.

[1] -

Tuesday, March 7, 2017

Resolving SSL related issue in WSO2 products for MySql 5.7 upward

If you try to start aWSO2 product with Mysql 5.7 it will give the following warning and the product will not work.

Wed Dec 09 22:46:52 CET 2015 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

This can be avoided for development purposes by not using SSL. For this the JDBC url for the database should be appended with "useSSL=false". But it cannot be appended with a & sign like in a normal URL. Use the following format. If not it may give xml parsing errors.

Then it will work as usual.

Friday, February 12, 2016

BPMN REST tasks with WSO2 BPS

WSO2 BPS supports invoking rest endpoints out of the box. Follow the following steps to add a RESTTask to your workflow using Activity BPMN 2.0 designer.

  1. Add the BPMN designer to your Eclipse installation using the update site here. 
  2. Start a new BPMN project.
  3. Add a new service task from the tasks palette.
  4. Go to the task properties panel and open main config tab.
  5. Select "Java class" as task type.
  6. Give "" as the Class name.
  7. Now add fields with following names, and values in String value field, under documentation section.
    • serviceURL - rest service endpoint
    • method - http method to use
    • basicAuthUsername - username if the endpoints are secured
    • basicAuthPassword - password for the username above
    • input - payload to be sent
    • outputVariable - process variable to save the response
    • headers - header values in the format "key1:value1,key2:value2"
Now you can retrieve the response from the variable specified above in the succession steps of the workflow.

Refer the screenshot below to find out the important places you require inside eclipse designer.

Changing the endpoint after process deployment

The REST endpoint could not change after deploying the process in above method. If you want to change the endpoint after deploying the process also, pointing to a registry location which contains an endpoint reference as mentioned in Endpoint+References. For this add a field with name "serviceRef" instead of the "serviceURL" field and give the registry location of the service reference as the value.

Using json payloads

You can send json as the payload also.

Give the json payload to the input field. This time use the expression box in add field dialog to give the json value instead of string value box. Add new field called "outputMappings" and mention the mapping format from response json, similar to ",var3:item.price" format.

EDIT on 14/05/2016

REST task sample

I have added a sample at BPMNRESTSample. This sample  make a REST call to a endpoint and display the response in a user task. Deploy the sample in WSO2 BPS and start a new process instance from BPMN Explorer shipped with BPS.

Enjoy with REST!!

WSO2 BPS - Customizing web apps

Wso2 BPS 3.5.0 is shipped with two web applications, the Humantask Explorer and BPMN Explorer.
By default it is configured to be used in a standalone BPS server. But they can be configured to other setups also. For this, you need to edit the config.json file. The web apps are located in the <Wso2Server_Home>/repository/deployments/server/jaggeryApps/ folder. I'll refer this as jaggery apps folder, now on. config.json is inside the <webapp_home>/configs folder.

Now, let me explain different configurations one by one.

  1. Use the explorers in a different tenant domain other than the super tenant.
    • Copy the relevant web app from jaggery apps folder into to the <WSO2_Home>/repository/tenants/<tenanat_id>/jaggeryapps folder.
    • Give the tenant name in the config.json.
  2. Run BPS in a separate server other than the web app container.
    • Fill the bpsHost and bpsPort parameters in the config.json
These are the only two configurations I can remember write now. There could me more!

Tuesday, September 29, 2015

Human Tasks : Assign both users and groups in a single people assignment

Usual method of people assignment in WS Human tasks is using a logical people group. But it is not possible to assign to both people groups and users in a single logical people group. So in order to achieve this, you need to use literals as defined in WS Human Task Spec.

Following is a sample of assigning both groups and individuals inside same people assignment to potential owners. I have used and tested this in latest WSO2 Business Process Server successfully.

Wednesday, July 22, 2015

WSO2 BPS : Business process monitoring with WSO2 Analytics

Business process  information can be monitored using WSO2 Data Analytics Server (DAS). For this an event stream should be published to DAS. WSO2 BPS 3.5.0 supports publishing to DAS 3.0.0.

Publishing data to DAS from BPS requires following steps. They are explained using the KPI sample in WSO2 BPS samples.

  1. Configure DAS publishing extension.
  2. Implement a business process with the configurations to publish the data to DAS.
  3. Run the BPEL process and publish data to DAS.
  4. Monitor information via DAS.

Configure DAS publishing extension

Add the following extensionActivity to bps.xml, which is located in /repository/conf/directory.

Create the BPEL process to publish data to DAS

In order to specify the server configuration details, and monitoring data (Payload, Correlation and Meta), BPS uses an XML configuration file. This configuration file should specify the BPEL process in the deploy.xml file (deployment descriptor file for a BPEL package). The analytics server profile is specified using  element <analyticsServerProfiles>. Observe the analytics profile in the following deploy.xml. The ‘file:‘ in location is used to specify the file path to analytics server profile.
Let's create the analytics server profile. It takes the following xml structure.

The connection element is used to describe the Analytics server information. Credential element describes the authentication info to authenticate to the Analytics server. Under the element, many Analytics streams can be defined. The following is the structure for a Analytics stream definition.

A DAS definition should have the properties, ‘name’, ‘version’, ‘nickName’ and ‘description’. Under the <stream> element, each of the data items published to analytics server is specified using the child element <data>.
The name attribute of the element describes the key used by analytics server to identify the given data item and the type attribute describes the type of data item. Analytics server has three types of data. They are meta data, payload data and correlation data. This can be specified using the type attribute. The standard From syntax from BPEL is used to select the value of each key. When selecting a variable to be published to DAS, it can be specified as <From variable=”quantity”/>. The variable name should be the same name used in the BPEL process. The following is a complete example of an AnalyticsServer Profile.

Run the BPEL Process and publish data to Analytics server

When developing the BPEL process, the following information should be included in the BPEL process in order to DAS publishing to work. Under the process element in the BPEL script, define the DAS publishing extension.

Also include the namespace found in in the process declaration. Now, in the location where you want information published, include the following extension activity section.

The publish element describes the name given to the Analytics server profile and the corresponding stream definition to get the configuration data. If all configurations are done correctly, when you run the BPEL process, the data is published to Analytics server.

Monitor information via DAS

KPI sample shipped with WSO2 BPS is a bpel process can submit event information to the Analytics server. Let's setup the sample.
  • Start DAS without a port offset.
  • Download and unzip BPS.
  • Configure the bps.xml file in the repository/conf directory of bps by adding the DAS publishing extension as mentioned in step 1.
  • Configure a port offset of 5 in carbon.xml.
  • Upload BPEL process in /repository/samples/bpel to BPS.
  • Now click on the services list and send the KPISampleProcess request as mentioned below using tryit editor. Send few more requests.
  • Send a few request to the BPS process. It would publish this data to DAS and deploy a new stream definition with id ‘’.
  • Log into DAS, click on the Streams under Manage tab to check the created stream definition.
  • Click edit under actions column. This will show all the information of the event stream. Do not change anything here for this sample. It will change the stream.
  • We need to persist the data received from  BPEL process in order to analyse them. Click on the ‘Next[Persist Event]’ button at the bottom.
  • Select whatever data you need to persist from here and click save stream. 
  • We need to add a event receiver to populate the table we created, with data received from BPEL process. Click on ‘Receivers’ under Manage tab. Click on ‘Add Event Receiver’. 
  • Fill the form with following information.
  1. Event Receiver Name :
  2. Adapter type : wso2event
  3. Event stream -
  4. Message format - wso2event
  • Submit the form to create new event receiver from bps.
  • Now we have setup the infrastructure to receive and analyse event information from BPS. Let’s create a dashboard to visualise the KPI data. Create a new Dashboard in DAS as instructed in Adding a Dashboard.
  • Now follow the instructions in  ‘Adding a gadget using the gadget generation wizard’ section in page Adding gadgets to a layout. Select ‘ORG_WSO2_BAM_PHONE_STORE_KPI’ as the datasource here. You can create different types of charts and use different data combinations here.
  • Add the new gadget to your dashboard.

Now you can visualise the event information using the Analytics Dashboard. Try sending more requests to the BPEL process and note the changes in charts.

Thursday, June 18, 2015

WSO2 BPS : Skippable Human Tasks

A human task can be skipped by a business admin of that task. In order to make a human task skippable you need to edit the corresponding BPEL process that invoke it. It is not a property of the Human Task.

In order to invoke a human task in WSO2 BPS, we should include a people activity, such as shown in following snippet from a BPEL process definition.

Note that there is a attribute called 'isSkipable' inside peopleActivity element. This attribute is by default set to 'no' if the process is created using WSO2 Dev Studio. Changing it to yes will make the human tasks invoked by the particular process skippable.