Lombardi Notes 01dec2008

5 minute read






Notes from dec 1 and 2, 2008

Lombardi Teamworks Suite, Business modeling

Class based off chapter 9 of the doc at www.bpmn.org



Buzzwords

BPMN (business process modeling notation) www.bpmn.org

BPD (business process definition)

Day 1


Focus on process modeling.  Teamworks uses eclipse to design process models.



BPMN Flow Objects

- Events (start event, end event, intermediate events)

- Activities (tasks and processes)

- Gateways (decision, conditional, etc)

- flows (transitions from one thing to another)

- Pools and Lanes (allows roles to access activities - a security/access model)



Version Control

no built in version control until lombardi version 7

All "assets" can be exported as XML to be added to external source control



Gateways

Gateways are questions.

Gateways are made on outgoing sequence flow lines. 

The order of the lines in the decision gateway is the order in which they will be evaluated.  Very important for XOR gateways.

Gateway Split Types:

- Simple Split = parallel processing.  Breaks a single process token into multiple process tokens, which continue down the path to complete their part of the workflow

- conditional (inclusive) = parallel processing. Breaks a single process into one or more other processes depending on conditions. must have a default line. All conditions matched are executed.

- decision (XOR) = only one condition is matched, looking at lines from top to bottom, only the first match runs.  else, it runs default process.




Gateway Joins:

    - simple join = waits for all process tokens to return from all lines connected.

    - Conditional (smart) join = waits for all potential splits to return.  Looks upstream to determine the proper amount of tokens to return.



TeamWorks Scripting

- All scripting via JavaScript

- lombardi uses server side AND client side javascript (server side via rhino)

- all coding done via OOP style javascript (Everything is an object, and must be called by its full namespace name)



Variables

- Can only be created in a process or a service

- organize data in groups via structures

- all variables must be referenced by its namespace.  in teamworks, the default namespace is tw.local (for process or service) or tw.system.

- variables must be scoped and typed

- passing variables works like calling functions.  You must declaire input and output variables, and they must have the same type.

- as a convention, name/mark variables as input and output as needed.

- BP Variable types should be upper camel case.  Variables within a type should be lower camel case.



Screenshots
























Day 2

Morning challenge:

Create a BPD that determines the correct route to take based on weather/time criteria using only activities and decision gateways.

Services
- as a BP, each activity should have its own service.  they should be named the same, if possible
- services run "coaches" which accept user input
- services go into their own folder.  For now, we are putting the services folder into the process folder.

Coaches(forms)
Here, we've create a service and added a single coach

Here, we've started working on the coach.  Be sure to open the "Outline" view.  From there, you can drag variables you've defined in your service into your coach to create a form.

You can drag variables one by one, or you can drag the entire complex datatype onto the form and it will create fields for all variables in the type for you. (as shown in the buttons section below)

Buttons
-Buttons only ever execute a form "post" method.
-You can only ever drag a button group from the palette into the form.  From the button group, you define specific buttons in the properties window, the presentation tab.
-Buttons are accessed late in javascript via the name "<button_group_id>_<button_id>"
-To flow from one coach to another item, you must have at least one button group.  Without a button, you cannot assign an output line in diagram view.


Form Field Visibility (and other properties)

- Individual fields can be changed to be hidden, viewable, editable or required.  By default, all items are set to "editable".  In addition, you can set conditions where items can become editable, based on other values of the form changing (it generates JS to implement these features in the html rendered)


Now that we have a form and a button, we can draw a flow to and from the coach in diagram view.


Initializing a javascript object
We create a separate service just to initialize the datatype we want to use in the coach (PositionInformation in this case).  To do that, you need to create an output variable of the type you want to initialize.  The service is all custom server side script.  Within the code, all we do is add code (in the implementation tab of the custom server script object) to initialize the datatype in the format "<variablename> = new <datatype>;"

With that new init service defined, we can add that to the "coach service".  Drop in a "nested service" into the coach service.  Make sure that fires off before the coach.  View the properties of the nested service, implementation tab, then assign the init service you created earlier.  You'll end up with something similar to below.


now draw a flow line from the init service to the coach.  Select the init service again, view properties and then the mapping tab. From there, you want to map the output of the init service to the output of the coach service.  Now the variable is initialized before the coach starts.  you can then customize the init script to pre-set variables (from a database perhaps) before the coach loads.

Implement Coach in Process (BPD)

open the BPD and select the task you want to assign the coach to (In my case, "Submit Request") and view its properties, implementation tab.
Assign a "Teamworks Service" and select the coach service we created previously.  After that, we have to map variables, mapping the positionInformation output variable from the coach service to the private variable in the process.


At this point, we set the next step to use the same service, without doing variable mapping (apprently we need that to do the step through the process).  Then we can run the process and do some debugging:

Here's where it gets tricky.
1) Select the process window (the BPD)
2) Click "Run service" at the top toolbar. This kicks off a new token, that process token now lands at the first task in the top right pane.
3) Selecting the new task in the top right pane, start that task by clicking run when its selected.  That should launch the "coach" in a browser (its an html form).
4) Fill out the the form and click submit, when the browser closes (the coach ends) you need to refresh the process in the IDE by clicking on that refrech button in the top toolbar. It should show the token has moved from your first activity to the next one.  You can then inspect task variables in the execution state pane.  Double clicking on the variable will display its xml value.
Implement Coach in Process (BPD) with gateways

Business rules: Between department and job level there are rules

it employee = 5000
it managers = 6000
all others = 8000
executive = 20000


HowTo Enable Advanced Editor






Tags:

Updated: