Object-Business Process Mapping Frameworks: Abstractions, Architecture, and Implementation (EDOC 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.

13beaa3b7239eca3319d54c6a9f3a85a?s=128

ASERG, DCC, UFMG

September 18, 2014
Tweet

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
  2. 1. Overview 2. Abstractions 3. Architecture 4. Implementation 5. Evaluation

    6. Conclusion Agenda EDOC, 2014 2
  3. 1. Overview

  4. Information System BPMS Overview • Proprietary library. Lock in BPMS

    tool. • API expose low-level abstractions. • High learning curve. Challenges EDOC, 2014 4
  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<String, Object> results = new HashMap<String, Object>(); results.put("transactionInfo", ti); kSession.getWorkItemManager().completeWorkItem(wi.getNodeId(), results); return ti; } Example – jBPM API EDOC, 2014 5
  6. Proposed Solution Information System BPMS Object-Business Process Mapping Analogous to

    ORM (e. g. Hibernate) EDOC, 2014 6
  7. Objectives • Standard integration to various BPMSs • Decouple IS

    from proprietary BPMS APIs • Reduce accidental complexity EDOC, 2014 7
  8. 2. Abstractions

  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
  10. Lifecycle Information System BPMS 4 –Data is syncronized Object-Business Process

    Mapping Object-Business Process Mapping EDOC, 2014 10
  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
  12. Lifecycle Information System BPMS Object-Business Process Mapping EDOC, 2014 12

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

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

    2014 14
  15. Mapped Interface • Reveals process semantics • Accidental complexity is

    reduced • Independency of BPMS bankProcess.approveTransaction(); EDOC, 2014 15
  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
  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
  18. Callback • Allows BPMS to execute services in the Information

    System – Complementary to Mapped Interfaces • Tasks are represented by methods EDOC, 2014 18
  19. Callback Class @Process("bankLoanProcess") class BankProcessCallback { void approveTransaction() { //extra

    behavior } } EDOC, 2014 19
  20. Callback Class – Data access @Process("bankLoanProcess") class BankProcessCallback { LoanData

    loanData; void approveTransaction() { //extra behavior } } EDOC, 2014 20
  21. 3. Architecture

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

    22
  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
  24. Workflow Object Mapping Information System maps BPMS delegates Workflow Connectivity

    uses Object-Workflow Mapping provides EDOC, 2014 24
  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
  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
  27. 4. Implementation NextFlow

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

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

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

    conf.createFactory(); EDOC, 2014 30
  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
  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
  33. 4. Evaluation

  34. Charging System • Credit transfer system • Two implementations –

    jBPM (native library) – NextFlow (with jBPM driver) EDOC, 2014 34
  35. Charging System EDOC, 2014 35

  36. Starting a new process jBPM API StatefulKnowledgeSession kSession = ...;

    Map<String, Object> params = new HashMap<String, Object>(); params.put("manager", (JbpmPhoneProcessManager) this); ProcessInstance p = kSession.startProcess(PROCESS_ID, params); NextFlow WorkflowObjectFactory factory = ...; ChargingProcess p = factory.start(ChargingProcess.class); EDOC, 2014 36
  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
  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
  39. 5. Conclusion

  40. Object-Business Process Mapping Framework • Less programming effort • Independency

    of BPMS • Reduction in accidental complexity • Process semantics is exposed EDOC, 2014 40
  41. QUESTIONS? DANKE SCHÖN! www.nextflow.org