











Signup for Training
- Atlanta, GA Dec 3-5
- Melbourne, AU, Dec 9-11
- New York Dec 10-12
- Brussels, BE, Dec 16-18
- Washington, DC, Dec 17-19
More trainings...
Intalio|BPMS Webinars
- Nov 20, 2008 1 PM EST
- Nov 21, 2008 1PM EST
- Nov 26, 2008 10 AM GMT
- Dec 5, 2008 10 AM PST
- Dec 9, 2008 1 PM EST
- Dec 11, 2008 1 PM EST
- Dec 19, 2008 10 AM PST
- Dec 30, 2008 10 AM PST
- Jan 13, 2009 10 AM PST
- Jan 15, 2009 1 PM EST
- Feb 3, 2009 10 AM PST
- Feb 12, 2009 1 PM EST
- Feb 17, 2009 10 AM PST
- Mar 10, 2009 10 AM PST
- Mar 12, 2009 1 PM EST
- Mar 24, 2009 10 AM PST
Login
Who's online?
- (jloge@ebsco.com)
- Alexander Stuckenholz (alexander.stuckenholz)
- alfons bataller Díaz (alfons.bataller.diaz)
- chris robson (chris.robson)
- Deepa Tekumalla (deepa.tekumalla)
- Gabriel Giordano (gabriel.giordano)
- gianni naccio (gianni.naccio)
- Ilo Rivero (ilo.rivero)
- Jose Gregorio Castillo (jose.gregorio.castillo)
- Leonardo Lopes (leonardo.lopes)
- Leonardo Saraiva (leonardo.saraiva)
- manindra mallick (manindra.mallick)
- Marcin Urbanski (marcin.urbanski)
- Milos Vacek (milos.vacek)
- nie pin (nie.pin)
- Oleg Pozdnyakov (o.pozdnyakov)
- Pavel Lekhanov (lehanov)
- Ravinderjit Singh (ravinderjit.singh)
- Tamara Dobrynina (tamara.dobrynina)
- Teo Bon (teo.bon)
- Wael Soliman (wael.soliman)
Tutorials-5.1
Beginning Intalio|BPMS 5.0/OpenLexicon Tutorial (Intermediate) Beginning Intalio|BPMS 5.0/OpenLexicon Tutorial (Intermediate)
In this tutorial, we explain how to use the Open Business Rules Management System with Intalio. The prerequisite files including the OpenLexicon WSDL, an export of the repository for import and a solution to the tutorial are included in this
OpenLexicon Sample.
Prerequisite
You do not have to be completely familiar with Business Rules or OpenLexicon to complete this tutorial. To complete this tutorial you must download and install the latest version of the universal installer for OpenLexicon (http://www.openlexicon.org/).
This tutorial requires version 5.0.125 (or latter) of the Intalio designer and release 31 (or latter) of the server and the universal installer for OpenLexicon.
Scenario
In an employee on-boarding system, the company has established policies for the assignment of the proper computer to employees based on a number of conditions. For instance:
- Engineers in Engineering are assigned an engineering work station
- Sale personnel are always assigned a lap top
- And so forth
This is a good candidate for a truth table approach. The truth table is presented here:
|
Position |
Department |
Field Tech |
Assignment |
Included |
|
ENGINEER |
ENGINEERING |
ENGINEERING WORK STATION |
x |
|
|
FIELD TECH |
FIELD SERVICES |
LOCATOR |
HAND HELD GPS |
x |
|
FIELD TECH |
FIELD SERVICES |
INSTALLER |
HAND HELP |
x |
|
FIELD TECH |
FIELD SERVICES |
INSPECTOR |
LAP TOP |
x |
|
ADMINISTRATIVE |
* |
WORK STATION |
x |
|
|
EXECUTIVE |
ENGINEERING |
ENGINEERING WORK STATION |
x |
|
|
SALES |
* |
LAP TOP |
x |
|
|
EXECUTIVE |
HUMAN RESOURCES |
WORK STATION |
NOT! |
The ‘Included' column defines the rules that are in the OpenLexicon project when you start this demonstration. At the end of this tutorial we will enter the logic in OpenLexicon and deploy it without changing the process or restarting any servers.
Obviously, you could put this data into an SQL table and develop queries with the JDBC connector. Yet, you can build many layers of logic into OpenLexicon.
We will develop a process that accepts an employee business object and invokes the business rules and returns the computer type.
In general OpenLexicon provides 3 basic capabilities:
- Validation: Make certain the data provided is correct
- Transformation: Assign the data to parameters according to the rules in the truth table
- ‘Lexicon Process': complete a branching use case that performs a combination of these actions
In this simple scenario we are going to develop a process that can uses a transformation and assigns the type of computer according to the rules in the truth table.
The last scenario in the truth table was not implemented. We will use OpenLexicon to add this scenario and rerun the process. This will demonstrate the simplicity and agility of the Intalio/OpenLexicon solution.
Populate OpenLexicon Repository
The project entitled ‘CodeDemo' includes the metadata needed to run this tutorial on the universal installer. If you have not modified that project you only need to install the OpenLexicon software
If you need to import OpenLexicon Metadata, there is a metadata extract, IntalioTutorial.xml that includes the logic for the truth table. If you are using another database or wish to use this import method then do the following:
- Create a database user for project
- Start the OpenLexicon Server and the OpenLexicon Wizard. If you are in a windows environment you should have a program group for OpenLexicon (LexiconEnterprise) in your start menu. The program group has items for starting and stopping the server and launching the OpenLexicon wizard.
- Define the database
- Press the button ‘Populate Cache from Extract'. Complete these steps:
Server Environment
The LexiconService has many ways to operate. It can run business rules from a cache file, or a database. The source of the OpenLexicon metadata can be easily configured in an Intalio process or it can be located in external system variable. We are going to use the simplest: a database identified by environment variables. You will need two environment variables:
LEXICON_USE_FAKE: This is a variable that permits a test of the Lexicon Web Service without running any business rules. Set this to a value of N.
TORQUE_PATH: This is the directory that holds you torque properties file. A copy of the Torque.properties file is included in the project export. OpenLexicon uses the Torque Project for object-relational data mapping in Java. The project is described here. However, the only thing you need to know is that the torque properties file provides the connection to the database that is needed for this tutorial. You can place this in any directory and set the value of TORQUE_PATH to this directory (i.e. C:\Torque).
If you are in a windows environment enter these in the system setup, advanced, environment variables tab.
Put a copy of the Torque.properties into the directory defined in TORQUE_PATH. You do not need to change this unless you have a custom database environment.
Process
Create an Intalio project, name this project: LexiconTutorial. From the zip (or from the imported project) Copy the files Employee.xsd, and LexiconConnectorService.wsdl into the project. The .wsdl defines the web service for the OpenLexicon rules engine. We will explain how to use this in the data mapping section. The .xsd is a data type for the message flows. It corresponds to the schema that the rules engine will evaluate.
Go to File > New > Business Process Diagram and create a new file "Transform.bpm" in your project. In this tutorial, we will assume that the project is called LexiconTutorial.
You may rename the first pool that is created. Here we will call the pool "Input". The Task shape should be named "Interface". Set the pool as non-executable by hovering over the pool and right-clicking on the pool.
Create another pool name it Transform. Create the activities.
- Create a Message Start Event in the pool. You may rename it "Start".
- Create a new Task and rename it "Invoke".
- Create a new Task and rename it "Results".
- Create an End Message Event. You may rename it End.
- Create links between each task.
- Connect the "Input" task from the "Dummy" pool to the Start Message. And connect the End Message to the "Input" activity in the "Dummy" pool
- Introspect the Employee.xsd. Drag and Drop the tns:Employee onto the message from the Input to the start message. Accept the "Set schema Employee as content of the message".
- DND the tns:Employee to the message from the end message to the Input Activity. Accept the "Set schema Employee as content of the message".
Your diagram should look like this:
Create another pool name it LexiconWebService. Set the pool as non executable. Add the call to the web service.
Introspect the WSDL LexiconConnectorService.wsdl. Introspect LexiconConnectorService, then LexiconConnectorServicePortSoap11port0
DND the LexOperation onto the LexiconWebService pool. Accept the first option from the menu as shown here:
Connect the Invoke Activity to the LexOperation and LexOperation to the Invoke Activity.
Your Process diagram should now look like:
Data Mapping
We will now connect the message flows to the web service and return the results to the Input activity.
Create Process Variable
- Open the data editor introspect on declarations under the transform button
- Hover over the declarations, right click and select create variable.
- In the dialog call the variable EmpVar
- In the right column of the Data Editor, Introspect the Transform, then the Name Space openlexicon.org/Employee
- The Data Editor should look like:
DND schema element tns:Employee onto the $EmpVar. This will resolve the issue. Your data editor should look like:
Define Mappings
- In order to access the truth table in our OpenLexicon project you will need to assign values to the operation. LexOperation. If you introspect the LexiconWebService, you will see that there are seven arguments that setup the call the OpenLexicon rules engine. These arguments define what rule should be called and what source of metadata should be used. Here are the seven arguments to LexService (You might wish to look at the arguments in the datamapper for the activity ‘Invoke'):
- Action: Type of Source of Cache (not used here)
- ActionType = the type of operation that OpenLexicon will take with this data. The domain includes ‘VALIDATE', ‘TRANSFORM' and ‘PROCESS'.
- BusinessObjectType= the name of the Business Object in OpenLexicon. This is the same name as the Business Objects in the OpenLexicon Wizard.
- CACHE_SOURCE (not used here) is a string that contains either the path of the open lexicon cache for or the name of the database in a torque properties file.
- ErrorType= a string that holds errors from OpenLexicon, if any.
- POJOType=the business object with data for a type of action (ActionType) (The web service takes this as an any:type).
- RuleSetName: The name of the ruleset that is associated with the action. These are defined at the business object level in OpenLexicon.
The service has been designed to give you access to any ruleset defined in the OpenLexicon repository. We will now map the input to the web service and assign the constants necessary for the process to work properly.
- Mouse click the ‘Invoke' Activity in the Transform Pool and activate the data mapper.
- Introspect the $xsdLexOperationRequestMsg.part1 on the right side of the data mapper.
- Perform Data Mapping:
- Place 6 operations onto the Mapper canvass associated with the Invoke Activity (use the "" values for now).
- Connect the constants to Action, ActionType, BusinessObjectType,CACHE_SOURCE,ErrorType and RuleSetName.
- Doubleclick the constants and set:
- ActionType = "TRANSFORM"
- BusinessObjectType='Employee'
- RuleSetName = "ComputerTypeTable"
- Connect $thisStartRequestMsg to the POJOType
- Your data mapper should now look like this (rearranged for readability):
Connect the output of the web service to the Variable. In the process diagram, select the results activity to open the data mapper for that activity. In the data mapper connect the $xsd1LexOperationResponseMsg.part1 POJOType to $EmpVar as follows
Mouse click the ‘End' message. In the output message connect the $thisStartRequestMsg.body to $thisStartReMsg.body, then connect $EmpVar ComputerType to the computer type in the response message. It should look like:
Deploy and Test
We are now ready to deploy and test this process. Select the deployment button and select only these files from the dialog:
If all is well, you should be ready to enter examples from the truth table.
Testing
Note: the OpenLexicon and Intalio server must be running for this test to work. If you are in a windows environment you should have a program group for OpenLexicon (LexiconEnterprise) in your start menu.
The program group has items for starting and stopping the server and launching the OpenLexicon wizard.
From the Intalio|Server console, start an instance of Transform: Enter values from the truth table at the beginning of this tutorial,
For instance the input:
Should result in the value of ENGINEERING_WORK_STATION.
If you test the process with the values Position= ‘EXECUTIVE', Department= ‘HUMAN RESOURCES' you will return no result.
You can add this rule by simply editing the rule ‘IsWorkStation'. Start the OpenLexicon wizard. The installer for OpenLexicon places a program group in your menu. Select the wizard program and it will start the wizard in your browser.
Select the project ‘CodeDemo' and click on the Tab Business Rules. Scroll down to the ‘Predicate' isWorkStartion and click the Edit Button and shown here:
By either typing or using the expression palette, add the expression or [isExecutive() and isHumanResources()] as shown here:
Please be certain to press the SAVE button to add the business rule to the truth table. Actually, we are manipulating a function in the truth table, so we do not need to do anything to the rule set associated with the business object.
Rerun an instance of the process with the values of EXECUTIVE and HUMAN RESOURCES in position and Department
note that there is no need to restart the Intalio Server when you do this. This change is a good demonstration of the power of externalizing rules.
