Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Object-Business Process Mapping Frameworks: Abstractions, Architecture, and Implementation (EDOC 2014)

ASERG, DCC, UFMG
September 18, 2014

Object-Business Process Mapping Frameworks: Abstractions, Architecture, and Implementation (EDOC 2014)

The integration between enterprise architectures and Business Process Management Systems (BPMS) is currently based on low-level programming interfaces that expose accidental complexities typical of process implementations. This paper describes an approach for integrating software architectures and BPMSs, based on mapping frameworks. Our inspiration are the Object-Relational Mapping (ORM) frameworks widely used to shield information systems from low-level structures exposed by relational database systems. The paper describes the central abstractions that should be provided by Object–Business Process Mapping Frameworks (OBPM). We also propose a reference architecture for implementing OBPMs and a concrete OBPM implementation, called NextFlow. We evaluated our approach by comparing two implementations of the same system, one using NextFlow and another using the native API supported by jBPM, a popular BPMS. By using NextFlow, we achieved a reduction of 30% in terms of lines of code, 35% in terms of number of classes, and 90% in terms of import statements, when implementing this system.

ASERG, DCC, UFMG

September 18, 2014
Tweet

More Decks by ASERG, DCC, UFMG

Other Decks in Research

Transcript

  1. Object–Business Process
    Mapping Frameworks:
    Abstractions, Architecture, and
    Implementation
    Rógel Garcia de Oliveira
    Marco Túlio Valente
    {rogelgarcia,mtov}@dcc.ufmg.br
    APPLIED SOFTWARE ENGINEERING
    RESEARCH GROUP

    View full-size slide

  2. 1. Overview
    2. Abstractions
    3. Architecture
    4. Implementation
    5. Evaluation
    6. Conclusion
    Agenda
    EDOC, 2014 2

    View full-size slide

  3. Information
    System
    BPMS
    Overview
    • Proprietary library. Lock in
    BPMS tool.
    • API expose low-level
    abstractions.
    • High learning curve.
    Challenges
    EDOC, 2014 4

    View full-size slide

  4. void createProcessAndExecuteTask() {
    StatefulKnowledgeSession ks = createJbpmSession(" loanprocess . jbpm ");
    WorkflowProcessInstance pi = (WorkflowProcessInstance) ks.startProcess("process");
    WorkItemNodeInstance wi = getWorkItem(pi, "approve transaction");
    TransactionInfo ti = executeApproveTransaction(ks, wi, 1000);
    }
    WorkItemNodeInstance getWorkItem(WorkflowProcessInstance pi, String nodeName) {
    for (NodeInstance nodeInstance : pi.getNodeInstances())
    if (nodeInstance.getNode().getName().equals(nodeName))
    return (WorkItemNodeInstance) nodeInstance;
    return null;
    }
    TransactionInfo executeApproveTransaction(StatefulKnowledgeSession kSession,
    WorkItemNodeInstance wi, int value) {
    TransactionInfo ti = Application.approveTransaction(value);
    Map results = new HashMap();
    results.put("transactionInfo", ti);
    kSession.getWorkItemManager().completeWorkItem(wi.getNodeId(), results);
    return ti;
    }
    Example – jBPM API
    EDOC, 2014 5

    View full-size slide

  5. Proposed Solution
    Information
    System
    BPMS
    Object-Business
    Process Mapping
    Analogous to
    ORM
    (e. g. Hibernate)
    EDOC, 2014 6

    View full-size slide

  6. Objectives
    • Standard integration to various BPMSs
    • Decouple IS from proprietary BPMS
    APIs
    • Reduce accidental complexity
    EDOC, 2014 7

    View full-size slide

  7. 2. Abstractions

    View full-size slide

  8. Lifecycle
    Information
    System
    BPMS
    Object-Business
    Process Mapping
    1 – Build the process
    2 – Create the mapped interface
    3 – Calls are
    intercepted and
    delegated to the BPMS
    EDOC, 2014 9

    View full-size slide

  9. Lifecycle
    Information
    System
    BPMS
    4 –Data is syncronized
    Object-Business
    Process Mapping
    Object-Business
    Process Mapping
    EDOC, 2014 10

    View full-size slide

  10. Lifecycle
    Information
    System
    BPMS
    5 – When a taks is executed, callbacks
    may be triggered in the information
    system
    Object-Business
    Process Mapping
    EDOC, 2014 11

    View full-size slide

  11. Lifecycle
    Information
    System
    BPMS
    Object-Business
    Process Mapping
    EDOC, 2014 12

    View full-size slide

  12. Modeling Business Processes with OO
    • Process
    – ID: bankLoanProcess
    EDOC, 2014 13

    View full-size slide

  13. Mapped Interface
    @Process("bankLoanProcess")
    interface BankProcess {
    void approveTransaction();
    }
    EDOC, 2014 14

    View full-size slide

  14. Mapped Interface
    • Reveals process semantics
    • Accidental complexity is reduced
    • Independency of BPMS
    bankProcess.approveTransaction();
    EDOC, 2014 15

    View full-size slide

  15. Data
    • A process can have associated data
    – Process Dataset
    • Key-Value pairs
    – Process Attribute
    • Bank Loan Process
    – clientID Key Value
    clientID 456d
    EDOC, 2014 16

    View full-size slide

  16. Process Dataset
    @Process("bankLoanProcess")
    interface BankProcess {
    void approveTransaction();
    LoanData getLoanData();
    }
    class LoanData {
    String clientID; //getter and setter omitted
    }
    bankProcess.getLoanData().getClientID();
    EDOC, 2014 17

    View full-size slide

  17. Callback
    • Allows BPMS to execute services in the
    Information System
    – Complementary to Mapped Interfaces
    • Tasks are represented by methods
    EDOC, 2014 18

    View full-size slide

  18. Callback Class
    @Process("bankLoanProcess")
    class BankProcessCallback {
    void approveTransaction() {
    //extra behavior
    }
    }
    EDOC, 2014 19

    View full-size slide

  19. Callback Class – Data access
    @Process("bankLoanProcess")
    class BankProcessCallback {
    LoanData loanData;
    void approveTransaction() {
    //extra behavior
    }
    }
    EDOC, 2014 20

    View full-size slide

  20. 3. Architecture

    View full-size slide

  21. Architecture
    BPMS
    Workflow Connectivity
    Information System
    Object-Workflow Mapping
    EDOC, 2014 22

    View full-size slide

  22. Workflow Connectivity – SPI
    BPMS X
    WFC API
    WFC Client
    DRIVER X
    String url = "jwfc:bpmsX:processFiles“;
    Session s = WorkflowManager.connect(url);
    String p = getProtocol(url); // bpmsX
    Driver driver = getDriver(p);
    Session s = driver.connect(url);
    class DriverX implements Driver {
    String getProtocol(){return “bpmsX";}
    SessionX connect(String url){....}
    }
    EDOC, 2014 23

    View full-size slide

  23. Workflow Object Mapping
    Information
    System
    maps
    BPMS
    delegates
    Workflow
    Connectivity
    uses
    Object-Workflow
    Mapping
    provides
    EDOC, 2014 24

    View full-size slide

  24. Workflow Object Mapping
    @Process("bankLoanProcess")
    interface BankProcess {
    void approveTransaction();
    }
    class BankProcessImpl$$ implements BankProcess {
    ProcessInstance pi;
    void approveTransaction() {
    pi.getActivityByName("approveTransaction")
    .complete();
    }
    }
    EDOC, 2014 25

    View full-size slide

  25. Workflow Object Mapping
    @Process("bankLoanProcess")
    interface BankProcess {
    void approveTransaction();
    }
    class BankProcessImpl$$ implements BankProcess {
    ProcessInstance pi;
    void approveTransaction() {
    pi.getActivityByName("approveTransaction")
    .complete();
    }
    }
    EDOC, 2014 26

    View full-size slide

  26. 4. Implementation
    NextFlow

    View full-size slide

  27. Example
    Configuration conf =
    new Configuration("jwfc:bpmsX:resources");
    EDOC, 2014 28

    View full-size slide

  28. Example
    Configuration conf =
    new Configuration("jwfc:bpmsX:resources");
    conf.addCallbackClass(BankProcessCallback.class);
    EDOC, 2014 29

    View full-size slide

  29. Example
    Configuration conf =
    new Configuration("jwfc:bpmsX:resources");
    conf.addCallbackClass(BankProcessCallback.class);
    WorkflowObjectFactory factory = conf.createFactory();
    EDOC, 2014 30

    View full-size slide

  30. Example
    Configuration conf =
    new Configuration("jwfc:bpmsX:resources");
    conf.addCallbackClass(BankProcessCallback.class);
    WorkflowObjectFactory factory = conf.createFactory();
    BankProcess bp = factory.start(BankProcess.class);
    EDOC, 2014 31

    View full-size slide

  31. Example
    Configuration conf =
    new Configuration("jwfc:bpmsX:resources");
    conf.addCallbackClass(BankProcessCallback.class);
    WorkflowObjectFactory factory = conf.createFactory();
    BankProcess bp = factory.start(BankProcess.class);
    bp.approveTransaction();
    EDOC, 2014 32

    View full-size slide

  32. 4. Evaluation

    View full-size slide

  33. Charging System
    • Credit transfer system
    • Two implementations
    – jBPM (native library)
    – NextFlow (with jBPM driver)
    EDOC, 2014 34

    View full-size slide

  34. Charging System
    EDOC, 2014 35

    View full-size slide

  35. Starting a new process
    jBPM API
    StatefulKnowledgeSession kSession = ...;
    Map params = new HashMap();
    params.put("manager", (JbpmPhoneProcessManager) this);
    ProcessInstance p = kSession.startProcess(PROCESS_ID, params);
    NextFlow
    WorkflowObjectFactory factory = ...;
    ChargingProcess p = factory.start(ChargingProcess.class);
    EDOC, 2014 36

    View full-size slide

  36. Data manipulation
    jBPM API
    WorkflowProcessInstance process = node.getProcessInstance();
    Integer value = (Integer) process.getVariable("value");
    String to = (String) process.getVariable("to");
    Integer credit = chargingManager.getCreditFor(to);
    boolean enoughCredit = credit >= value;
    process.setVariable("enoughCredit", enoughCredit);
    NextFlow
    Integer credit = chargingManager.getCreditFor(data.getTo());
    data.setEnoughtCredit(credit >= data.getValue());
    EDOC, 2014 37

    View full-size slide

  37. Metrics
    NextFlow
    • LOC: 330 (-30%)
    • Classes/Interfaces: 11 (-35%)
    • Char Count: 12.921 (-50%)
    • API Imports: 6 (-90%)
    jBPM API
    • LOC: 475
    • Classes/Interfaces: 17
    • Char Count: 25.500
    • API Imports: 63
    EDOC, 2014 38

    View full-size slide

  38. 5. Conclusion

    View full-size slide

  39. Object-Business Process Mapping
    Framework
    • Less programming effort
    • Independency of BPMS
    • Reduction in accidental complexity
    • Process semantics is exposed
    EDOC, 2014 40

    View full-size slide

  40. QUESTIONS?
    DANKE SCHÖN!
    www.nextflow.org

    View full-size slide