Giter Club home page Giter Club logo

wso2-bpmn-rule-task's Introduction

WSO2 BPMN Rule Task

WSO2 BPMN Rule Task provides features for executing Drools rules in WSO2 Enterprise Integrator(EI)/BPS in BPMN process work flows. It has been implemented using a BPMN service task and the Drools files are designed to be managed in BPS registry.

Getting Started

  1. Clone this repository and build it using maven:

    git clone https://github.com/imesh/wso2-bpmn-rule-task.git
    mvn clean install
  2. Copy the following JAR files to the lib/ directory of the WSO2 EI/BPS server:

    cp target/bpmn-rule-task-1.0-SNAPSHOT.jar ${WSO2_EI_HOME}/dropins/
    cp target/dependency/drools-compiler-6.0.1.Final.jar ${WSO2_EI_HOME}/lib/
    cp target/dependency/drools-core-6.0.1.Final.jar ${WSO2_EI_HOME}/lib/
    cp target/dependency/kie-api-6.0.1.Final.jar ${WSO2_EI_HOME}/lib/
    cp target/dependency/kie-internal-6.0.1.Final.jar ${WSO2_EI_HOME}/lib/
    cp target/dependency/mvel2-2.1.8.Final.jar ${WSO2_EI_HOME}/lib/
  3. Implement a BPMN process work flow using WSO2 Developer Studio and add a service task to it. Then click on the service task and add the following class name under main config:

    org.wso2.carbon.bpmn.rule.task.RuleTask
    
  4. Upload a Drools rule file to WSO2 EI/BPS registry path /_system/config/rules/ using the Carbon console:

    package com.sample
    
    global String var1;
    global Integer var2;
    
    rule "Rule 1"
        when
            value: Object (true)
        then
            System.out.println( "Fact: " + value);
            System.out.println( "var1: " + var1);
            System.out.println( "var2: " + var2);
    end
    
  5. Provide its resource path using a documentation field in the above service task with the name drlRegPath as follows:

    drlRegPath = conf:/rules/sample.drl
    
  6. Now define required global variables of the Drools rule file using the prefix global_ and facts using fact_ as follows:

  7. Generate the deployment artifact of the above BPMN process work flow and deploy it in WSO2 EI/BPS server.

  8. Once deployed, invoke the process flow using the BPMN explorer.

wso2-bpmn-rule-task's People

Contributors

imesh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.