Barbados Crisis Management System (BCMS)

Barbados Crisis Management System (BCMS)
Requirements def. doc.

BCMS, focus on three key requirements

  1. Steps 1 & 7 - crisis management start & end (requirements def. doc., p. 7) ⤳ slides #3-#14
    Business analysis: a concise description is provided (three collaborative BPMN processes). This BPMN specification, based on the Modelio BPMN editor, is for requirements comprehension only. Implementation in jBPM is provided as well to illustrate executability and how, on the top of the jBPM API, processes may work together with Java.
  2. Step 3 - coordination (requirements def. doc., p. 7) ⤳ slides #15-#18
    Business analysis: a concise description is provided (two collaborative BPMN processes). This BPMN specification, based on the Bonita BPM Studio BPMN editor is discussed with alternatives, which may sometimes lead to anti-patterns.
  3. Step 3.a - “the negotiation exceeds a predefined limit” (requirements def. doc., p. 7) ⤳ slides #19-#21
    Business analysis: two (complete) competing descriptions are provided, i.e., two versions of the same possible subprocess. These BPMN specifications are executable since they are designed by means of jBPM.

BCMS, req. 1* - First process (business analysis)

*Key illustrated notions: BPMN start conditional event , BPMN intermediate caught signal event , BPMN send task , BPMN parallel gateway

Download Modelio project

BCMS, req. 1* - Second & Third processes (business analysis)

Download Modelio project

BCMS, req. 1 - overview (business analysis)

Download Modelio project

BCMS, req. 1* - First process (execution)

*For the sake of simplicity, Exchange crisis details task and Manage sub-process are grouped together.

Download jBPM file

BCMS, req. 1* - Second process (execution)

*Manual tasks just aim at simplifying processes; namely, the org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler Java class acts as jBPM work item handler (see also slide #9).

Download jBPM file

BCMS, req. 1* - Third process (execution)

*Manual tasks just aim at simplifying processes; namely, the org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler Java class acts as jBPM work item handler (see also slide #9).

Download jBPM file

BCMS, req. 1 - message sending and arriving

jBPM requires the “definition” of an execution semantics for message sending and arriving. Namely, a homemade jBPM work item handler is designed for both Send Task and Receive Task*. The BCMS_req_1_Receive_Send_Task jBPM project must access to both jBPM work item handlers as runtime components; the following configuration steps are then required:

  1. Java executable (.jar file) has to be uploaded into jBPM artifact repository (⚙ Admin » Artifacts » Upload)
  2. Add artifact as dependency to the BCMS_req_1 jBPM project (BCMS_req_1 » Settings » Dependencies » Add from repository)
  3. Declare Send Task and Receive Task jBPM work item handlers in deployment descriptor (kie-deployment-descriptor):

*For the sake of simplicity, message sending amounts to serializing message data in XML while message arriving consists in de-serializing them (next two slides); this implementation is rather poor: to have an enhanced mechanism, the best is to plug message sending and arriving into Java Message Service (JMS).

Download Java Maven project

Send Task

public class BCMS_req_1_Send_Task implements org.kie.api.runtime.process.WorkItemHandler { … // Other stuff before
    public void executeWorkItem(org.kie.api.runtime.process.WorkItem wi, org.kie.api.runtime.process.WorkItemManager wim) {
// jBPM just started 'Make FSC aware' or 'Make PSC aware' send task...
        wi.getParameters().entrySet().forEach((entry) -> {
            System.out.println("\tEmission, Key = " + entry.getKey() + ", Value = " + entry.getValue().toString());
            if (entry.getKey().equals("crisis_id")) { // Get 'Data Input' field of 'Make FSC aware' or 'Make PSC aware' send task...
                java.beans.XMLEncoder e;
                try {
                    e = new java.beans.XMLEncoder(new java.io.BufferedOutputStream(new java.io.FileOutputStream(entry.getKey() + ".xml")));
                    e.writeObject(entry.getValue().toString());
                    e.close();
                } catch (java.io.FileNotFoundException fnfe) { java.util.logging.Logger.getLogger(BCMS_req_1_Send_Task.class.getName()).log(java.util.logging.Level.SEVERE, null, fnfe); }
            }
        });
        wim.completeWorkItem(wi.getId(), null);
    }
}

Receive Task

public class BCMS_req_1_Receive_Task implements org.kie.api.runtime.process.WorkItemHandler { … // Other stuff before
    public void executeWorkItem(org.kie.api.runtime.process.WorkItem wi, org.kie.api.runtime.process.WorkItemManager wim) {
// jBPM just started 'Make FSC aware' or 'Make PSC aware' receive task...
        wi.getParameters().entrySet().forEach((entry) -> {
            System.out.println("\tReception, Key = " + entry.getKey() + ", Value = " + entry.getValue().toString());
            if (entry.getKey().equals("crisis_id")) {
                java.beans.XMLDecoder d;
                try {
                    d = new java.beans.XMLDecoder(new java.io.BufferedInputStream(new java.io.FileInputStream(entry.getKey() + ".xml")));
                    if (entry.getValue().toString().equals(d.readObject().toString())) {
                        java.util.Map<String, Object> results = new java.util.HashMap();
                        results.put(entry.getKey(), entry.getValue());
                        wim.completeWorkItem(wi.getId(), results);
                    } else {
                        wim.completeWorkItem(wi.getId(), null);
                    }
                    d.close();
                } catch (java.io.FileNotFoundException fnfe) { java.util.logging.Logger.getLogger(BCMS_req_1_Receive_Task.class.getName()).log(java.util.logging.Level.SEVERE, null, fnfe);
                    wim.completeWorkItem(wi.getId(), null); }
            }
        });
    }

BCMS, req. 1 - execution, step #1*

*Scenario: the crisis management master process is started.

BCMS, req. 1 - execution, step #2*

*Scenario: the FSC process is started after the crisis management master process; the FSC process immediately terminates because its (single) manual task is empty.

BCMS, req. 1 - execution, step #3*

*Scenario: the crisis management master process goes through the FSC connected sub-step, but it is still blocked within the PSC connected sub-step because the PSC process is not yet started. When started, the crisis management master process moves to Exchange crisis details & manage.

BCMS, req. 2

Download Bonita BPM Studio .bos file

BCMS, req. 2 - coarse-grain business analysis

BCMS, req. 2 - anti-pattern

BCMS, req. 2 - event-based gateway

BCMS, req. 3

From the effective crisis management start (i.e., firemen and policemen are both connected and perfectly know the crisis' details), one has to record, if it occurs, the fact that the management duration exceeds a given limit (this limit is not set to a given value in the requirements def. doc.).

This requirement appears under the name “the negotiation exceeds a predefined limit” (requirements def. doc., p. 7) in the processes.

BCMS, req. 3 - alternative #1*

*Key illustrated notions: BPMN boundary non-interrupting timer event . Note that he Time Duration property of the Off limit BPMN boundary non-interrupting timer event is set to #{predefined_limit} where predefined_limit is a jBPM process variable.

Download jBPM file

BCMS, req. 3 - alternative #2*

*Key illustrated notions: BPMN event subprocess

Download jBPM file

BCMS, req. 1 - FSC - Enterprise Architect

Download Enterprise Architect project

BCMS, req. 1 - PSC - Enterprise Architect

Download Enterprise Architect project

BCMS, req. 1 & 3 - Crisis management - Enterprise Architect

Download Enterprise Architect project

BCMS, Information system - Enterprise Architect

Download Enterprise Architect project

© Franck Barbier