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 Slide

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

    View Slide

  3. 1. Overview

    View Slide

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

    View Slide

  5. 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 Slide

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

    View Slide

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

    View Slide

  8. 2. Abstractions

    View Slide

  9. 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 Slide

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

    View Slide

  11. 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  16. 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 Slide

  17. 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

  21. 3. Architecture

    View Slide

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

    View Slide

  23. 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 Slide

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

    View 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 25

    View Slide

  26. 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 Slide

  27. 4. Implementation
    NextFlow

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  31. 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 Slide

  32. 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 Slide

  33. 4. Evaluation

    View Slide

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

    View Slide

  35. Charging System
    EDOC, 2014 35

    View Slide

  36. 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 Slide

  37. 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 Slide

  38. 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 Slide

  39. 5. Conclusion

    View Slide

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

    View Slide

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

    View Slide