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

Object-Business Process Mapping Frameworks: Abs...

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
  2. Information System BPMS Overview • Proprietary library. Lock in BPMS

    tool. • API expose low-level abstractions. • High learning curve. Challenges EDOC, 2014 4
  3. 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
  4. Objectives • Standard integration to various BPMSs • Decouple IS

    from proprietary BPMS APIs • Reduce accidental complexity EDOC, 2014 7
  5. 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
  6. Lifecycle Information System BPMS 4 –Data is syncronized Object-Business Process

    Mapping Object-Business Process Mapping EDOC, 2014 10
  7. 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
  8. Mapped Interface • Reveals process semantics • Accidental complexity is

    reduced • Independency of BPMS bankProcess.approveTransaction(); EDOC, 2014 15
  9. 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
  10. Process Dataset @Process("bankLoanProcess") interface BankProcess { void approveTransaction(); LoanData getLoanData();

    } class LoanData { String clientID; //getter and setter omitted } bankProcess.getLoanData().getClientID(); EDOC, 2014 17
  11. Callback • Allows BPMS to execute services in the Information

    System – Complementary to Mapped Interfaces • Tasks are represented by methods EDOC, 2014 18
  12. Callback Class – Data access @Process("bankLoanProcess") class BankProcessCallback { LoanData

    loanData; void approveTransaction() { //extra behavior } } EDOC, 2014 20
  13. 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
  14. Workflow Object Mapping @Process("bankLoanProcess") interface BankProcess { void approveTransaction(); }

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

    class BankProcessImpl$$ implements BankProcess { ProcessInstance pi; void approveTransaction() { pi.getActivityByName("approveTransaction") .complete(); } } EDOC, 2014 26
  16. 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
  17. Charging System • Credit transfer system • Two implementations –

    jBPM (native library) – NextFlow (with jBPM driver) EDOC, 2014 34
  18. 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
  19. 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
  20. 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
  21. Object-Business Process Mapping Framework • Less programming effort • Independency

    of BPMS • Reduction in accidental complexity • Process semantics is exposed EDOC, 2014 40