This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
Skip to end of metadata
Go to start of metadata

The Business Process profile of WSO2 EI has a management API for you to retrieve information on deployed processes, running and completed instances, variables, values etc. It consists of the below services. You can find the methods that are available in the below WSDL files.

You can invoke the above services via any web service client.

It is mandatory to authenticate the user before invoking management services.

The below sections walk you through the instructions on retrieving information about managing BPEL processes and instances from the management API via a sample Java client. You can customize this client based on your requirements.

Creating the Sample Client

Follow the steps below to create the sample Java Client using WSO2 EI Tooling.

Creating the Maven Project

  1. Create a Maven Project using the following information. For instructions, see Creating the Maven project.

    You can skip step 5 since you do not need to add external JAR files in this example.

    • Group Id: org.wso2.bpel

    • Artifact Id : BPELSampleClient


    Creating the Java Package

  2. Create a Java Package inside the Maven Project using the following information. For instructions, see Creating the Java Package for the Maven Project.

    • Name: org.wso2.bpel.bpelclient.v1

    Creating the Java Class

  3. Create a Java Class inside the Maven Project using the following information. For instructions, see  Creating the Java Class for the Maven Project.
    • Name: BPSManagementClient
  4. In the  Project Explorer, double-click on the file and replace its source with the below content.
    package org.wso2.bpel.bpelclient.v1;
    import java.rmi.RemoteException;
    import org.apache.axis2.client.Options;
    import org.apache.axis2.client.ServiceClient;
    import org.apache.axis2.context.ServiceContext;
    import org.apache.axis2.transport.http.HTTPConstants;
    import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub;
    import org.wso2.carbon.authenticator.stub.Login;
    import org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException;
    import org.wso2.carbon.bpel.stub.mgt.InstanceManagementException;
    import org.wso2.carbon.bpel.stub.mgt.InstanceManagementServiceStub;
    import org.wso2.carbon.bpel.stub.mgt.ProcessManagementException;
    import org.wso2.carbon.bpel.stub.mgt.ProcessManagementServiceStub;
    import org.wso2.carbon.bpel.stub.mgt.types.LimitedInstanceInfoType;
    import org.wso2.carbon.bpel.stub.mgt.types.LimitedProcessInfoType;
    import org.wso2.carbon.bpel.stub.mgt.types.PaginatedInstanceList;
    import org.wso2.carbon.bpel.stub.mgt.types.PaginatedProcessInfoList;
    public class BPSManagementClient {
        final String backendServerURL = "https://localhost:9445/services/";
        final String AUTHENTICATION_ADMIN_SERVICE = "AuthenticationAdmin";
        final String trustStore = "/Users/praneesha/Documents/Product_Packs/wso2ei-6.3.0/repository/resources/security";
        String userName = "admin";
        String password = "admin";
        String clientIPAddr = "localhost";
        String cookie = null;
        public static void main(String[] args) {
            boolean isLogged = false;
            BPSManagementClient client = new BPSManagementClient();
            try {
                isLogged = client.authenticate();
                PaginatedProcessInfoList processList = null;
                if (isLogged) {
                    System.out.println("User: " + client.userName + " loggin successful");
                    processList = client.listProcessesPaginated("name}}* namespace=*", "deployed name", 0);
                    LimitedProcessInfoType[] processes = processList.getProcessInfo();
                    if (processes != null) {
                        System.out.println("---------------------------PROCESS LIST---------------------------");
                        String leftAlignFormat = "| %-60s | %-10s | %-10s | %-20s | %-30s | %n";
                        System.out.format("| %-60s | %-10s | %-10s | %-20s | %-30s | %n", "PROCESS ID", "STATUS", "VERSION", "PACKAGE", "DEPLOYED ON");
                        for (LimitedProcessInfoType process: processes) {
                            System.out.format(leftAlignFormat, process.getPid(), process.getStatus(), process.getVersion(), process.getPackageName(), process.getDeployedDate().getTime().toString());
                    } else {
                        System.out.println("NULL process list");
                    PaginatedInstanceList instanceList = client.listInstancesPaginated("pid=*", "pid", 10, 0);
                    LimitedInstanceInfoType[] instances = instanceList.getInstance();
                    if (instances != null) {
                        System.out.println("---------------------------INSTANCE LIST---------------------------");
                        String leftAlignFormat = "| %-60s | %-10s | %-10s | %n";
                        System.out.format("| %-60s | %-10s | %-10s | %n", "PROCESS ID", "TASK ID", "STATUS");
                        for (LimitedInstanceInfoType instance: instances) {
                            System.out.format(leftAlignFormat, instance.getPid(), instance.getIid(), instance.getStatus());
                    } else {
                        System.out.println("NULL instance list");
                } else {
                    System.out.println("User: " + client.userName + " loggin FAILED!");
            } catch (LoginAuthenticationExceptionException e) {
                System.out.println("User: " + client.userName + " login failed due to :" + e);
            } catch (RemoteException | ProcessManagementException | InstanceManagementException e) {
                System.out.println("Error while retriving process list " + e);
        public boolean authenticate() throws RemoteException, LoginAuthenticationExceptionException {
            String serviceURL = backendServerURL + AUTHENTICATION_ADMIN_SERVICE;
            AuthenticationAdminStub authenticationAdminStub = new AuthenticationAdminStub(null, serviceURL);
            Login loginRequest = new Login();
            System.setProperty("", trustStore + "/client-truststore.jks");
            System.setProperty("", "wso2carbon");
            boolean isLogged = authenticationAdminStub.login(userName, password, "localhost");
            if (isLogged) {
                System.out.println("Login Successful");
                ServiceContext serviceContext = authenticationAdminStub._getServiceClient().getLastOperationContext()
                cookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);
            return isLogged;
        public PaginatedProcessInfoList listProcessesPaginated(String filter, String orderBy, int pageNumber)
        throws RemoteException, ProcessManagementException {
            String serviceURL = backendServerURL + "ProcessManagementService";
            ProcessManagementServiceStub stub = new ProcessManagementServiceStub(null, serviceURL);
            ServiceClient client = stub._getServiceClient();
            Options option = client.getOptions();
            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
            return stub.getPaginatedProcessList(filter, orderBy, pageNumber);
        public PaginatedInstanceList listInstancesPaginated(String filter, String orderBy, int limit, int pageNumber)
        throws RemoteException, InstanceManagementException {
            String serviceURL = backendServerURL + "InstanceManagementService";
            InstanceManagementServiceStub stub = new InstanceManagementServiceStub(null, serviceURL);
            ServiceClient client = stub._getServiceClient();
            Options option = client.getOptions();
            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
            return stub.getPaginatedInstanceList(filter, orderBy, limit, pageNumber);

  5. In the Project Explorer, double-click on the pom.xml file and replace its source with the below content.

    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
                <name>WSO2 internal Repository</name>

Executing the Sample Client

Follow the steps below to execute the above Sample Client.

  1. Start the Business Process Profile and log in to the Management Console using admin/admin credentials. For instructions, see Starting the product profiles.

    You need to have at least one BPEL package deployed and one instance created to view them in the output. Also, this sample client uses the default username (admin), password (admin) credentials to log in to the Business Process Profile and retrieve the information. 

  2. In the Project Explorer, right click on the pom.xml file and click Run As → 6 Maven Install.
  3. In the Project Explorer, right click on the BPELSampleClient and click Run As → 1 Java Application.

    You view the output printed in the Terminal. This includes information about the BPEL processes and instances, which are currently deployed in the Business Process profile.
  • No labels