Overview:
=========
  The purpose of the bpm_orchestration2 quickstart sample is to demonstrate the
  use of JMS-based endpoints/services where the flow of execution is controlled
  by the process definition.  The process definition also includes a fork & join
  and makes each service invocation in a synchronous fashion.

To Run standalone mode:
=======================
  1. In a command terminal window in the quickstart folder type
     'ant deploy-jms-dests'.
  2. In a command terminal window in this folder ("Window1"), type 'ant run'.
  3. Open another command terminal window in this folder ("Window2"), type
     'ant deployProcess' to deploy the process.
  4. Switch back to ESB console and wait for the message
     'Process Definition Deployed:' to appear on the console.
  5. Switch back to "Window2", type 'ant startProcess' to start the process.
  6. Switch back to "Window1" to see the output from the ESB
  7. When finished, interrupt the ESB using Ctrl-C and, in this folder
     ("Window1"), type 'ant undeploy-jms-dests'.

To Run '.esb' archive mode:
===========================
  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
  2. Open another command terminal window in this folder ("Window2"), type
     'ant deployProcess'.
  3. Switch back to Application Server console and wait for the message
     'Process Definition Deployed:' to appear on the console.
  4. In the command terminal window ("Window2"), type 
     'ant startProcess'
  5. Switch back to Application Server console to see the output from the ESB
  6. In this folder ("Window1"), type 'ant undeploy'.

Extra Credit:
=============
  1. Modify the process definition using your favorite editor or the Grahpical
     Process Desginer (from jBPM 3.2.x).  Remove the following transitions from
     the fork to Atlanta and Dallas:

       <transition name="tr2" to="Dallas WHSE"></transition>
       <transition name="tr3" to="Atlanta WHSE"></transition>

     This change means that the flow of execution will bypass Service6 and
     Service7.

  2. ant refreshProcess - This step copies the newly changed process definition
     to its appropriate location in the deployed .esb archive and then invokes
     the deployProcess command.

  3. ant startProcess - Service6 (Dallas) and 7 (Atlanta) are gone.

  Feel free to rewire the process definition in any order that you like to see
  the change in execution flow.

Things to Consider:
===================
  - BPM related quickstarts deploy as an exploded archive.
  - The service "logic" is coded in Groovy
  - Carefully review the jboss-esb.xml and the processdefinition.xml.  One of
    the key things to understand is how the ESB action invokes or interacts with
    the process and how it moves ESB message data into process instance
    variables.
    
    <property name="esb-to-jbpm">     
      <variables>
        <variable esb-name="esbMsgVar1" jbpm-name="processVar1" />
        <variable esb-name="BODY_CONTENT" jbpm-name="theBody" />
      </variables>
    </property> 

    esb-name maps to Message.getBody().get("esbMsgVar1")
    "BODY_CONTENT" maps to Message.getBody()

Sample Output from "ant deployProcess": 
======================================
13:14:07,359 INFO  [CommandExecutor] Process Definition 'bpm_orchestration2Process' is deployed.
13:14:07,396 INFO  [STDOUT] Process Definition Deployed: 
13:14:07,396 INFO  [STDOUT] [Hello World: Deploy the process def].

Sample Output from "ant startProcess":
======================================
13:18:38,451 INFO  [STDOUT] ** Begin Receive Order - Service 1 **
13:18:38,451 INFO  [STDOUT] In: Getting Started
13:18:38,451 INFO  [STDOUT] Out: Getting Started 'Receive Order' 
13:18:38,451 INFO  [STDOUT] ** End Receive Order - Service 1 **
13:18:38,553 INFO  [STDOUT] ** Begin Credit Check - Service 3 **
13:18:38,554 INFO  [STDOUT] In: Getting Started 'Receive Order' 
13:18:38,554 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check' 
13:18:38,554 INFO  [STDOUT] ** End Credit Check - Service 3 **
13:18:38,651 INFO  [STDOUT] ** Begin Validate Order - Service 2 **
13:18:38,651 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check' 
13:18:38,651 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order' 
13:18:38,651 INFO  [STDOUT] ** End Validate Order - Service 2 **
13:18:38,736 INFO  [STDOUT] ** Begin Inventory Check - Service 4 **
13:18:38,736 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order' 
13:18:38,736 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
13:18:38,736 INFO  [STDOUT] ** End Inventory Check - Service 4 **
13:18:38,847 INFO  [STDOUT] ** Begin Los Angeles - Service 5 **
13:18:38,847 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
13:18:38,848 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Los Angeles' 
13:18:38,848 INFO  [STDOUT] ** End Los Angeles - Service 5 **
13:18:38,891 INFO  [STDOUT] ** Begin Atlanta - Service 7 **
13:18:38,892 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
13:18:38,892 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Atlanta' 
13:18:38,893 INFO  [STDOUT] ** End Atlanta - Service 7 **
13:18:38,949 INFO  [STDOUT] ** Begin Dallas - Service 6 **
13:18:38,949 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
13:18:38,950 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas' 
13:18:38,950 INFO  [STDOUT] ** End Dallas - Service 6 **
13:18:39,105 INFO  [STDOUT] ***** Ship It *****
13:18:39,106 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas' 
13:18:39,106 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas'  'Shipped' 
13:18:39,106 INFO  [STDOUT] ***** End Ship It *****
13:18:39,113 INFO  [STDOUT] SUCCESS!: 
13:18:39,113 INFO  [STDOUT] [Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas'  'Shipped' ].