Home

Modeling Guide - Version 5.4

image

Contents

1. ccc cece cece nce e nee e nee eneeeneeeneeenseenseenseenseenseenseeneeenseenseeeseensees 121 A 21 POGING le EE 121 A326 DElEUING a NOE os ccewavesiccnacea secuinscndseneden oeduaveneen aes wecuinsendeen eden vedwnseansesasen eeeuinsendeeneden veewoseaeceness 121 4 3 29 Activating Deactivating a Rule Element ae deed 122 4 3 30 Navigating to a Specific Rule Element 122 AO Sie Undone NEE 122 43 32 Re EE E e 122 4 3 33 Displaying Externally Generated Statistics c ccc cece ccc eee ence ence enceeneeenesenseeneeenseenseenseenseensees 123 4 3 34 Changing Flow Rule Editor Preferences cc cece cece nce enceenseenseenseenseenseenseenseenseenseenseenseensees 124 4 3 35 Exponming a Rule as an MAS gedeien ee deen Eege deen Ee eg de 124 4 4 Working with Decision Tables nette tere neie Edel EA AE Ate Ee ag 125 44 1 Opening the Decision Table e Ire EE 125 4 4 2 Adding a new Decision Column or ROW ssssssssessssssssssseeeeeeessssssssseeeeeeesssssssseeeeeeeesssssssssreeeeee 125 AAS Eis ONIN MNS nt sancadncceoccs EEEE T hose rcconeaaddan nese EENE hese EAO EAEN 126 4 4 4 Adding a NEW Condition ccc cece ence ence ence ence eneeeneeenseenseenseenseeneeenseenseenseenseenseenseenseenseensees 127 AAS Addn EE EIER ee 127 4 4 6 Adding a new Assignment Column ccccccesceeceeeeens ees eeeeens eee ee esses eee eenseeseeeeenseeeeeaseeseeeeenses 128 Ek EGG an ASSIENMEN cessctdacecsitcqorcn dae niente
2. cccccceceescenseeceeeeenseeseeseeseeseeasenseeaeenss 171 4 11 24 Initializing Static Internal Data Elements 171 4 12 Organizing Rule Tests i Test Suites tee Eet 172 4 12 1 Creating a TESE SUING eege 172 4 12 2 Opening or Finding EE 173 Bosch Software Innovations GmbH x 270 Modeling Guide a os PACING StS EE 173 AA RENOVE TOO arer E EE EE EE EEE E EE ENE E E EE EE 174 AV EX COUE a TOS SUNG AE TE E E EE A 174 AAS Debugging TUNES egeeggeeertendeeg eegene 175 D ka Eeler E Age E 175 4 13 2 Debugging WC 175 Aloo SIC DOIMe TAUERN TEE 176 4 14 Searching Rule Model 178 EE Searching EEN Aen 178 4 14 2 Searching References to Elements 179 AAAS Working with the Search Egeter 179 4 15 Highlighting a referenced Element in the Rule Explorer cccceeceecceseeeseeseeeenseeseesensesseenens 179 AG Gon ane E EE 180 4 16 1 Comparing Rule Models and Rule Packages ccccesceccenceeeeeeseeseeseenseeseeseeseeseensenseeseeesen 180 a e COM ig EE 181 4 16 3 Working with the Compare View ccccescesceeceee eens ene eee eens eee eeseenseeseeaeeeseeeeesenseeseensenseeaeenss 182 D E Oe aa EDO E 183 4 17 1 Importing a Rule Model naire stadter SE e MAER EA Eege eh 183 ANY 2s EPONE HUI WOE EE 184 4 18 Generating Documentation MEET 184 AL Generating EE een 184 4 18 2 Viewing the Documentation eeeesesssssssssseeeeeersssssssseeeeeeeessssssssseeeeeeeesssssssseeeeeeeessssssssreeeeee 18
3. Figure 3 24 Debug perspective The debugger can be used to debug rule tests or rules running inside a Java application remote debugging Related Concepts e Section 3 22 1 Rule Test 83 e Section 3 22 2 Rule Test Editor 83 Related Tasks e Section 4 13 2 Debugging a Rule Test 175 Bosch Software Innovations GmbH 87 270 Chapter 3 Concepts Related References e Section 5 5 8 Debug View 227 e Section 5 5 9 Variables View 228 e Section 5 5 10 Breakpoints View 229 3 23 2 Breakpoint A breakpoint represents a specific location in a rule model where execution should pause during a debug session When rules are executed in the debugger and a breakpoint is reached execution will halt and present the current position and currently processed data to the user for inspection Breakpoints can be set at every rule element in flow rules or in every white cell of decision tables This can be done with the Toggle Breakpoint entry from the context menu LA Audit No 1 Special 7 Figure 3 25 Breakpoint on a rule element BONLUIS_CARD GOLD BONUS_CARD SILVER nt bonus_points banus_points 10 15 U 0 5 Figure 3 26 Breakpoint on a decision table cell Breakpoints can be temporarily disabled with the Disable Breakpoint entry from the context menu When a break point is disabled rule execution will not pause at that breakpoint The Breakpoint
4. B Copy Value rel Paste Value i Compare expected with actual results Expand Al Eb Hide Unused Elements 3 Select the cell to copy the value to 4 Press ctri v or select the Paste Value command from the context menu Alternatively you can use the mouse to drag a value from one cell to another Usually the value will be moved By pressing the ctri key while dropping the value it will be copied instead 4 11 10 Enabling Disabling Test Cases Test cases can be disabled When the test is executed disabled test cases will be skipped This helps to speed up testing while you want to concentrate on one or several specific test case 1 Select one or multiple test cases you can select multiple test cases by holding the Ctrl key 2 Right click on the selected test case s 3 From the context menu select the option Disable Test Cases This will disable the test cases and they are greyed out 4 in order to reenable test cases right click on it and select Enable Test Cases You can also choose the menu entries to enable disable not the selected test cases but all others This way you can for example easily disable all test cases except one 4 11 11 Duplicating Test Cases To duplicate an existing test case do the following 1 Select the test case you want to duplicate and click the LG button A copy of the selected test case appears in the list 2 Once again it s recommended to rename the test case and ent
5. Bosch Software Innovations GmbH 25 270 Chapter 3 Concepts a CG Movie Ticket Pricing Ee Movie Ticket Pricing Ei RK Input Output Data EG Input ES audtorium np Integer P tous Card BONUS CARD E coupon Boolean of seat no Integer et show date Date a GG student Boolean Ee Output la bonus_points Integer fea price Integer CES Constant Data D ga Actions Cl Data Types i Bonus Points S Discounts S Pricing K ruleproject vr Bas sl The contents of a rule model are usually subdivided into rule packages and sub packages This is to help organize all the different rule model parts e g rules data elements actions data types etc However it is also possible to not have any rule packages In that case all the elements are defined directly on the rule model which is the top level package Related Concepts e Section 3 3 Rule Package 26 Related Tasks e Section 4 2 1 Creating a new Rule Model 93 Related References e Section 5 5 1 Rule Explorer View 223 e Section 5 5 2 Project Explorer View 223 3 3 Rule Package Rules data elements actions and all other parts of a rule model can be collected into packages to help organizing large rule bases Rule packages are represented by this icon vi A rule model can contain multiple rule packages which again can have multiple sub packages each Consequently you can think of a rule model as a t
6. Volker noted at Thu Jan 03 10 54 36 CET 2008 his should be a separate alculation rule to be reused Advanced Bosch Software Innovations GmbH 44 270 Chapter 3 Concepts Related Concepts e Section 3 15 Description and Note 78 Related Tasks e Section 4 3 27 Adding a Note 121 e Section 4 3 28 Deleting a Note 121 Related References e Section 5 6 1 2 Notes Tab 230 3 5 14 Rule Element Deactivation Individual rule elements can be deactivated which means that they themselves and all elements attached to them will not be executed Deactivated rule elements are greyed out and a red icon is displayed Deactivation has the same effect as deleting the element and all its successors However it is often convenient during rule authoring and testing to not delete elements but to only temporarily deactivate them a Student discount 3 p E3 e Got a coupon Coupon discount granted Related Tasks e Section 4 3 29 Activating Deactivating a Rule Element 122 3 6 Flow Rule Editor The flow rule editor is used to view and edit a rule Most of the flow rule authoring process takes place here The editor is opened whenever you double click on a flow rule e g in the Rule Explorer Multiple rule editors can be open at the same time Bosch Software Innovations GmbH 45 270 Chapter 3 Concepts 2 Price_Calculation E des
7. Bosch Software Innovations GmbH 121 270 Chapter 4 Tasks Alternatively you can use the Properties view to delete notes 1 Select the rule element whose notes you want to delete 2 Inthe Properties view activate the Notes tab 3 Click on the button next to the note you want to delete Related Concepts e Section 3 15 Description and Note 78 Related References e Section 5 6 1 2 Notes Tab 230 4 3 29 Activating Deactivating a Rule Element 1 Right click the rule element that you want to activate deactivate and select the Activate or Deactivate menu item respectively 2 The element is activated deactivated Deactivated elements have a small icon attached and will be greyed out including all its successors Related Concepts e Section 3 5 14 Rule Element Deactivation 45 4 3 30 Navigating to a Specific Rule Element Every rule element within a flow rule has an ID a number that uniquely identifies it To find the rule element with a specific ID do the following 1 Make sure a flow rule editor is activated Press CtrI L 2 Adialog appears where you can enter the ID of a rule element A message is shown and OK is disabled when the entered ID does not exist in the flow rule 3 Press OK The rule element with the given ID is selected Related Concepts e Section 3 5 Flow Rule Element 31 e Section 3 4 Flow Rule 29 4 3 31 Undoing Changes You can undo indivi
8. 245 5 6 7 Actions The following properties tabs are available for actions 5 6 7 1 Actions Tab This tab is shown when a rule model a rule package a rule or an actions group is selected in the Rule Explorer It allows you to specify the actions available for the given context Bosch Software Innovations GmbH 248 270 Chapter 5 Reference properties 2 eae E EE ctions Actions EE kel Name Type Description E 23 Actions sch Log Log message ct Output Outpuk message es Write_ustomerToCsy Write CV File CRA be Figure 5 61 Actions tab i Initially all elements are collapsed This button will expand them so all elements are visi ble This only has an effect if there is atleast one element available Creates a new group This allows you to organize your actions pe Removes the currently selected action or group This column shows the name of the action element The first row shows the name of the element they are attached to You can edit cells in this column except for the one in the first row by double clicking them The type of the action element You can edit cells in this column by double clicking them The description for this row You can edit cells in this column by double clicking them 5 6 7 2 Action Settings Tab This tab is shown when an action is selected in the Rule Explorer It allows you to adjust settings specific to the selected action type that are comm
9. between 1 200 price 7 General seating i Audit No 1 General 5 between 201 600 price 5 J 1 weenst chen dakar Ke Palette Ka Kee i 53M of 71M D Figure 5 3 Debug perspective Related Concepts e Section 3 23 Rule Debugging 87 e Section 3 23 2 Breakpoint 88 e Section 3 6 Flow Rule Editor 45 e Section 3 8 Decision Table Editor 50 Related Tasks Bosch Software Innovations GmbH Walue E ea Ba o a False 1 2007 09 214 201 False cE ouire HN SEI he d sel L 4 ES d 199 270 Chapter 5 Reference e Section 4 13 Debugging Rules 175 e Section 3 8 Decision Table Editor 50 Related References e Section 5 5 8 Debug View 227 e Section 5 5 9 Variables View 228 e Section 5 5 10 Breakpoints View 229 e Section 5 3 1 Flow Rule Editor 205 e Section 5 3 2 Decision Table Editor 207 5 2 Wizards The following sections describe the wizard dialogs to create rule projects rule models rules etc 5 2 1 New Rule Project Wizard Use this wizard to create a new rule project New Rule Project Rule Project Create a new rule project Project name My Rule Project Use default location Location C Programme Visual Rules 4 0 workspace Browse Use default rule model name Rule model name My Rule Project
10. 25 e Section 3 4 1 Flow Rule Template 30 Related References e Section 5 2 3 New Rule Wizard 201 e Section 5 5 2 Project Explorer View 223 Bosch Software Innovations GmbH 97 270 Chapter 4 Tasks 4 2 9 Deleting a Rule 1 To delete a rule right click on the rule you wish to delete and select Delete from the context menu Alterna tively press the Del key 2 Visual Rules will ask whether you are sure you want to delete the rule Click on Yes 3 The rule is deleted When you delete a rule and save this change you may see errors in other rules that have previously used the rule that was deleted H you want to know up front whether there are other rules using the rule that you want to delete right click on the rule and select the Search References menu entry in the context menu The Search view will open and list all the rules that will be impacted by the deletion Related Concepts e Section 3 4 Flow Rule 29 4 2 10 Renaming a Rule 1 To rename a rule right click on the rule you wish to rename and select Rename from the context menu Alter natively press the F2 key 2 Adialog will open where you can enter the new name You must enter a name that is different from any other rule or rule package on the same level New Name Update references Cancel 3 Leave the checkbox Update References checked Otherwise all references to the rule will not be updated to re
11. Bosch Software Innovations GmbH 170 270 Chapter 4 Tasks Jr El Ey E D Percentages gt Times For example the following picture includes the display of percentages p So Auditorium No a a Audit No 1 Special 7 Special seating 3 3 37 37 Audit No 1 General 5 General seating 25 25 Special seating 3 37 General seating E 25 e EEN Related Concepts e Section 3 22 3 Statistics 84 4 11 23 Selecting a Configuration for the Rule Execution In order to select the configuration for the rule execution do the following 1 Open the Configuration tab of the test editor 2 Inthe drop down field Configuration for Rule Execution you can select a configuration for the rule execu tion By default there exists just the Standard configuration but for example there could be a customer specific configurations for test or production Configurations for the rule execution are created by the technical experts Please contact your technical expert to get information about your configurations 4 11 24 Initializing Static Internal Data Elements In order to define values of static internal data elements for the rule test do the following 1 Open the Global Test Data area on the Test tab of the test editor e Global Test Data Initial Data Setup 2 Click on Initial Data Setup to open the view for editing values of static internal
12. Compact E Assign Calculate values and update data Fire Action Fire an action Luxury i E Call Flow Rule Call another Flow rule Call Decision Table Call a CA decision table The car type is checked for the conditions compact luxury and other 2 2 3 4 Adding a new Assignment Insert an assignment after the condition for compact car type to calculate the price for this type 1 Select the Assign element in the palette by clicking on it iS EURent 3 R i E a AJ SE Palette Calculate rental charges E Select Compute base charge per vehicle type Calculate discounts per rental days 4 Zoom Update records CA Add Note Add a note E 3 Describe Branch Add 4 What is the car type description to a whole branch E Call Flow Rule Call another flow rule Call Decision Table Call a lt 3 decision table Decide Make a decision e Assign Calculate values and update data Fire Action A action 2 Now move the mouse over an existing element in the flow rule A black arrow will appear to show you where the new element will be added This can be either before after above or below the existing rule elements Ac cordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want Here to the right of the condition Compact igs EU Ren
13. Constant Data 247 5 6 6 3 Internal Data This tab shows a list of all the internal data elements defined on the selected rule model rule package or rule Bosch Software Innovations GmbH 245 270 Chapter 5 Reference E Properties i Problems Tasks El Console SS Navigator SS amp Internal Data Internal Data Advanced pa DI Mame Type Static Multiple Implementation Default Value E S CustomerRating E temporary Integer Ho No Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if there is at least one element available o pe C Inserts another element to a collection list or set This is only available when the selected attribute is a collection list or set Allows manually changing the order of the elements This is only applicable if alphabeti cally sorting f2 is turned off Converts the selected element to either Constant Data or Input Output Data This column shows the name of the input output data element The first row shows the name of the element they are attached to You can edit cells in this column except for the one in the first row by double clicking them Tye The The type of the data element You can edit cells in this column by double clicking them of the data element You can edit cells in this column by double The type of the data element You can edit cells in this column b
14. Figure 5 4 New Rule Project wizard O o O Project name The name of the project to be created The name must be different from any project that already exists in the workspace Use default loca If checked the project is created in the current workspace directory else a different direc tion tory may be specified Location This specifies the file system location where the project is created This can be edited if Use default location is unchecked Use default rule If checked the rule model will have the default name which is the same as the rule model name project Rule model name This specifies the name of the rule model created within the rule project This can be edit ed if Use default rule model name is unchecked Bosch Software Innovations GmbH 200 270 Chapter 5 Reference Related tasks e Section 4 1 1 Creating a new Rule Project 89 Related concepts e Section 3 1 Rule Project 25 5 2 2 New Rule Model Wizard Use this wizard to create a new rule model Rule Model Create a new Rule Model Enter or select the parent Folder My Rule Project fii amp G My Rule Project File name My Rule Model Figure 5 5 New Rule Model wizard oe Somme Parent folder This is the folder within your workspace in which the new rule model will be created You can browse the workspace and select the parent folder in the navigator below this line Enter the name of the rule model to be
15. cc cccc ccc e ccc enc eenteeneeeneeenseesseesseeseeesseesseesseesseesseeseeesseesseegseegeeesgeess 150 A oka Benine EE ee e ee 150 4 7 2 Defining Attributes Of a Structure 2 0 0 cece ccc cece ence enc eeneeenseeneeenseesseesseesseesseesseesseeseeesseesseegseeas 151 A 7 3 Denning Constants SEHR 151 4 7 4 Defining Super Types of a Structure ccc ccc cece cece cee eee eee eee eeeeeeeeeenseeneeenseenseeeseeeseeeseenseeesees 152 A 7 5 DeTIMING TYDE EE 152 Bosch Software Innovations GmbH ix 270 Modeling Guide A6 Deining a Tan Ee tee CN 152 4 7 7 Defining Literals of an Enumeration ccccc ccc eceeecent enc eeeeenseeceensenseeseessesseeaeestesseesessesseeanens 153 0 7 6 Demno IE XCO DUONG aeren a a aqadeeveaaaecrassncusema sca A E A OEA 153 4 8 Working with Actions eegene agedeelt egenen 154 El DEMMING ACION ee 154 4 8 2 Specify an Action Type for an Action cc cece cece ence cenceeenceeeceeeeteeeeeeeesseeesteeeseeenseeecseeesseeenges 155 Ek VV Obie W EIERE 156 49 1 Defining SCIWICCS eebe 156 A 9 2 Speciiy a Service Type for a SENICE EE 157 4 10 Working with Te 157 AWOL MISS tie Code EE ee 157 4 10 2 Hyperlinking c ccc cece cece nce ne cence ence enseeneeenseenseenseenseenseenseenseenseenseenseenseesseesseesseesseesseeeeess 159 Eh Working With AUtO CCAM ee EE 159 Bl MESHES E 160 ALAA RE CC E 161 4 11 2 Opening a Rule Test lt lt 5as lt ereenceseeratacnesentanddesovaveseoe
16. 101 Related References e Section 5 6 5 1 Reuse Packages Tab 241 3 4 Flow Rule A flow rule is a graphical representation of logic consisting of computations decisions actions and possibly oth er elements Every flow rule captures a specific part of the overall business logic of a system Flow rules can be very small e g when they make a very specific decision based on only a few facts Flow rules can however also be rather complex when they have to make many decisions and computations based on a lot of data Writing com plex rules is usually achieved by aggregating simpler rules into more complex rules For this purpose every flow rule can reuse other flow rules or decision tables when appropriate Every flow rule has a name that identifies it All rules including decision tables in a rule package must have differ ent names so that each rule can be uniquely identified by its name and package Rules can have the same name if they are located in different rule packages Bosch Software Innovations GmbH 29 270 Chapter 3 Concepts The Pricing rule determines the price for a movie ticket on the basis of parameters entered Which seat seat_no Special seating between 1 200 General seating between 201 600 General seating S 5 Day of week weekDay show_date weekend ms eg in 46 7 Weekend surcharge pric
17. 3 When you see a black arrow click again and the new flow rule element will be inserted 4 Insert the description Discount on rental granted for the action element The drafted flow rule should look like the picture below Bosch Software Innovations GmbH 12 270 Chapter 2 Getting Started E What is the car type Price is 50 per day a Is it a premium customer 5 Price is 60 per day E Discount on rental granted Save your rule by clicking the Save button lal in the toolbar You can also press Ctrl S 2 2 4 Task 4 Finalize Your First Flow Rule Now you have described a rule and defined what elements you need for the calculation It is time to finalize your rule and insert the expressions that should be executed during the rule execution 2 2 4 1 Enabling the Content Switch on the display of the flow rule element contents Activate the Contents entry in the drop down menu of the View toolbar button Now the contents of the flow rule elements are also shown EES vw Descriptions Contents LA Notes Tooltips L Empty Descriptions Content F Hover Palette lt 2 Palette Select Q Zoom 1 Add Note Add a note Describe Branch Add a description to a whole branch Decide Make a decision Assign Calculate values and Price is 50 per day update data Fire Action Fire an action Call Flow Rule Call another Flow rule Is it
18. Audit No 1 General 5 Palette Ke Ke Rule Context E EN 53M of 71 DN 2 The Variables view allows you to inspect the current values of the data elements J variables e Name DS Input K auditorium_no 1 fa bonus_card i coupon False i seat mp 100 fg show date 2007 09 21 student false E Output i bonus_points i price 3 The Debug view displays a list of the rules and rule elements that have been visited so far The buttons in the view toolbar are used to control the debug session Most buttons also have a function key shortcut Press the F5 key to step forward from one rule element to the next Press the F6 key to step over the remaining elements in a rule branch and then halt again Press the F8 key to resume execution until it hits another breakpoint If you don t want to continue debugging click on Terminate This will immediately terminate rule execu tion and the debug session If you are debugging remotely you can use Disconnect to end the debug session and resume normal execution of the rules Related Concepts e Section 3 23 2 Breakpoint 88 e Section 3 6 Flow Rule Editor 45 Bosch Software Innovations GmbH 177 270 Chapter 4 Tasks e Section 3 8 Decision Table Editor 50 Related References e Section 5 5 8 Debug View 227 e Section 5 5 9 Variables View 228 4 14 Searching Rule Models Vi
19. Bosch Software Innovations GmbH 54 270 Chapter 3 Concepts K Select A Zoom L Add Note Add a note B State Add a State Ej End State Add an End State Ei Transition Make a Transition Figure 3 13 State Flow Editor palette 3 11 2 State Flow Context Palette The state flow editor has a palette which displays the data elements that the state flow can access The palette gives quick access to all these items so that the state flow author does not have to continuously switch to the Project Explorer This is especially useful when the state flow editor is maximized Depending on the state of the al toolbar button the list only shows the elements defined and owned by the state flow itself or all elements in the rule package hierarchy or being reused All elements can be edited by double clicking them A single click on a selected item allows it to be renamed Ele ments can be created and deleted using the corresponding and buttons The palette can be collapsed and expanded by clicking on the small black arrow in the title bar of the palette Jag lA kal K Input Output Data g dateofpurchase Date g orderdate Date g price Float g value Float Figure 3 14 State flow Context palette 3 12 Expressions Expressions are at the core of all rules in Visual Rules Expressions are used to define the conditions used for de cisions and the formulas used for computations and for many other things Almost every
20. Customer s birthday customer birthdate i Lee currentDatei Send birthday greetings An action may require additional information to perform its task For example sending an email requires the email addresses of the sender and the recipient a subject line and the text for the email body The exact data that is needed for an action is determined by the type of action fired When you double click a Fire Action element in the rule editor you can view and modify that data on the Fire Action tab in the Properties ENE Fire Action 12 l Fire Action d Description Fire Action Email G Notes From Fmarketing acme com To kustomer email Subject FACME Newsletter Text Dear amp customer greeting amp ere is the ACME newsletter for August 2007 Related Concepts e Section 3 16 Action 79 Related Tasks e Section 4 3 12 Editing a Fire Action Element 114 e Section 4 8 Working with Actions 154 Related References e Section 5 6 2 4 Fire Action Tab 234 3 5 4 Call Flow Rule Call Flow Rule elements are used whenever a flow rule wants to reuse other flow rules The called rule is exe cuted and afterwards processing continues after the Call Flow Rule element Rules are only allowed to call rules from the same package from any subpackage and from any package that is defined to be
21. Gi visual Rules Integration E visual Rules Java GE Visual Rules Java Generator QP Visual Rules Java UI G visual Rules JOT Integration GE visual Rules Model Access GD Visual Rules Runtime G Visual Rules Search Gk visual Rules Security visual Rules Testing Q Visual Rules UI bik visual Rules Validation G visual Rules Version 3 Model Import G Visual Rules Documentation Gener 4 2 2 ve0030826 1 748 4 2 2 2OR0826 1 745 4 2 2 We0000826 1 M45 4 2 2 ENEE Ke 4 2 2 ve0080826 1 748 4 2 2 20080826 1 748 4 2 2 20000826 1 743 4 2 2 Ve0030826 1 743 4 2 2 ve0080826 1 748 4 2 2 Ve0080826 1 748 4 2 2 Ve00g0826 1 745 4 2 2 v20030826 1 743 4 2 2 ve0080826 1 748 4 2 2 veu080826 1 748 4 2 2 20000826 1 743 4 2 2 2008 So 1 Md 4 2 2 WeOOs0828 1 745 4 2 2 Ve0080826 1 748 4 2 2 e00008 26 1 749 4 2 2 Ve0000820 1 M4 4 2 2 ve0030826 1 743 4 2 2 Ve0080826 1 748 4 2 2 V20080826 1 748 4 2 2 20090826 1 748 4 2 2 ve0080826 1 743 4 2 2 ve0080826 1 748 4 2 2 20080826 1 748 4 2 2 EE d Ee CH Usage Of Content THE ECLIPSE FOUNDATION MARES AVAILABLE SOFTWARE DOCUMENTATION INFORMATION SND OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS COLLECTIVELY CONTENT USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT ANDOR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW BY USING THE CONTENT YOU AGREE THAT YOUR
22. If you wish to get a new version of Visual Rules please apply Software Updates in the Help menu There are two ways to update Visual Rules one way is to use Available Software and Install or the second way is to use In stalled Software and Update For the second way there is the possibility to automatically get a notification about new Software Updates by configuring this feature as shown below The shown mechanism refers to Eclipse 3 4 and higher for Eclipse 3 2 and 3 3 the mechanism is rather similar First way to update Visual Rules with Available Software 1 Use the Help gt Software Updates menu entry to update the current version of Visual Rules Bosch Software Innovations GmbH 190 270 Chapter 4 Tasks Welcome F Help Contents oe Search Dynarnic Help key Assist Ctrl ShiFk L Tips and Tricks Cheat Sheets Visual Rules License Management J Visual Rules Support Request Software Updates About visual Rules Modeler 2 Select from Available Software the following update location http Awww download visual rules de vr update with the current update version of Visual Rules and click on Install Software Updates and Add ons Installed Software Available Software type fiter text Mame aT d http idownload eclipse org releases ganymede Lei ai https ve download visua rules defvrfupdate 7 000 Visual Rules
23. Rule Modeling Perspective 197 e Section 5 1 2 Rule Integration Perspective 198 4 20 2 Customizing Perspectives and Views A perspective consists of different views that are arranged in a specific way to make best use of the screen estate The views are surrounding an area where editors appear like e g the rule editor or the test editor Bosch Software Innovations GmbH 187 270 Chapter 4 Tasks Rule Modeling Movie Ticket Pricing Movie Ticket Pricing Pricing vrrule Visual Rules Modeler E mfx Fie Edit Navigate Search Project Run Window Help 3 Ci E Kl CG L bel DS Al Rule Integration of Ba Ste 8 aa CN Q ESCH E La Rule Modeling Rule Explorer ei Se IS Pricing a m Bi Bl 1 Palette The Pricing rule determines the price for a movie ticket on t Is E Movie Ticket Pricing Select Sif Movie Ticket Pricing Zoom GS Input Output Data 7 Add Note Add 1 EE Constant Data a note E Gei Actions A Describe Package Branch Add a description to a Packagel whole branch auditorium_no Discounts gt Decide Make a decision e Assign Calculate values s S The movie theater has three auditoriums of different sizes a The base price for a movie is dependent on the size of them f A weekend surcharge is calculated for the two large movie a fe The small movie auditorium has a constant admission price Rule Content Auditorium No Se Pri
24. You can also open the Flow Rule Editor for a flow rule that is referenced in a call flow rule element To do so press the Ctrl key and click on the relevant reference in the Flow Rule Editor Related Concepts e Section 3 6 Flow Rule Editor 45 e Section 3 4 Flow Rule 29 Related References e Section 5 5 2 Project Explorer View 223 4 3 2 Saving Changes 1 When you do any changes to a flow rule the tab of the flow rule editor will show an asterisk right in front of the flow rule name To save the changes made in the current editor press the Save button E on the toolbar This button is only enabled when changes were made Alternatively you can press Ctrl S or select the File gt Save menu item If you want to save all unsaved changes and not just the changes made in the current editor you can press Ctrl Shift S or select the File gt Save All menu item Related Concepts e Section 3 6 Flow Rule Editor 45 Related References e Section 5 5 2 Project Explorer View 223 4 3 3 Navigating in the Flow Rule Editor 4 3 3 1 Keyboard Navigation e Use the arrow keys up down left right to navigate from one rule element to the other Bosch Software Innovations GmbH 104 270 Chapter 4 Tasks e Press Alt Cursor down and Alt Cursor up to enter and navigate inside a rule element e Press F2 or simply start typing to start inplace editing 4 3 3 2 Scrolling There ar
25. but was UU element inout type Any Test Suite Configuration Figure 5 17 Test Suite Editor Test Suite ed Description itor element se Add another test This can either be a rule test or a nested test suite Delete the selected test Only available for top level tests Move the selected test one position up Only available for top level tests Move the selected test one position down Only available for top level tests Execute the test suite This will execute all tests one after another updating the progress bar and the failure messages table d Execute the test suite in debug mode Test execution will halt when a breakpoint is reached e Open an editor for the selected rule test Bosch Software Innovations GmbH 213 270 Chapter 5 Reference Test Suite ed Description itor element fe Shows the corresponding result file in the rule explorer Clicking here will open a text field where you can enter a description for this test suite Test Description Clicking here will open a text field displaying the description for the selected test In order to edit it the test s editor can be opened by double clicking Related Concepts e Section 3 22 Rule Testing 82 5 3 6 Rule Project Editor The rule project editor is used to edit the contents of the ruleproject vr file Here you specify the rule project iden tifiers and the rule project dependencies Project Information Dependencies be
26. fisi second Time time Integer its secondi Timestamp timestamp Integer fist selecti Any Collection collection Any expression lt Select the searched item from the list It is now inserted in the expression Code assist provides color syntax highlighting for specific known parts of an expression such as internal data ac tions etc Unknown words are not color highlighted This is how you can recognize that the expression is faulty Which seat Code assist provides support for entering functions and their parameters When selecting a function the descrip tion of the function with its function parameters are displayed automatically Example of code assist when using the function round Number value Zeg Weekend surcharge one rou d fix roundiEloat value Integer Rounds a number to the next integer ite round Float value Integer precision Float pararta value Value to be rounded Examples round Lies 2 roundiz 5 3 roundis 3 5 roundi5 499 5 If you activate code assist Ctrl Space without first entering characters a list of all available data elements func tions etc opens up When you now begin to type the selection is reduced to those items beginning with the let ter typed In the example above the code assist selection is already unique after typing two letters ro Press the Enter key to paste in the function round The function round expects a
27. re Times With the navigation in the statistics view you can focus on the statistics for a specific test within a test suite or a specific test case within a test Related Tasks e Section 4 11 22 Creating and Configuring Statistics 169 e Section 4 3 33 Displaying Externally Generated Statistics 123 Related References e Section 5 5 7 Statistics View 227 4 3 33 Displaying Externally Generated Statistics It is possible to display statistics files which are generated outside the Visual Rules Modeler To display such a statistics file do the following 1 Open the Project Explorer and paste the statistics file directly into a project or any sub folder you like The Project Explorer shows the name of the entry rule as well as the creation date and time of the statistics file Only statistics files with the file extension vrstatistic are recognized as Visual Rules statistics file 2 Double click on the statistics tree item to activate the statistics activated statistics are marked red fei Project Explorer 7 amp lsclalz gd Movie Ticket Pricing SS Pricing Jun 22 2009 10 44 36 AM Ge di Pricing Jun 22 2009 11 38 14 AM e dh Pricing Jun 2 2009 11 38 26 4M Si E vr srcgen H A JRE System Library eclipse El BA Visual Rules Dependencies S E ruleproject wr Bosch Software Innovations GmbH 123 270 Chapter 4 Tasks Related Tasks e Section 4 11 22 Creating and Conf
28. Action Expected Result Actual Result false a Discount_Granted Standard 2 3 4 Task 4 Specify a Second Test Case Create another test case for the rule where you test the calculation for luxury car and discount granted 1 Add a new test case to the test by clicking the green plus sign in the toolbar of the Test Cases area Test Cases Fits War JL E D OO pa Test Case x 2 Anew test case is added Test Cases fo Mi tb F Test Case Description You can insert a test case description if you expand the Test Case Description field at the top of the list Additionally you can also rename the test case itself by double clicking it Test Cases dh CG WR o db Oe Su On SCH RK Test For discount granted 3 Insert the test data and the expected result values in the same way than for the first test case Use the follow ing values Test Data Input D P gt x Input Data Value E Car_Type Any E7 Dremtum Customer Any E Rental_Days Any luxury true Bosch Software Innovations GmbH 21 270 Chapter 2 Getting Started Expected result for output data element Output ege ema wg SI i Output Data Expected Result Actual Result 108 fea Price Any Expected result for action Output Glo le zl wg ae Action Marie Expected Result Actual Result Discount_Granted Standard true 2 3 5 Task 5 Execute the Rule 1 Click on th
29. CRLF Ke Character set Windows 1252 e Write column names Figure 5 69 Write CSV File Action tab SC Action Enter the name of the action Enter the type of the action Code Assist Ctrl Space is available Filename Enter the file name of the CSV file that will be written Overwrite existing Check this option if you want every output to overwrite the existing file When this option file is not checked the output is appended Field separator Enter the separator that should be used between the columns Bosch Software Innovations GmbH 253 270 Chapter 5 Reference O om O a Quote character Enter the character that will act as a quotation start end identifier Line Separator Choose the line separator You can choose between CRLF which is the Windows line separator LF the Unix line separator and CR the Mac line separator Character set Choose the character set that you want the file to be written with Check this if you want the column names to be written as the first row in the CSV file names Column name This column shows the column names You can edit cells in this column by double click ing them Adds another column ao Removes the currently selected column Moves the currently selected column up one position within the list Moves the currently selected column down one position within the list The corresponding Fire Action tab is shown when an invocation of the action is selected in the rule editor Here
30. DE ee DR E EE 48 3 7 1 Conditi n COMIN ROW sescccusvesinvecanaccrscwseacdawobenandwedoakdeseseodeduawenebanadeessausdoamdeecpensbedweecebasedeoacewms 49 e REETZ le E 49 E E e ein e EE 49 1 4 ee lei Ee Et WEE 50 26 JDCCISIOn Wale le EE 50 3 6 DeCisiom TaN Editor EE 51 3 8 2 Decision Table Context Palette lt lt s2 cutncsatdecnodenateastendgeuenesadiecseadbasetemessentondqaspecsecieasetctesaiaweanden 51 Oo late EE 52 KEE IOW GE EE 53 SEO My SEENEN 53 AO ENO EE 53 710 Mee O EE 53 E Mam SIMON RUNG aerer nea EE O EE E EEEE EEEE E EE ESEE 53 A A del T E 54 S tate Fow EION E 54 Salles e FON EGON EE 54 Bosch Software Innovations GmbH iv 270 Modeling Guide lil ee FON eE EE een 55 e Gelee aE E EE EE E EE E E E N EE TEE EA 59 GEERT een 56 3 12 2 String Concatenation Operator amp cccccccesccceesnceceesceceessceeessceeeessseeeesseeeesaseeessseeesssseeessseeesees 57 3 12 3 Embedded Expressions Mm a SIINE Sege tere EE ee 57 3 124 C mparison OPEratorS ssesrssriisesertisesrosrsssidir iskesti ns ror USE ENNES NEEN ENEN ESEVE EENEN EEEREN EE EEEN ES 57 S125 tee O A OR E 57 3126 Baie QUOC AION EE 58 E 7s Calle Die terre CN 58 L2 BACE NE AMDOS eessen eenegen 58 EE LISE EE 59 Pile NO eg 59 re H a OPO EE DU GE EE e liste AAA AI nissan hose A atin E A T A A T 60 EE e DU 3 12 14 Collection Operators cece ccc cece ese c ence cence cenceeenceeeceeeesseeesseeeeeeeeeeeeeseeesseecsteeneteeceeeesseeenees 60 a2 15
31. Related Concepts e Section 3 6 Flow Rule Editor 45 e Section 3 8 Decision Table Editor 50 Bosch Software Innovations GmbH 198 270 Chapter 5 Reference Related References e Section 5 1 1 Rule Modeling Perspective 197 e Section 5 5 2 Project Explorer View 223 e Section 5 5 3 Problems View 224 e Section 5 5 6 Properties View 226 e Section 5 5 4 Outline View 225 e Section 5 3 1 Flow Rule Editor 205 e Section 5 3 2 Decision Table Editor 207 5 1 3 Debug Perspective The Debug perspective is used during rule debugging It contains the views Debug Variables and Breakpoints and is activated automatically when rule execution hits a breakpoint during a debug session Debug Movie Ticket Pricing Movie Ticket Pricing Pricing vrrule Visual Rules Modeler File Edit Navigate Search Project Run Window Help fhe 2O 4eax ilo A a A laps h e S O G i aosi iA Hr Wes J variables 23 ze D BR e ZZ Ga Name Pricing Testertest visual Rules i coupon age de visualrules rulerunner RuleRunner at localhost 2628 K auditorium_no ER main E show date 0 Condition 11 C3 seat_no gt Decision G student 0 Condition 10 i bonus_card O Decision 7 E price HS Pricing i bonus_points w CAProgramme Javaljdkl 5 0_12 binijavaw exe May 15 2008 10 57 09 AM h seat_no 4 b Special seating per Audit No 1 Special 7
32. Related Concepts e Section 3 7 3 Action Column 49 Related Tasks e Section 4 4 13 Editing an Action Column 132 Bosch Software Innovations GmbH 131 270 Chapter 4 Tasks e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 13 Editing an Action Column In order to edit an action column header do the following 1 Double click on the cell in the decision table This will open the inplace editor 2 Specify the action that should be fired depending on conditions seat po BETWEEN 1 200 auditorium Do eons sere special seating J j Action bonus points F 3 Press Enter to close the editor or click with the mouse outside of the editor 4 Select the action column header and open the Properties view 5 Insert the action specific Fire Action settings In order to specify in which cases the action should fire or not do the following e Double click on a cell in the action colum or press the Space key This will toggle between a small cross x and a dash The action will be fired for those cells that contain a cross BETWEEN 1 200 special_seating special_seating special_seating pet da Je Ja J Ja C E je Ja ee e R CE CCC OC Related Concepts e Section 3 7 3 Action Column 49 Related Tasks e Section 4 4 12 Adding a new Action Column 131 e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 14 Adding a
33. Rule Integration Perspective The Rule Integration perspective is meant for developers who integrate rules into an application connect rules with existing object models or extend Visual Rules with additional functions or actions In other words this per spective is used for all the technical tasks All the technical properties tabs and settings are availabe here but are hidden from view in the Rule Modeling perspective Rule Integration Movie Ticket Pricing Movie Ticket Pricing Discounts vrrule Visual Rules Modeler Fie Edit Wavigate Search Project Run Window Help io BBi O Q igaVih ee o iOS le BB x Lo Saaolelclcl eia P Project Explorer 2 O Da Discounts 3 ES emm jn H jc Execute Command Action A ES Movie Ticket Pricing 2 ER Movie Ticket Pricing ER Input output Data a Constant Data ER Actions a Data Types CR Bonus Points 2 off ER Input Output Data a ae Rule Tests 2 ie S Discounts 23 Pricing ae Rule Tests D A vr sregen Gs JRE System Library eclipse A Visual Rules Runtime Library ae bin DIS Movie Ticket Pricing Java Client Da Rule Execution API Example E N Erie oon ee ec h k S Palette ie Rule Context price price student_discount DS Tutorial Database Assignments Description Data Element Operation Expression E price price student disc Figure 5 2 Rule Integration perspective
34. Service 81 e Section 3 20 Service Type 82 Related Tasks e Section 4 9 1 Defining Services 156 4 10 Working with Expressions The following sections contain step by step procedures for different tasks for working with the Visual Rules Model er 4 10 1 Using the Code Assist Code assist helps you when entering expressions You can activate the code assist in any field where a expres sion is expected as input You activate code assist via the Ctrl Space key combination Code assist is context sensitive and displays all available data elements actions functions and operators with their description at the current cursor position Bosch Software Innovations GmbH 157 270 Chapter 4 Tasks For example if you insert the first character s of the searched item and then activate code assist the following will be displayed Which seat eg G seat no Integer A Number of seat in auditorium d GG show date Date E E student Boolean zs Et student discount Integer special seating Standard 4 E student discount _granted Standard fiy secondi Timestamp timestamp Integer ft second Time time Integer Iw selectiany Collection collection Any expressio s lt if 3 Insert a further character of the searched item in this example an e The number of code assist choices is re duced Which seat 3 Fe seat no Integer Number of seat in auditorium
35. Task 2 Define Input Data for the Test Case 20 2 3 3 Task 3 Define Expected Results for the Test Case 20 2 3 4 Task A Sp ecify a Second Test e 21 PGs E Execute Me TEEN 22 2 3 6 Task 6 Inspect the Results of the Test Cases cc ccc cccc ccc enceeenceeenceeeneeeenseeeseeeeseeeesseeesseeesseees 23 2 3 1 Task 2 SNOW Statistics Of EE 23 3 een CC 2O o PRN E 25 3 2 UIC MOOG TEE 25 I RUE PACKE ne ee ee ee ee ne ee eer eee ee eee 26 Soy RWS Package EE 28 Bosch Software Innovations GmbH iii 270 Modeling Guide SR FOW EE 29 SAL Flow Rule el emie reegen e EE ENEE Ee 30 Oro FRON RUG Ele LEE 31 iD As WICCISION EE 33 Sethe IMIDE AS CISION ee 33 3 5 1 2 Multiple condition CECISIONS cc ccc cece ence est eeneeenteeseeeseeeeeeseeeteeteesteesseeeteeeeeteeteeseeeseeeges 33 2 541 3 ee ee O O O DE Ferree Ere E EE E EE EE E E E E 35 CREPE E SEA E EE 35 3 5 2 1 ADD REMOVE and CLEAR Assignments sded uggee EEN Nee ERER EEN eege ENNEN 36 E 1 IS AC O E 37 SE D C LOW ROIG center E res seater agenesis dda A E EE 38 e Call DECISION Eegeregie 39 EE EE 40 aa DONS IN EE 40 TCS Ge 40 3 5 9 End Repeat oicceesesacsesnescawaeneandocnesnsaesanse deseomaueesesbondosennssacbnntaedbeensenaagusesedesuesss ebesteesoeesuensnsses 42 O RE E CEO EEN 42 SLAs Aande e EE 43 S942 B EDE le e EE 44 e EE 44 SE E ule Element DEAC IVAO DEE 45 O26 PIOW FUNC EAO E 45 SO Te RUE Een Pale enee 46 3 6 2 R le Context Paletta eebe 47
36. The Usage Matrix Editor is used to analyze the usage of elements within a rule project For each data element action etc within a rule project it shows in which context it is used and how many times it is used there Here also those elements can be considered which are defined outside of the rule project i e in other projects or libraries which the rule project depends upon 2 lt Palette Description gt Select Last update 5 20 11 10 22 AM Q Zoom amp Update Update Usage Matrix Show g Input Output Data g9 Internal Data amp Constant Data Actions ge_added ge BONUS_CARD student_discount_granted coupon_discount_granted bonus_points coupon_discount gt student_discount weekend_surchar general_seating special_seating weekend_surchar en auditorium_no ez coupon sn show_date money spent es seat_no w student amp Data Types Number of affected not GS Attributes empty cells in the row column Je Je Je Iv Je Iv Movie Ticket Pricing gt bonus_card x a Consider Dependencies Consider usage of elements defined outside of the project Movie Ticket Pricing Fi Bonus Points 8 Discounts 8 Pricing ENAME 3 Movie Ticket Pricing Bonus Points Figure 5 20 Usage Matrix Editor Related Tasks e Section 4 1 4 2 Visualizing the Usage of Elements within a Rule Project 93 5 4 Dialogs The following
37. USE OF THE CONTENT 15 GOVERNED BY THIS AGREEMENT AND OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OF REFERENCED BELOW THEN YOU MAY WOT USE THE CONTENT Applicable Licenses Unless otherwise indicabed al Content made available by the Ecipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1 0 CEP A copy of the EPL is provided with this Content and is also avaiable at http www eclipse arg legal ep v10 homl For purposes of the EPL Program wil mean the Content Content includes but is mot imited bo source code object code documentation and other files maintained in the Eclipse ong CVS reposihory Repository in CVS modules Todules and made available ss downloadable archives Downloads Content may be apportioned into plug ins Plug ine plug in fragments Fragments and features Features 4 Feature is a bunde of one or more Plug ins andior Fragments and associated material Files named Teature vm may contain a list of the names and version numbers of the Alug ins andor Fragments associated with a Feature Plug ins and Fragments are locabed in drechories named plugins and Features are bocahed in Vier Common Core 3 0 2 v2008
38. Visual Rules switches to the Debug perspective that lets you step through the rules see Section 4 13 3 Stepping Through Rules 176 Related Concepts e Section 3 22 1 Rule Test 83 e Section 3 22 2 Rule Test Editor 83 e Section 3 23 1 Debugger 87 e Section 3 23 2 Breakpoint 88 Related Tasks e Section 4 13 1 Setting Breakpoints 175 e Section 4 13 3 Stepping Through Rules 176 Related References e Section 5 5 10 Breakpoints View 229 4 13 3 Stepping Through Rules 1 When rule execution reaches a breakpoint during a debug session Visual Rules Modeler will switch to the De bug perspective and show the current position in the flow rule editor or the decision table editor Bosch Software Innovations GmbH 176 270 Chapter 4 Tasks gt Debug Movie Ticket Pricing Movie Ticket Pricing Pricing vrrule Visual Rules Modeler File Edit Navigate Search Project Run Window Help n He 9O t ee x o QQ mA dn lo SP ho a amp O GQ 8 8e on F See S J Variables ES Name Value E Pricing Test vrtest Visual Rules i coupon False Gee de visualrules rulerunner RuleRunner at localhost 7626 E auditorium_no 1 ER mair i show_date 2007 09 214 0 Condition 11 e seat_no 201 CH Geier 4 i student False 6 Condition 10 i bonus_card Decision 7 i price E bonus_points F Ke Ka _ _ Special seating C Audit No 1 Special 7 EE
39. auditorium_no Integer coupon Boolean seat no Integer E show date Date ae ES student Boolean px Output a g Constant Data E coupon_discount Integer j student discount Integer eii weekend_surcharge Integer ER Actions d GG coupon_discount_granted Standard d L general seating Standard z DN special seating Standard ba student_discount_granted Standard et weekend surcharge added Standard 3 Discounts S Pricing 3 Deactivate this option by clicking on the icon again Bosch Software Innovations GmbH 148 270 Chapter 4 Tasks Rie DS E E Movie Ticket Pricing El Movie Ticket Pricing E RK Inpuk utpuk Data o B Input BP auditorium_no ES coupon ES seat pp eG show date i E student LS Output E SCH Constant Data CA Coupon discount of student_discount i CA Weekend_surcharge g ex Actions GG coupon dscount Oorarted general seating td special seating et student_discount_granted bod ci weekend surchargoe added ba Discounts 2 Pricing Related Concepts e Section 3 14 Data Type 71 e Section 3 17 Action Type 80 4 6 14 Creating Groups Groups can be created in any data element and action folders These are not important for code generation and are used only to make logical arrangements They are not subject to the naming convention applying to other data items and they can be created more than once using the same
40. in a flow rule element you first need to dou ble click on that field The Inplace Editor will open and thus the reference will be accessible 4 16 Comparing Rules 4 16 1 Comparing Rule Models and Rule Packages There are two possibilities to compare rule models or rule packages Compare With History In order to compare one rule model or rule package with its history do the following 1 Select the rule model or rule package you want to compare with its history 2 Right click and select Compare With gt History from the context menu 3 A History view opens that shows the changes along with the date and time of each change mge 3 amp TJeilielen ely o Se Se oy Pricing vrmodel E Revision Tags Revision Time Author E e Today E H 1 21 3 10 08 11 35 AM E as 3 10 08 11 34 AM a B 3 10 08 11 19 AM EEE a E H This Month i708 3 01 PM 3 7 08 2 53 PM z 3 7 08 2 19 PM A SII 2415 PM EH d iili gt ko H Enter search berm Compare With Each Other To compare two rule models or rule packages with each other do the following 1 Select the two rule models or rule packages you want to compare with each other 2 Right click and select Compare With gt Each Other from the context menu 3 The Compare view opens and the changes between both rule models or rule packages are displayed Bosch Software Innovations GmbH 180 270 Chapter 4 Tasks EE y npare Long Mo
41. programs Save lance Figure 5 26 Compare Results Dialog Desen KE ee eme O O C Jumps to the previous individual change 5 4 7 Select Dependency Dialog The Select Dependency Dialog is used to select and add dependencies to a rule project The dialog is accessi ble via the Rule Project Editor The Select Dependeny Dialog lists all rule projects in the workspace and all li braries that are known by Visual Rules like the Visual Rules Runtime library New currently unknown libraries can be added by clicking the button Other Bosch Software Innovations GmbH 221 270 Chapter 5 Reference Select Libraries Type Filter text si Libraries 1 AT Arm fad General AT Any AT_Anyi 4T_Any 1 0 e L DEET Group Id AT_Any rule Project A E Rule Project E Artifact Id AT Ap rule Project version 1 0 1 Commons Collections Rule Models AT_any ci a 3 im 3 Li Gs D a D ia _ JavaBeans Activation Framework JAF LOCH E lo o Gr O D OD J SECH F 0 kA ICH wie d i u P Hoe cu kd _ Commons Collections commons Lang Commons Parent J ri o 3 oO 3 Wi a wu e o a a C JavaBeans Activation Framework JAF JavaMail AFI _ JavaMail AFI distribution Ji Ici E D fa IS a fa St r Ln CT Ex Ko Ex a eS E L gu Du ch _ Visual Rules Database Connectivity Runtime Visual Rules
42. 13 Data Rules need data to perform their tasks Every rule in Visual Rules clearly specifies the data that goes into the rule input data and the data that comes out of the rule as a result output data Additionally a rule may define data that it uses internally only internal data and constant data Data can be defined in different locations within your rule model The best way is to define data on the rule lev el meaning that all data elements defined there are only visible to that specific rule Input data and output data Bosch Software Innovations GmbH 67 270 Chapter 3 Concepts defined on the rule level clearly indicate what data will go into that rule and what the results will be When rule A is called by another rule B rule B will have to specify values for all input data defined for rule A Rule B will after wards be able to read any results from the defined output data of rule A Other possible locations for data definitions are rule packages or the rule model itself Data defined on a rule pack age is shared by all the rules in that package and any of its sub packages This is convenient if multiple rules need the same data In that case these rules go into the same package and the common data is defined on the pack age For this reason you have to specify a unique name for each data element to clearly identify the data in the rules The complete set of input output and internal data of a rule is the sum of all data ele
43. 209 5 3 3 2 State Flow Context Palette EE 210 Bod PRUNE E Ge E 210 DOA NOSE E 211 BO Ace Te EE 212 B94 E O To EE 212 Boss est oie CMON EE 213 5 3 6 R le Project e E 214 E Dependency DHe an EOLON E 215 5 3 8 Usage Matrix Editor 216 De IMO RS resece here A E EAEE EEA beam esnobectrdsne beam E NEEE AE 216 E e ODE RUE DIOE serrr errie EEEE EA EEE EA EESE 216 O42 Oen Re West RTE EE 217 5 4 3 Auto Creation Dialog ssssessececeeseeceeceeceeseeeccecerecerceceeeeeeeeeeeeeceeeecesereeeeereeeeeeeeeeceereeerererereee 218 E El RT EE 218 E UI Seal Gil IDIAIO E 220 e EE COMP ale Me suits IAG EE 221 5 4 7 Select Dependency Dialog 221 DOs EE 222 Dodl ROE EXpIorer VIEW eegene 223 D0 PO e e ee 223 E IPOD CWS EE 224 Ms CUMMINS VICW eege 225 a DO CN WIC OE SA EEE ca ean dees spate ONE pa cbamneeosineteeeenosuersencces 225 e EE VICW eege 226 9s lasts VICW eebe 227 D9 6 DCIS WiC We ee 227 29 Fs Vailas VICW EE 228 E Be K Ol CIE 229 5 6 Properties Tabs ccc cccccccceecccenceeeneeeeneeeenseeenseeesseeesseeesseeesseeeseeeeseeeeteeeseeensteenseeesseeesseeenges 229 BO als AC Weal EE 229 Bosch Software Innovations GmbH xii 270 Modeling Guide Een Re le 1 D EE 229 ee NOUS TAD ccouapstcepsonscnscces E EE EEEE EE EE EEE E EEES 230 Be ENC E ee 230 5 6 2 1 Decision Overview Tab EE 230 0 232 De ei DaS E 231 DOLS ASSEM Taere irnn Erre Ee ENE E AEE EEE T EEIE 232 0 2 FE ACn E EE 234 202S CAFON RUIE cece necewaseco
44. 4 RN34 200808261 748 a Al The Eclipse Project Updates Add Site Manage Sites Refresh Show only the latest versions of available software C include items that have already been installed dates preference page to set up an automatic update schedule 3 You will see all packages which will be installed for updating a new version and click on Next Bosch Software Innovations GmbH 191 270 Install Install i Your original request has been modified Sp visual Rules 3 Legacy Libraries Fei dis was Rules 3rd Party Libs Visual Rules Ant Tasks E 4b Visual Rules Compare Merge F b visual Rules Core Base e So Visual Rules Core Expression bei Sf visual Rules Core Resource bei visual Rules Core UI M Lip Visual Rules Database Connectivity bei 4p visual Rules Decision Table E Se viual Rules Documentation F Visual Rules Documentation Generator b i 4 Visual Rules Execution Lei Sh visual Rules Flow Rule 2p visual Rules Generator Tei vin wel Rules Integration E Kli Visual Rules Java bei is Visual Rules Java Generator bei Spvisusl Rules Java UI bei inves Rules JOT Integration vs sl Rules Model Access bei vgl Rules Runtime iv vis vtaual Rules Search kel Lee iral Di deeg Ear ste Size 9 178 KB Details Wersion 4 2 2 ve0080828 1748 4 2 2 veu080826 1748 4 2 2 We0080828 1748 4 2 2 ve0080828
45. 5 6 2 5 Call Flow Rule 234 e Section 5 6 2 6 Call Decision Table 235 e Section 5 6 2 7 Call Service 236 e Section 5 6 2 9 Return Exception Tab 239 e Section 5 6 7 2 Action Settings Tab 249 5 4 5 Rule Search Dialog This dialog is used to search for specific elements of rule models Search Rule Search EIP File Search ZC Java Search Containing text P any words d any character escape For literals ri Search For Search Gei All occurrences CH Select Names Rules Actions Descriptions Expressions Internal Data Services Motes Data Types Service Types Types InpukfOukpuk Data Action Types Constant Data Functions Scope Workspace Selected elements Enclosing rule models Figure 5 25 Rule Search dialog enon in Containing text The text to search for Case sensitive When checked the search will only match if the text is found in exactly the same case Otherwise it doesn t matter if the text is using upper or lowercase letters Determines which types of rule model elements should be found e All occurrences will find any kind of element Select will find only those kinds of elements that have been checked The checkbox Rules includes flow rules decision tables and all their contents rule ele ments cells Determines in which part of an element the text must be found to cause a match Names will search in element names Descriptions will searc
46. 5 77 Super Types tab SC LR Adds another super type Removes the selected super type Technical note For imported data types this is only possible if the selected super type is an interface 5 6 9 Meta Data Meta data can be used to extend Visual Rules domain specifically For more Information see the Ja va Integration Guide 5 6 9 1 Meta Data Tab This tab is shown when input output data constant data data structures attributes rule models rule packages or rules are selected in the rule editor This tab is used to view and edit meta data L gt Properties A O t Discounts Internal Data Value Constant Data Actions ede RO E Web Service Description Notes Meta Data Figure 5 78 Meta Data tab Bosch Software Innovations GmbH 261 270 Chapter 5 Reference S LR Adds more meta data Removes the corresponding meta data 5 7 Preferences The following sections describe the Visual Rules specific pages available in the Preferences dialog in the Visual Rules section The Preferences dialog can be opened with the menu Window gt Preferences Preferences type Filter text Visual Rules E General E Ant ER Data Management e Help EI Instal Update ER Java l Model validation H Plug in Development Ze visual rules t Team SB visual Rules Auto Creation Content Assist Dependency Management Flow Rule Editor Syntax Highlighting Test
47. Enter the expression you want to use for the right side 7 Optionally you can also enter a description for the assignment If the left side is a collection which can hold multiple elements or a structure with multiple attributes there are alternative ways for entering the right side works See below on how to enter the elements of a collection or how to specify values for the attributes of a structure If the left side is a structure you can either specify an expression for the right side just like described above or specify values for the individual attributes of the structure In order to do that do the following 1 Expand the structure by clicking the plus m button in front of the left side This will expand the list and show the structure s attributes on individual lines 2 Enter right sides for some or all of the attributes If attributes are themselves structures they can also be ex panded If the left side is a collection or list or set which can hold multiple values you can create and specify the collection elements individually In order to do that do the following 1 Select the collection 2 Click on the button to add a new list element The new list element is added and shown indented underneath the collection The element is indicated by a number index in square brackets 3 Optionally double click the index and change it to another value 4 Enter the right side for the element 4 3 11 2 Adding
48. Execution User Settings p rule your business logic Figure 5 79 Preferences dialog 5 7 1 Expression Formatting Preferences The expression formatting page contains the settings for the formatting of expressions in Visual Rules Bosch Software Innovations GmbH 262 270 Chapter 5 Reference Preferences type Filter text Expression Formatting le Options For user triggered Formatting of Expressions 2 Maximum number of characters before line break Data Management Activate with key combination Ckrl Shift F ou Help Instal Update Java Model Validation Plug in Development Report Design Runt Debug H Team Walidation Visual Rules be Auto Creation Content Assist Dependency Management me Expression Formatting Flow Rule Editor Syntax Highlighting Test Execution User Settings E alga cl a al Ri Sp ER E Restore Defaults Apply Maximum number This is the maximum number of characters in an expression after which automatically a of characters be line break is inserted if possible To activate the automatic line break you need to press fore line break Ctrl Shift F 5 7 2 Flow Rule Editor Preferences This preferences page contains settings for the flow rule editor Preferences type Filter text Flow Rule Editor General Ant Data Management Maximum element height e Help ER Instal Update Java Show transparent elements during drag amp dr
49. Ill Help No preview available Instal Update Figure 5 83 Colors and Fonts preferences 5 7 6 Test execution This preference page contains settings for the execution of tests Bosch Software Innovations GmbH 266 270 Chapter 5 Reference P Preferences type filter text Test Execution General Ant Data Management Help Instal Update Java Model Validation Plug in Development Report Design Run Debug Team Visual Rules Auto Creation Content Assist Dependency Management Flow Rule Editor Syntax Highlighting Test Execution User Settings Restore Defaults Apply Do not ask For confirmation before saving required resources C_ Do not ask for confirmation before generating rule code E H E H EI Gi ci Figure 5 84 Test execution preferences C Do not ask for con Toggles a dialog which appears on test execution showing the resources that need to be firmation before saved in order to proceed saving required re sources Do not ask for con This setting toggles if Visual Rules should show all resources that are required to be gen firmation before erated for the test execution generating rule code When one of the mentioned popup dialogs appears on execution the corresponding setting can be directly set on the dialog 5 7 7 Validation The validation page contains the settings for the automatic validation of rule projects in Visual Rules Bosc
50. Input tt Pricing a auditorium_no Integer in Yes 0 Number of auditorium d coupon Boolean in Yes false Coupon is cashed Seat no Integer in Yes 0 Number of seat in auditorium i show_date Date in Yes 2000 1 1 Date of show student Boolean in Yes false Visitor is a student Output Ka price Integer out No 0 Calculated price On the right side under the list with the packages and models are the rules shown The rules for the currently selected rule package or model are displayed With the selection of one of the displayed rules the documenta tion on the left side switches to the documentation of this rule In the example is the rule Discounts displayed The documentation includes the Rule Name its Description and the Rule in the graphical view Bosch Software Innovations GmbH 185 270 Chapter 4 Tasks A Documentation A G a a Ds Wisual Ries al Rules Modeler 4 0 workspace More Ticket Pricing documentation inde br wl ke i m J ee SE SE J Ki me el Rules Documentation visual rules Packages Documentation generated on Mar 2008 2 41 PM Movie Ticket ici Rule Name Discounts Description The Discounts rule calculates the discounts the movie goer is eligible for A two dollar discount applies to students for every movie lf the movie goer submits a coupon he gets a one dollar discount However this coupon cannot be used in combination with a student discount e e
51. Input Output Data Tab 244 e Section 5 6 6 4 Constant Data 247 5 6 6 4 Constant Data This tab shows a list of all the constant data elements defined on the selected rule model rule package or rule E Properties 23 Ei Problems 3 Tasks EI console TS Navigator sue amp Constant Data Constant Data Advanced Mame Type Multiple Implementation Default Value Description ES ja E 83 CustomerRating e E MAXIMUM RATING Integer No 100 E Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if there is at least one element available This button is used to toggle the alphabetically sorting of the elements se Adds a new Constant Data element Creates a new group This allows you to organize your data Bosch Software Innovations GmbH 247 270 Chapter 5 Reference Removes the currently selected element or group a Inserts another element to a collection list or set This is only available when the selected attribute is a collection list or set Allows manually changing the order of the elements This is only applicable if alphabeti cally sorting xl is turned off Converts the selected element to either Internal Data or Input Output Data This column shows the name of the input output data element The first row shows the name of the element they are attached to You can edit cells in this colu
52. Integer price Integer d n 7 G coupon Boolean E seat no Integer show_date Date student Boolean gt Global Test Data Test Configuration Related References e Section 5 3 4 Rule Test Editor 210 4 11 2 Opening a Rule Test To open an existing rule test in the test editor you double click on the particular test in the Rule Context palette and the selected test will be opened in the test editor te student _discount_granted G weekend surcharge ad GA Services H Bosch Software Innovations GmbH 161 270 Chapter 4 Tasks Alternatively you can double click a rule test in the Project Explorer or Rule Explorer 4 11 3 Finding a Rule Test 1 To find an existing rule test or a test suite you use the button in the toolbar to open a short dialog for searching an existing test This dialog lists all the rule tests in your workspace Whenever a rule test is select ed the name of the rule being tested including rule model name and packages is displayed at the bottom of the list Enter the beginning of the name of the rule test you want to open This will filter the list so that it on ly shows rule tests with matching names If nothing is entered the list will show all rule tests You can use an asterisk to represent any number of arbitary characters e g Score Final will match all tests whose name contains both the words score and Final in that order You can use a q
53. Management Help Update schedule Automatically Find new updates and notify me Instal Update Co Look for updates each time platform is started Automatic Updates Java Model Validation Plug in Development Report Design buniDebug Download options Look for updates on the Following schedule Team Search For updates and notify me when they are available Visual Rules i D Download new updates automatically and notify me when ready to install them When Updates are Found G Notify me once about updates Remind me about updates every Restore Defaults Apply 4 Now you can review and confirm your updates by checking them and clicking on Next For the new version of Visual Rules the Licenses must be reviewed For this reason you have to accept the terms of the license agreements Read the license agreements carefully and select accept the terms in the license agree ments if you consent to the agreements Click on Finish Available Updates Available Updates Review and confirm that the checked updates will be installed Name version Data Tools Platform Enablement for IBM 1 6 1 200809191145 7D43EB7sQS9RbivgHAa lr Data Tools Platform Enablement for Microsoft 1 6 1 v200809191145 442 KE ZAC SNDCODENW Te Data Tools Platform Enablement for MySQL 1 6 1 200809191145 442 kEV c TBTBKPO L Data Tools Platform Enablement for Oracle 1 6 1 200809191145 442 ke cPUSOBIML L Data Tools Pl
54. Platform Intro ht Data Tools Platform JOT Enablement li Data Tools Platform Model Base ht Data Tools Platform Open Data Access Desig Version 1 3 0 veggr0gz0 1 7w3119164102711 100 3 1 4 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 1 6 1 200809191145 7_7K7_Dr O 4jNGDIgo 200809191 145 27418s7 3313171599659 200809191145 7DBH7CSFSWOBZabCz 200809191 145 6524lJAKaLilyLhdmBEKk 200809191145 57_1_pF9IGIZIsIcVhBEKK 200809191 145 7D43EB7sO59Rbi gHaa 200809191145 3 09045555I8 40I 200809191145 442_kE77c7 BODFNW v200809191145 442_kE77c7TBTBKPO 200809191145 2118s7331316C4_6C 200809191145 797P6CYOCD4CvIcEeNW 200809191145 442 kEF c7UAOBIML 200809191145 441_kE77c7R_RCIOP 200809191145 440_ kEFFcFOAQEIOO 200809191 145 7 4 SE9IgKLALGetRuud v2O080627 1731 1507w311918132411 200809191 145 1 07w311916263466 200809191 145 6 0BcMAawAmEgEXTT v200809191145 7C67OCV OCD4D JkHevh Revert Configuration Open the Automatic Updates preference page to set up an automatic update schedule 3 If you want to get an automatic notification for updates please check Automatically find new updates and notify me and press Apply for confirmation Otherwise continue with step 4 Bosch Software Innovations GmbH 194 270 Chapter 4 Tasks Preferences BEE General Ant Data
55. Price 0 9 By adding round to the expression the price is rounded to the next integer El p Is it a premium customer Premium Customer Yes premium customer TRUE Price 10 discount e Price roundiPrice 0 9 Discount on rental granted So premium customer Bosch Software Innovations GmbH 16 270 Chapter 2 Getting Started 2 2 4 4 Create a new Action For the last step of finalizing the flow rule you need an action that holds the information if a discount was granted 1 Type in the name Discount Granted in the content field of the Fire Action element in the flow rule editor ee Is it a premium customer Mmmm Premium Customer Tes premium customer Bi i TRUE Price 10 discount e Price round Price 0 9 Discount on rental granted 2 Discount_Granted Mo premium customer 2 Ifyou leave the content field the Automatic Element Creation dialog appears gt Automatic Element Creation Automatic Element Creation Visual Rules can assist vou in creating new model elements ki Discount_Granted Standard 3 Confirm the creation of the action with Create The new action is shown in the Rule Context palette under Ac tions For further information about the automatic element creation dialog see Section 5 4 3 Auto Creation Dia log 218 Rule Context E at d Input Output Data EI CG Car_Ty
56. Properties view 3 Insert the description on the Description tab or add notes on the Notes tab 4 4 10 Navigating in Decision Tables Navigate through the decision table cells with the following hot keys e Open inplace editor of cell with Enter or simply by starting to type e Close inplace editor of cell with Enter e Navigate through the cells of the decision table with the arrow keys 4 4 11 Configuring the Appearance of the Decision Table Editor Via the View dropdown toolbar button you can configure what data should appear in the decision table edi tor By activating the button you can toggle highlighting of the cells for the conditions matching the selected cell The latter feature dramatically improves the readability of large decision tables Bosch Software Innovations GmbH 130 270 Chapter 4 Tasks n E LA Descriptions w E Tooltips vw L Empty Descriptions Content Alternatively you can also right click in the decision table editor and select the according entries from the View context menu The following table shows the individual options Table 4 2 Individual options for configuring the appearance of the decision table editor EE Show hide descriptions of decision table cells Empty Descriptions Content Show hide empty descriptions or content of decision table cells Highlight Condition Path Toggle highlighting of the cells for the conditions matching the selected cell 4 4 12 Adding a new
57. SS CustomerRating E customerId in YES Integer No fa customerRating out No Integer Mo ay customers in Yes Customer List Yes t D Figure 5 58 Input Output Data tab Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if there is at least one element available This button is used to toggle the alphabetically sorting of the elements ne Adds a new Input Output Data element Creates a new group This allows you to organize your data Removes the currently selected element or group Inserts another element to a collection list or set This is only available when the selected attribute is a collection list or set Allows manually changing the order of the elements This is only applicable if alphabeti cally sorting is turned off Bosch Software Innovations GmbH 244 270 Chapter 5 Reference a Senme Converts the selected element to either Constant Data or Internal Data This column shows the name of the input output data element The first row shows the name of the element they are attached to You can edit cells in this column except for the one in the first row by double clicking them Input Output This column shows wether the data element is used for input for output or for both You can edit cells in this column by double clicking them Required This column shows wether the data element is required You can edit cells in this
58. Suite Test Suite Create a new Test Suite Enter or select the parent Folder Movie Ticket Pricing the gt it gt Movie Ticket Pricing c s1 innovations de File name All Tests 4 Enter the name of the new test suite and click Finish It s possible but not recommended to change the folder where the file is created 5 Now the test suite editor appears and you are ready to add rule tests or other test suites to the new test suite Bosch Software Innovations GmbH 172 270 Chapter 4 Tasks x i 0 6 ai on op t Test Description Tests Test case 0 Failure message Related References e Section 5 3 5 Test Suite Editor 213 4 12 2 Opening or Finding a Test Suite You can use the following methods to open an existing test suite e Double click the test suite in the Project Explorer or Rule Explorer if you know its location Use the Open Rule Test dialog Click the button in the toolbar In the dialog that opens click the button to show test suites 3 As described for rule tests in Section 4 11 3 Finding a Rule Test 162 you can type the first letters of the test suite s name and then double click the corresponding list item 4 12 3 Adding Tests The purpose of a test suite is to group related rule tests and other test suites so that they can be executed togeth er Here is how to add tests to a test suite 1 Click the add icon in the test suite editor 2 Ad
59. Super Types tab in the Properties view Click on the button to add a new super type to the structure 4 Select the structure which should become a super type and click OK To remove a super type select it and click on the button A structure defined in Visual Rules can only have one super type Structures that have been import ed from a Java Type Library may have multiple super types Related Concepts e Section 3 14 3 Structure 74 e Section 3 14 4 Super Types 75 Related References e Section 5 6 8 6 Super Types Tab 260 4 7 5 Defining Type Aliases In order to create a new type alias for a rule a rule package or a rule model in the Rule Explorer do the following 1 Select the rule rule package or rule model in the Rule Explorer where you want to define a new type alias 2 Right click the element and select New Element gt Type Alias 3 Enter the name of the new type alias 4 Click on OK to create the type alias It appears in the folder Data Types in the Rule Explorer 5 Select the Primitive Type of the alias on the Type Alias tab in the type alias Properties Related Concepts e Section 3 14 2 Type Alias 74 Related References e Section 5 6 8 2 Type Alias Tab 257 4 7 6 Defining Enumerations In order to create a new enumeration for a rule a rule package or a rule model in the Rule Explorer do the follow ing 1 Select the rule rule package or rule
60. Table of Contents le e TEE 1 1 Organization OF this E UTC E 1 DD UU E 1 1 3 Using the Visual Rules Online Help 1 E ak We EE 2 e Ge eege 2 2 MOTI Stared eege E Al Leanne TNE EE 3 2 1 1 Layout of Visual Rules Modeler eegene Eeer Eden geed AE 3 21 2 Modelng TEE 4 2 2 Tutorial 1 Modeling Your First Simple Rule 6 2 2 1 Task 1 Create a New Rule Project c ccc ecc ccc e nc enccenceeneeeneeenseenseenseenseenseesseesseenseesseesseesseenees 6 2 2 2 Task 2 Create a New FIOW Eiere eege T 2 2 3 Task 3 Draft Your First Flow TU 8 Aole DESCHOINE TNC RUIE E 8 2 2 3 2 Adding a new Decision E 8 2 2 3 3 Adding a new Decision Condition scssciiiescesrscecndedisesenedontswess ecaeasatwessbaidectineadesdeasesioenwesaiuuaeteneeeses 9 2 2 3 4 Adding a new Assignment ee ENNEN NENNEN NENNEN ENNEN ENNEN NENNEN NENNEN NEEN 10 22 28 Adde a NEW ACION Eeler 12 2 2 4 Task 4 Finalize Your First Flow Rule cceccececeececnceneneenceeeneeenseneeeeneeeeneeneeeenseeenseaeeseneeeees 13 22AAy Enabling the COMET eege ee AER EE te 13 2 2 4 2 Create new data elements ssesssesesssesosesesesesesessecsessssesosesesessssesesesosesesesesescsescsessseeseeesoee 14 22A E Edit ITT ccs Suasceacieocecenmtecmecsmsectcnansesciseaseocheonctioceeaenestieqnitieseuaieoss aeaintiocsecstentinacit guess 15 22 AA Create ANEW ACION EE 17 DD ate CON USON WEE 17 2 3 Tutorial 2 Testing Your First Rule 18 23d Vas 1 Credle WEE 19 2 3 2
61. Tasks Click on to automatically insert data elements as input values when they have matching name and type Only inputs still without a value will be affected 3 The output data elements of the called decision table are displayed in the Output Data area Assign the out put values to data elements of the calling flow rule Click on amp to automatically insert data elements with matching names and types to assign the outputs to Only outputs not yet assigned will be affected C Properties Kies a VEER Call Decision Table 1 Call Decision Table Descripti CallDecision Table Bonus pos Lal Description Notes E nae advanced if Input Data Value Output Data assign To Be ES bonus_card BONUS_CARD BONUS_CARD GOLD 3 bonus_poinks Integer bonus_poinks id ii money spent Integer money _spent Gs E weekday Integer 2 UI The M button opens the specified decision table in the editor Related Concepts e Section 3 5 5 Call Decision Table 39 e Section 3 7 Decision Table 48 Related Tasks e Section 4 10 1 Using the Code Assist 157 e Section 4 11 9 Copying and pasting values 164 Related References e Section 5 6 2 6 Call Decision Table 235 4 3 17 Editing a Call Service Element In order to edit a call service element open its Properties and select the Call Service tab and do the following 1 Select in the field Call Service the service tha
62. Tutorial Database Bosch Software Innovations GmbH 196 270 Chapter 5 Reference Chapter 5 Reference 5 1 Perspectives Perspectives are pre defined user interface layouts The following sections describe the perspectives specific to Visual Rules 5 1 1 Rule Modeling Perspective The Rule Modeling perspective is used for rule modeling tasks It is divided into four sections The Rule Explor er on the left shows all the projects and the elements contained therein There are several tabs like the Properties view and the Problems view at the bottom The Properties view always shows the properties and settings of the currently selected element and the Problems view shows all the warnings and errors in the rule models The cen tral section shows the active editor Most of the time the rule editor or the test data editor will be shown here Rule Modeling Movie Ticket Pricing Movie Ticket Pricing Discounts vrrule Visual Rules Modeler File Edit Wavigate Search Project Run Window Help im Gi wr O Qe owe co feos FE Rule Modeling Dolt BS xl waa a ea e Rule Explorer 5 O Discounts 3 EI T itr The Discounts rule calculates the discounts the movie goer is eligible for HL Execute Command Action A two dollar discount applies to students for every movie B E Movie Ticket Pricing If the movie goer submits a coupon he gets a one dollar discount A Movie Ticket Pricing _ _However this coupo
63. View 226 e Section 5 3 1 2 Rule Context Palette 206 Bosch Software Innovations GmbH 147 270 Chapter 4 Tasks 4 6 12 Renaming Data Elements If you want to rename a data element in the Rule Context Palette do the following 1 Double click the data element that should be renamed to open its Properties 2 Replace the old name by the new one in the column Name 3 Confirm the new name with OK If you want to rename a data element in the Rule Explorer do the following 1 Right mouse click on the data element you want to rename Select Rename in the context menu that appears Alternatively select the data item and press the F2 key 2 Adialog appears for you to give the data element a new name If the name you enter is invalid or already in use an alert message appears and OK is greyed out 3 Click on OK to confirm the process Related Concepts e Section 3 13 Data 67 4 6 13 Displaying Data Types On the Rule Explorer bar the icon Show Visual Rules Types provides detailed information for any Visual Rules item 1 Enable this option by clicking on the icon in the Rule Explorer 2 The type is now shown after the name of each item separated by a colon In the case of a input output data element for example this is the data type In the case of an action element the action type is shown ie D Si 2 Lex Movie Ticket Pricing ER Movie Ticket Pricing Ef Input Output Data B E Input E
64. a Rule 1 Copying a rule is done with drag amp drop Select the rule you want to copy click on it and hold down the left mouse button 2 Drag the rule to the location you want to copy it to Press and hold the Ctrl key to create a copy 3 Let go of the mouse button to paste the copy lf the Ctrl key is not held down when you release the mouse button the rule is not copied to the new location but moved Related Concepts e Section 3 4 Flow Rule 29 Related Tasks e Section 4 2 13 Moving a Rule 99 4 2 13 Moving a Rule 1 Moving a rule from one rule package into another rule package is done with drag amp drop Select the rule you want to move click it and hold down the left mouse button 2 Drag the rule to the location you want to move it to 3 Let go of the mouse button to move the rule If you want to create a copy of the rule press and hold the Ctrl key when you release the mouse but ton Related Concepts e Section 3 4 Flow Rule 29 Related Tasks e Section 4 2 12 Copying a Rule 99 4 2 14 Creating a new State Flow 1 Right click on the rule model where you want to create the new state flow in the Rule Explorer or Project Explorer 2 Select New Element gt State Flow from the context menu Bosch Software Innovations GmbH 99 270 Chapter 4 Tasks 3 4 5 6 The New State Flow wizard appears Select the rule model and rule package where the new
65. a decision table do the following Bosch Software Innovations GmbH 127 270 Chapter 4 Tasks 1 Select the Else element in the palette by clicking on it 2 Move the mouse to the last condition of any decision A black arrow will appear to show you where the else condition will be added This can be only after the last condition of a decision Accordingly the black arrow will point to the right or down Move the mouse until the arrow points into the direction you want BETWEEN 1 200 auditorium _no Bonus Points Bous Portz SL P A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and the else condition will be inserted Related Concepts e Section 3 7 1 Condition Column Row 49 Related Tasks e Section 4 4 2 Adding a new Decision Column or Row 125 e Section 4 4 3 Editing Conditions 126 e Section 4 4 4 Adding a new Condition 127 e Section 4 4 8 Rearranging Condition Columns or Rows 129 4 4 6 Adding a new Assignment Column In order to add a new assignment column to the decision table do the following Option 1 1 Select the Assign element in the palette by clicking on it 2 Now move the mouse over an existing blue column header A black arrow will appear to show you where the new assignment will be added This can be either before or after an existing assignment action or exception c
66. a premium customer E call Decision Table Call a Expression decision table Call Service Call a service Price is 60 per day Price 10 discount Done amp Return Immediately return to the calling rule Repeat Repeat the Following part of the Flow Discount on rental granted End Repeat Immediately exit a Repeat lt Return Exception Create an exception message and continue where exceptions are handled gt Handle Exception Specify what to do when an exception message is returned You will see error and warning markers that show where expressions have to be inserted Bosch Software Innovations GmbH 13 270 Chapter 2 Getting Started 2 2 4 2 Create new data elements Every rule in Visual Rules clearly specifies the data that goes into the rule input data and the data that comes out of the rule as a result output data Create an input data element car type that holds the value for the car type compact or luxury 1 You can create the data elements directly in the Rule Context palette of the rule editor Expand the Rule Con text palette by clicking on the small black arrow pointing left gt L Rule Modeling Rule Context Ke Click on the green plus sign of Input Output Data in the Rule Context palette to add a new input data ele ment Rule Context K Input Output Data Inte Add a new inputfoutput data oS consent Data FT Th
67. a result in the test editor but the action that is not executed An example for this are Send email actions for test you don t want to send an email for every test execution and just want the information that an email would had been send 2 This can be done by switching to the configuration tab of the test editor 3 Atthe Actions section you have the possibility to en disable all actions at once or use the checkboxes to en disable particular actions separately Actions Enable all Disable all Enable individually Action Type Description Enable all coupon discount granted Fires if the coupon discount wa d COUPON i as Ik grante angari Jon Res COUP Disable all et general seating Standard Fires if visitor takes a normal se e special seating Standard Fires if visitor takes a deluxe se A student_discount_granted Standard Fires iF the student discount w GG weekend surcharge added Standard Fires if an extra charge is adde 4 11 16 Defining Expected Results 1 On the Output section the test editor displays all output parameters defined in the settings on the configura tion tab 2 By double clicking on the Expected Result field in the Output section of the test editor you may enter your expected result for the particular output data element Output ae e pla wg ae Output Data Expected Result fea price Integer 3 AA Bosch Software Innovations GmbH 166 270 Chapter 4 Tasks Each c
68. after the rule package was moved and only then continue modeling 4 2 8 Creating a new Flow Rule 1 Right click on the rule model where you want to create the new flow rule in the Rule Explorer or Project Ex plorer 2 Select New Element gt Flow Rule from the context menu 3 The New Flow Rule wizard appears 4 Select the rule model and rule package where the new rule should be created You can click on the corre sponding Browse buttons to select the rule model and rule package from a list If a rule model or rule package was selected when the wizard was started then the rule model and rule package settings will already contain correct values So the easiest way to create a new rule is to select the rule package where the new rule should be created and then start the New Flow Rule wizard You can also right click on a rule model or rule package and select New Element gt Flow Rule from the context menu That s the quickest way to create new rules 5 Enter a name for the rule 6 If you want to use a rule template as the basis for the new flow rule check the Use template box and select the desired rule template by clicking on the Browse button Alternatively you can use the code assistant by pressing Ctrl Space 7 Press Finish to create the new flow rule The flow rule editor will open automatically Related Concepts e Section 3 4 Flow Rule 29 e Section 3 3 Rule Package 26 e Section 3 2 Rule Model
69. an Assignment to an Assignment Element In the flow rule editor do the following 1 Make sure the contents are displayed by activating the Hide Show Contents toolbar button 2 Select the Assign element on the palette 3 Move the mouse over the list of assignments shown next to the assignment element where you want to add the new assignment A black bar will appear to indicate where the assignment is inserted Audit No 1 Special 7 price Audit No 1 Special 7 price Alternatively you can simply use the Insert key and start typing to substitute an Assignment in an Assign ment Element In the Properties on the Assignments tab do the following Click on the button to insert a new assignment at the end of the list Alternatively you can simply start editing the last entry in the list indicated by this icon This will create a new assignment automatically Bosch Software Innovations GmbH 113 270 Chapter 4 Tasks 4 3 11 3 Deleting an Assignment from an Assignment Element In the flow rule editor do the following 1 Select the assignment that you want to delete 2 Right click on the assignment and select the Delete menu entry Alternatively press the Del key In the Properties on the Assignments tab do the following 1 Inthe list select the assignment you want to delete 2 Click on the button to delete it 4 3 11 4 Reordering the Assignments in an Assignment Element If
70. and drag it 2 Now move the mouse over an existing yellow condition header of the decision table A black arrow will ap pear to show you where the new decision will be added Depending on the exising decision columns and rows this can be either before after above or below an existing decision Accordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow drop the input data element and the new condition column or row will be insert ed The input data element is automatically inserted in the condition header Alternatively you can use the Insert key to add a new condition Related Concepts e Section 3 7 1 Condition Column Row 49 Related Tasks e Section 4 4 3 Editing Conditions 126 e Section 4 4 4 Adding a new Condition 127 e Section 4 4 5 Adding an Else Condition 127 e Section 4 4 8 Rearranging Condition Columns or Rows 129 4 4 3 Editing Conditions In order to edit a condition header in the decision table do the following 1 Double click on the condition header in the decision table This will open the inplace editor 2 Enter the input data element that should be checked 3 Press Enter to close the editor or click with the mouse outside of the editor In order to
71. be solved by a simple modification of the first condition e g by extending the criteria r LU L mmh customer age is an adult but not yet older than 65 BETWEEN 25 65 older than 65 years gt 65 gt This results in a new meaning for the decision which can be stated as If the customer is an adult but not yet older than 65 then continue with the first exit or else if the customer is older than 65 then continue with the second exit otherwise continue to the else exit Starting from the previous example it is conceivable that both exits is an adult and is older than 65 should be executed For this there is a decision setting that tells Visual Rules that it should not only execute the first exit whose condition is true but all exits whose conditions are true This behavior is indicated by dashed lines that are displayed when you activate the Allow multiple matches not just the first one checkbox in the decision prop erties older than 65 years Ise SS This results in a different logic formulated in full as If the customer is an adult then execute the first exit and continue with the next condition If the customer is old er than 65 then execute the second exit If neither the first nor the second exit were executed then execute the else exit Note that the semantics for the else exit are not affected by the Allow multiple matches
72. bottom of the dialog This helps to distinguish be tween tests with the same name In order to select from test suites instead of rule tests the test suite icon must be clicked Open Test Select tests LO O gt FS Te e BonusPoints Test Movie Ticket Pricing Bonus Points e Bonuspunkte Test g gt Convert Fahrenheit to Celsius Test g Customerscoring Test g gt Display customer Data Test Evaluate Path Test XPath ServicelEvaluate Path e InitializeDatabase Test e InsertOrders Test e Preisberechnung Test E Pricing Test e fePath Service Evaluate Path Figure 5 22 Open Rule Test dialog SCC Select a rule test to Enter the beginning of the name of the rule test or test suite you want to open This will filter the list or the tree so that it only shows tests with matching names If nothing is en tered the list will show all tests in the workspace You can use an asterisk to represent any number of characters eg Score Final Will match all tests whose name contains both the words score and Final You can use a question mark to represent exactly one character eg category will match all tests whose name contains the word category preceded by exactly one charac ter e em e Displays rule tests no test suites Bosch Software Innovations GmbH 217 270 Chapter 5 Reference L I n EE el Displays test suites no rule tests Oe o oo OYO Displays the tests in a flat list sorted a
73. case e Execute the rule e Inspect the results of the test cases e Display statistics about rule execution 2 3 1 Task 1 Create a Rule Test 1 Add anew rule test by clicking on the green plus sign near Rule Tests in the Rule Context palette of the rule editor CG Car_Type CG Premium Customer GG Price CG Rental_Days H Internal Data 5 Constant Data Ciscount_Gcranted C Rule Tests 3 A new rule test is created and opened automatically in the rule test editor You can see the new rule test in the Rule Context palette of the rule editor if you go back to the rule A rule test can be opened by double clicking on it Bosch Software Innovations GmbH 19 270 Chapter 2 Getting Started lad GE Input Output Data 9 g Car_Type GG Premium Customer ia Price CG Rental_Days Internal Data 5 Constant Data Discount_cranted E Services Z2 Rule Tests e EL Rent Test 2 3 2 Task 2 Define Input Data for the Test Case 1 Inthe Input area you see the defined input data elements from the rule Input 3 X Input Data Value i Car_Type Any E Premium Customer Any GG Rental_Days Any 2 Insert the test data values that should be used for the rule execution by double clicking in the value column Input 3 X Input Data Value St Car_Type Any compact ES Premium Customer Any true E Rental_Days Any 3 Insert the following test data values Input P
74. conversions may fail if e g the string does not contain a number A string Hello cannot successfully be converted to a number thus an add operation will fail during rule execution and Visual Rules will create an exception So care must be taken that these situations do not arise when rules are using data of type any Therefore it is always a good idea to use more specific data types instead of any wherever possible 3 14 1 2 String A String is a collection of characters in other words some text Strings in Visual Rules are always enclosed in dou ble quotes Example 3 23 Strings e This is a string e He said Hello e Ist line n2nd line n3rd line e This is a string that continues across multiple lines A double quote in a string must be written as Strings can contain line breaks like in the fourth example above Bosch Software Innovations GmbH 72 270 Chapter 3 Concepts The following character combinations prefixed with a backslash have special meanings in strings AP double quotes n new line t tab character backslash 3 14 1 3 Boolean Boolean values can take only two values The words true Or false are used for this in Visual Rules Example 3 24 Boolean values e true e false Alternatively Boolean values can also be written in capital letters only like this TRUE or FALSE 3 14 1 4 Date A Date value always starts and ends with a character The actual Date value begin
75. coupon Boolean E Seat no Integer CG show_date Date student Boolean ef Auditorium 1 special seating no weekend ER Auditorium 1 general seating no weekend gP Auditorium 1 general seating weekend 34 Auditorium 3 coupon gP Auditorium 3 student ER Auditorium 3 coupon and student 44uditorium 1 special seating no weekend EP Auditorium 1 special seating no weekend gt Global Test Data Value 1 BONUS_CARD SILVER False 100 2007 09 21 False Output Data Se bonus_points Integer Ge Price Integer Expected Result 15 F Actual Result 15 w Test Configuration Figure 3 18 Rule Test Editor Test Cases Bosch Software Innovations GmbH 83 270 Chapter 3 Concepts Pricing et 3 SH Configuration Outputs Warnings O Select all O Select none Choose elements C Ignore missing expectations Data Element Description Statistics e CS perme Deselect All Create Statistics Yes for the entire test SP aks Detail Level Record number of visits and execution times v r Fie price Calculated price EE O es coupon_discount_granted Fires if the coupon discount was granted Selected Configuration Standard EI TT Ey general_seating Fires if visitor takes a normal seat a Di special_seating Fires if visitor takes a deluxe seat Actions O student_discount_granted Fires if the student discount was granted O Enable
76. e g to hold intermediate results Internal data elements should be defined on the rule level to ensure that they can only be used by that one rule However internal data el Bosch Software Innovations GmbH 69 270 Chapter 3 Concepts ements can also be defined on the package level and are then shared by all rules in this package or in any of its sub packages In that fashion rules can use internal data elements to exchange data Internal data elements can be static In that case their value is initialized only once when the rules are executed for the first time Afterwards they retain their value between rule executions Static data elements are ideal to hold large amounts of reference data that does not change often or not at all The values of static data elements are shared across multiple rule executions This includes rule ex ecutions that happen in parallel i e at the same time So care must be taken when values of stat ic data elements are changed because that change is immediately visible to all ongoing rule execu tions ce a x 7 3 E Properties 24 KS problems 7 Tasks EI console ts Navigator d Internal Data iml Internal Data advanced S Mame Type Static Multiple Implementation Default value Vz E S CustomerRating E temporary Integer Mo No Related Tasks e Section 4 6 2 Defining Internal Data Elements 141 e Section 4 6 Working with Data 140 3 13 4 Const
77. end value End The counter is optional Code Assist Ctrl Space is available Enter the start value for the counter This can be any expression that evaluates to a num ber Code Assist Ctrl Space is available Enter the end value for the counter This can be any expression that evaluates to a num ber Code Assist Ctrl Space is available Enter the step value for the counter This can be any expression that evaluates to a num ber Code Assist Ctrl Space is available 5 6 2 9 Return Exception Tab This tab is shown when a return exception node is selected in the rule editor You can specify the exception that should be returned here You can either choose to return an previously created exception or create a new excep tion to return Return Exception 11 8 l Exception missin Return Exception j R Description Gei Exception Element Motes Create Exception Element Attribute Description message String Figure 5 51 Return Exception tab Bosch Software Innovations GmbH 239 270 Chapter 5 Reference Description Exception Element Activate this and enter an expression which results in the exception element you want to return Code Assist Ctrl Space is available Create Exception Activate this if you want to create a new exception element Code Assist Ctrl Space is Element available Enter the type of exception element you want to create Table Column Description This column shows
78. existing decision Accordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want BETWEEN 1 200 A stop icon indicates that the decision table element cannot be added at this location Bosch Software Innovations GmbH 129 270 Chapter 4 Tasks 3 When you see a black arrow drop the decision and the whole column or row will be moved If you rearrange condition columns or rows like this the decision table is restructured according ly This may introduce new cells which are initially empty seat no auditorium mo Bonus Points ee Related Concepts yu yu yu ya yu yu ya w IGo lb lralta lb Ss 0 a E oo e Section 3 7 1 Condition Column Row 49 Related Tasks e Section 4 4 2 Adding a new Decision Column or Row 125 e Section 4 4 3 Editing Conditions 126 e Section 4 4 4 Adding a new Condition 127 e Section 4 4 5 Adding an Else Condition 127 4 4 9 Describing Decision Table Elements In order to insert a description to any decision table element do the following 1 Activate the display of descriptions in the toolbar drop down 7 2 Double click on a description in the decision table to start the inplace editor 3 Enter the description Alternatively you can use the Description tab 1 Select the cell of the decision table you want to describe 2 Goto the
79. explorer 2 Double click on the relevant test in the test suite editor if necessary The test editor opens with respect to the relevant test and result file 4 11 21 Inspecting Results The results shown in the test editor always correspond to a specific execution of the respective test To show the relevant result file in the rule explorer click on the icon in the test suite editor 1 After running your test you can check if the test was successful This is indicated by the symbol amp in the Test Cases section and tells you that the rule logic related to the test case was correct and the expected results match the actual values e Pricing E Pricing Test 7 Gd Discounts ae a Test for Pricing in Movie Ticket Pricing Fla E amp H Description Test Cases Input Output s E War P D gi NW oS m E F 2 E i on Input Data Value Gutput Data Expected Result Actual Result EE E3 auditorium po Intege 1 fea price Integer 5 5 ES E coupon Boolean False KF CG seat no Integer 200 a hai E show date Date 2007 31 09 E student Boolean true 2 In case the test fails this is indicated by the symbol amp in the Test Cases and Output sections A test fails if the expected results don t match with the actual results This can happen if there is a problem in the rule logic or there are wrong values in the expected results You may also get a warning symbol Z7 indicating that the rule has produced results for
80. functions Collection function sortAsc collection sortExpression sortDesc collection sortExpression exists collection condition forall collection condition count collection dition first collection dition last collection dition min collection pression max collection pression filter collection condition select collection pression rankAsc list sortEx pression element max Elements rankDesc list sortEx pression element max Elements Returns a list sorted ascendingly according to the given sort expression Returns a list sorted descendingly according to the given sort expression Returns true if at least one element of the given collection fulfills the conditional ex pression Returns true if all elements of the given collection fulfill the conditional expresison Returns the number of elements that fulfill the conditional expression Returns the first element in the collection that fulfills the conditional expression or null if no element is found Returns the last element in the collection that fulfills the condition specified by the lt THIS expression gt or oui if no element is found lt THIS expression gt must be a boolean expression i e it must evaluate to either true Of false Returns the element in the collection for which the expression evaluates to the low est value Returns the e
81. in the following sections The Properties view is not specific to Visual Rules but part of the Eclipse platform underlying Visu al Rules You can find more information in the Workbench User Guide part of the documentation for the Eclipse platform Bosch Software Innovations GmbH 226 270 Chapter 5 Reference 5 5 7 Statistics View The Statistics view shows information on the execution of the test suite or test covered by the statistic currently active Here the focus can be restricted to an individual test case with the navigation in the header The navigation also controls the focus in the flow rule editor or in the decision table editor respec tively E Rule Test 2 gt Statistics Information Statistics Properties dh Rule ProjectiTest Suite 1 Artifact Id Rule Project Group Id rule project Start 3 15 10 3 06 PM Version 0 0 1 SNAPSHOT End 3 15 10 3 06 PM Duration 0 005 Executed rules e Example Flovy Fule Figure 5 35 Statistics view th Hyperlink to the relevant statistics file or result file or dh End Start time of the execution End o End time of the execution Time duration of the execution Executed rules Hyperlinks to the rules that have been part of the execution Statistic Properties Any additional information e g identifiers of the relevant project 5 5 8 Debug View The Debug view is used during debug sessions When execution is halted it shows the current execution t
82. it and press View Contents Press Next gt Bosch Software Innovations GmbH 189 270 Chapter 4 Tasks Visual Rules Support Request System Information Here You can see all the information being sent to our support department The Following information are part of the support request Name Description System Information Contains general system information about visual Rules and the Ech Contact Information Contains contact and product information E Mail address fe Workspace metadata Contains important runtime information log File settings osa Configuration logs Contains log files From the OSGI configuration Description Contains the text of the supplied description or request Fie Project Movie Ticket Pricing Content of project Movie Ticket Pricing V View Contents E Mail supportidyisual rules de Finish Cancel 5 Select what to do with the generated report You can either directly send it over the internet or save it locally After you have made your choice press Finish Visual Rules Support Request Completion Send us Your support request and save it to disk if necessary You can send your report to our support department over the internet and you can save it locally on your computer e g to send it by E Mail later on Send report over the internet Enable HTTP proxy connection E Mail supportidyisual rules de 4 22 Updating a new Version of Visual Rules
83. location and the name for the new rule model 5 Press Finish to create the new rule model Related Concepts e Section 3 2 Rule Model 25 Related References e Section 5 2 2 New Rule Model Wizard 201 4 2 2 Opening a Rule Model 1 Double click on the rule model in the Rule Explorer to open it Alternatively you can right click on the rule model and select Open from the context menu With the Go Into menu entry available in the context menu of Rule Explorer you can navigate into the tree like structure of projects rule models and rule packages Whenever you do that the Rule Explorer contents are limited to only that branch A button in the toolbar lets you go up again one level New H Copy ctrl E CS Paste Cru 3 Delete Delete Rename FA aa Import py Export Refresh Close Project Close Unrelated Projects 2 When the rule model is open the Rule Explorer displays the model contents as children of the rule model Bosch Software Innovations GmbH 94 270 Chapter 4 Tasks Rule Explorer 3 EE e 8S aaa E LS Movie Ticket Pricing gt Movie Ticket Pricing ER Input Outout Data DES Constant Data H Actions a Data Types ER Bonus Points S Discounts Fs a Pricing i gt ruleproject wr Related Concepts e Section 3 2 Rule Model 25 Related References e Section 5 5 2 Project Explorer View 223 4 2 3 Sa
84. model in the Rule Explorer where you want to define a new enumera tion Bosch Software Innovations GmbH 152 270 Chapter 4 Tasks 2 Right click the element and select New Element gt Enumeration 3 Enter the name of the new enumeration 4 Click on OK to create the enumeration It appears in the folder Data Types in the Rule Explorer Related Concepts e Section 3 14 5 Enumeration 76 Related Tasks e Section 4 7 7 Defining Literals of an Enumeration 153 4 7 7 Defining Literals of an Enumeration To define literals of an enumeration in the Rule Explorer do the following 1 Select an existing enumeration to which you want to add a literal 2 Right click on the enumeration and select New Element gt Literal 3 Enter the name of the new literal 4 Click on OK to create the literal under the enumeration It appears in the folder Literals under the enumera tion in the Rule Explorer 5 If you create attributes for the enumeration you can define default values for these attributes for every literal In order to define literals on the Literals tab in the Properties of the enumeration do the following 1 Click on the button to add a new literal to the enumeration 2 Insert a name for the inserted literal 3 Insert a default value for the literal 4 Ifyou create attributes for the enumeration you can define default values for these attributes for every literal For deleting a literal select i
85. name New groups are created deleted and modified in the Rule Explorer To define a new group do the following 1 Select the folder or the group you want to create the new group below e g the Input Ouput folder and right mouse click on it 2 Select New gt Group from the contextual menu that appears 3 A dialog appears for you to give the group a new name 4 Click on OK to create the group It appears immediately in the Rule Explorer and is already selected 4 6 15 Deleting Groups If you would like to delete a group do the following 1 Right mouse click on the group you want to delete Select Delete in the contextual menu that appears Alter natively you can also select the group and press the Del key 2 If you would like to delete several groups at the same time first select the ones to delete while holding down the Ctrl key and then select Delete from the contextual menu or press the Del key When you delete a group all included items are also deleted Make sure that you have made the right selection 4 6 16 Editing Descriptions You can enter descriptions for data elements data types attributes literals groups etc 1 Inthe Rule Explorer select the element that you want to add a description to Bosch Software Innovations GmbH 149 270 Chapter 4 Tasks 2 Inthe Properties view activate the Description tab 3 Enter the description You can also specify hyperlinks to external documents within d
86. new Exception Column In order to add a new exception column in the decision table editor do the following 1 Select the Return Exception element in the palette by clicking on it 2 Now move the mouse over an existing blue column header A black arrow will appear to show you where the new exception will be added This can be either before or after an existing assignment action or exception column Accordingly the black arrow will point to the left or to the right Move the mouse until the arrow points into the direction you want BETWEEN 1 200 auditorium _no Bonus Points f Sp A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and the new exception column will be inserted Related Concepts e Section 3 7 4 Exception Column 50 Bosch Software Innovations GmbH 132 270 Chapter 4 Tasks Related Tasks e Section 4 4 15 Editing Exception Columns 133 e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 15 Editing Exception Columns In order to edit an exception column header do the following Double click on the column header in the decision table This will open the inplace editor Enter an exception that should be returned depending on conditions Press Enter to close the editor or click with the mouse outside of the editor Select the exception column header and open the Properties
87. new decision column or row Decision columns are added at the left side of the decision tables while decision rows are at the top of the table Inserts a new assignment column Assignment columns are used to assign values to out put data elements These are then the result of the decision table Inserts a new action column These are used to fire Visual Rules actions of any type Return Exception Inserts a new exception column These are used to return exceptions to the caller of the decision table to signal error conditions Figure 5 12 Decision Table Editor palette 5 3 2 2 Rule Context Palette The rule context palette is shown on the right side of the decision table editor It displays and gives access to data elements actions and rule tests These elements are shown within their respective sections The sections can be collapsed or expanded and pinned open with the little pin symbols Double clicking on an element will open the Properties for this element or in the case of rule tests start the rule test editor Clicking on a selected element or pressing F2 will allow you to rename the element Ga fat Input Output Data ez bonus_card g bonus_points g Money_spent Ex weekday 5 Constant Data sb 271 CH WEDNESDAY Actions re ar dummyAction output Rule Tests e Bonus Points Test Figure 5 13 Rule Context palette Palette Item Description ET This button enables disables the display of type in
88. no weekend gE Auditorium 1 general seeting weekend gE Auditorium 3 coupon gE Auditorium 3 student gE Auditorium 3 coupon and student L Auditorium 1 special seeting no weekend CG Auditorium 1 special seeting no Weekend t Global Test Data Related Tasks e Section 4 11 7 Importing Test Cases 164 Bosch Software Innovations GmbH 163 270 Chapter 4 Tasks 4 11 7 Importing Test Cases Test cases can be imported from XML This is really useful in conjunction with automated saving of request data for a rule call It s possible to let the end user of your application press a button in order to save his data to a file that can be sent to the modelers This file can be imported into the test editor resulting in the creation of new test cases For technical details concerning the saving of the rule request data consult the section Saving Request Data in the Java Integration Guide In order to import test cases from an XML file execute the following steps 1 Click the amp icon 2 Inthe dialog that opens specify the relevant source files i e both the file to import the input data and the file to import the output data from If the file extension is not the usual vrdata you have to change the file filter Input and output data may be imported from the same file Import Testcase s B Specify the source Filets Now from every rule call saved in the file a test case has been created If
89. of a specific service type Visual Rules can be extended with custom service types to inter face with different systems or technologies e g to connect to legacy systems Related Concepts e Section 3 3 1 Rule Package Reuse 28 e Section 3 2 Rule Model 25 e Section 3 4 Flow Rule 29 Bosch Software Innovations GmbH 27 270 Chapter 3 Concepts e Section 3 7 Decision Table 48 e Section 3 16 Action 79 e Section 3 17 Action Type 80 e Section 3 13 Data 67 e Section 3 14 Data Type 71 e Section 3 18 Function 81 e Section 3 19 Service 81 e Section 3 20 Service Type 82 Related Tasks e Section 4 2 4 Creating a new Rule Package 95 3 3 1 Rule Package Reuse A rule package is a collection of interrelated rules Rules in a package can always call other rules from the same package or from sub packages thereof But in order to be able to call rules from other packages these other pack ages need to be explicitely defined for reuse Every rule package can define several other packages for reuse These packages can be from the same rule model or from another rule model You can find the reused packages on the Reuse Packages tab in the Properties view of Visual Rules H opertie XS Ee O 2g validation Rules Reuse Packages Input Output Data Mame Description Internal Data Business Object Model This rule model c
90. of the data types The first row shows the name of the el ement containing the data types The subsequent rows show child elements that also contain data types but are not data types themselves After that direct children of this el ement that are actually data types are shown You can edit cells in this column by dou ble clicking them only if they are data types or groups not elements that can also con tain something else than data types like rule models rule packages or rules Type The The type of the parameter You can edit cells in this column by double clicking them of the parameter You can edit cells in this column by double The type of the parameter You can edit cells in this column by double clicking them them column shows whether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 Col lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implemen
91. reused So in order to reuse a specific rule you may first have to setup the reused packages properly See Section 3 3 1 Rule Package Reuse 28 for details The Call Flow Rule element specifies the name of the rule being reused This name is displayed next to the ele ment like this Bosch Software Innovations GmbH 38 270 Chapter 3 Concepts Call the Customer Rating Rule Customer Rating The values for any required input of the called rule are also specified within the Call Flow Rule element This way rules can forward data from one rule to another In the same way any results coming out of the called rule can be assigned to data elements of the calling rule This is also specified within the Call Flow Rule element In other words the Call Flow Rule element calls another rule and handles all the data flowing to and from the called rule Input and output data is specified on the Call Flow Rule tab in the Properties view Related Concepts e Section 3 4 Flow Rule 29 e Section 3 3 1 Rule Package Reuse 28 Related Tasks e Section 4 3 15 Editing a Call Flow Rule Element 115 Related References e Section 5 6 2 5 Call Flow Rule 234 3 5 5 Call Decision Table A Call Decision Table element is used to execute the decisions of a decision table The decision table is execut ed and afterwards processing continues after the Call Decision Table element A flow rule may only call decision tabl
92. rule element requires one or multiple expressions that define what exactly this rule element should do Expressions are the instructions that are evaluated by Visual Rules when processing a rule Within such an ex pression you use operators data elements and functions to access data carry out arithmetic operations and make decisions Example 3 2 Simple expressions Be aware that for floating points the decimal separator is always a period regardless of regional set tings Use parentheses to influence the order of evaluation The 13 5 100 9 example from above first calculates the difference between 13 5 and 100 and then multiplies the result by 9 A different result occurs when the parenthe ses are left off 13 5 100 9 results in 100 being multiplied by 9 and the result of this being subtracted from 13 5 You can read more about the precedence of operators further down in this section Example 3 3 Further notations for numbers 8 3 percent notation 3e8 exponential notation Bosch Software Innovations GmbH 55 270 Chapter 3 Concepts Numbers with a percent sign are automatically divided by 100 So 8 3 0 083 Scientific notation is a short form for the multiplication of a number with a power of ten so 3e8 3 times 10 raised to the 8th power 300000000 and 2e 3 0 002 You can refer to the values of data elements input output internal constant in expressions simply by writing the name of the data eleme
93. select Delete from the context menu Alternatively press the Del key In the Properties on the Decision Overview or Decision Details tabs do the following 1 Select the condition in the list that you want to remove 2 Click on the button to delete the condition If the delete function is disabled either no condition is selected or there is only one condition remaining in the decision It cannot be removed because the decision must have at least one 4 3 10 4 Reordering Conditions in a Decision The conditions within one decision are processed in order from top to bottom To change this order you can move conditions up or down using drag amp drop 1 Click on the condition you want to move and keep the left mouse button pressed 2 Move the condition up or down to where you want it A black arrow indicates where it will be moved to 3 Let go of the mouse button and the condition is moved or copied if you hold the Ctrl key 4 3 10 5 Editing the Common Condition Prefix If all conditions start with the same prefix you can specify this as the condition prefix In the flow rule editor do the following 1 Double click on the condition prefix of the decision This is the expression displayed above the first condition An inplace editor will open 2 Enter the expression to be used as the common condition prefix Use Alt Enter to start a new line 3 Press Enter to close the editor or click with the mouse outside of the editor In
94. selected data elements are static This is only available for Internal Data When selecting multiple data elements of different kinds the tab will only show settings which the el ements have in common Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if there is at least one element available Pe Removes the currently selected element or group Bosch Software Innovations GmbH 243 270 Chapter 5 Reference Inserts another element to a collection list or set This is only available when the selected attribute is a collection list or set This column shows the name of the element You can edit cells in this column by dou ble clicking them Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them 5 6 6 2 Input Output Data Tab This tab shows a list of all the input output data elements defined on the selected rule model rule package or rule E Properties 2 Ei Problems 4 Tasks DI console ts Navigator gt e E OS Input Output Data Input Output Data Advanced H Name InputfOutpuk Required Default value Type Multiple Implementation Description Vz E
95. setting The else exit is always only executed if none of the conditions were true Related Tasks Bosch Software Innovations GmbH 34 270 Chapter 3 Concepts e Section 4 3 10 Editing a Decision Element 110 3 5 1 3 Common Condition Prefix The common condition prefix is placed in front of each condition and is helpful if all conditions refer to the same data element The prefix is optional and can be left empty The following example shows a logical use for the condition prefix T Each condition refers to the same customer age data element so this was specified in the prefix while the condi tions themselves just read gt 25 and gt 65 customer age 25 older than 65 years customer age gt 65 Here each condition is fully specified and refers to the customer age data element itself Related Tasks e Section 4 3 10 Editing a Decision Element 110 3 5 2 Assignments The assignment element is used for any type of computation the rule has to make Basically every assignment cal culates some value using a given formula and assigns the result of this calculation to a data element This is an example for an assignment total amount e order amount item price The data element that receives the resulting value is referred to as the left side of the assignment while the for mula is called the right side For the assignment total a
96. should be created Enable this to let Visual Rules automatically create any elements of this type you are re ferring to that do not exist yet Enable this so Visual Rules will never automatically create any elements of this specific type Related Concepts e Section 3 21 Auto Creation 82 Related Tasks e Section 4 10 3 Working with Auto Creation 159 Related References e Section 5 4 3 Auto Creation Dialog 218 5 7 4 Syntax Highlighting Preferences This preferences page contains settings for the colors used for syntax highlighting in expression editors Preferences syntax Highlighting General E Ant H Data Management Keywords Help H Install Update H Java Model Validation E Plug in Development Attributes 16 Report Design e Run Debug Actions H Team E Visual Rules Suto Creation Date Time Content Assist Dependency Management Functions Flow Rule Editor Syntax Highlighting strings Test Execution User Settings Colors to be used For syntax highlighting Internal Data Constant Data Input Output Data Numbers III Rules Restore Defaults Apply Figure 5 82 Syntax Highlighting preferences SCC Choose the color used for displaying keywords in an expression editor Bosch Software Innovations GmbH 265 270 Chapter 5 Reference a Choose the color used for displaying variables in an expression editor Choose the color used for displayi
97. state flow should be created You can click on the cor responding Browse buttons to select the rule model and rule package from a list If a rule model or rule package was selected when the wizard was started then the rule mod el and rule package settings will already contain correct values So the easiest way to create a new state flow is to select the rule package where the new state flow should be created and then start the New State Flow wizard You can also right click on a rule model or rule package and select New Element gt Sate Flow from the context menu That s the quickest way to create new state flows Enter a name for the state flow Press Finish to create the new state flow The state flow editor will open automatically Related Concepts Section 3 9 State Flow 52 Section 3 3 Rule Package 26 Section 3 2 Rule Model 25 Related References Section 5 2 4 New State Flow Wizard 202 Section 5 5 2 Project Explorer View 223 4 2 15 Deleting a State Flow 1 2 3 To delete a state flow right click on the flow rule you wish to delete and select Delete from the context menu Alternatively press the Del key Visual Rules will ask whether you are sure you want to delete the state flow Click on Yes The state flow is deleted Related Concepts Section 3 9 State Flow 52 4 2 16 Renaming a State Flow 1 To rename a state flow right click on the s
98. tab with data elements rs Reuse Packages Input Output Data Name Input Output Required Default Value Type Multiple Toer E Movie Ticket Pricing Constant Data Input Internal Data Actions E auditorium_no i Integer Data Types ly if bonus_card i BONUS Cap Extensions E coupon False Boolean Coupon is c LS seat_no i D Integer Number of E show date i z2000 1 1 Date Date of sho Notes P E student i False Boolean Visitor is as Permissions Be E gt Output Advanced Description EJ 3 a Turn off alphabetical sorting by pressing the according button Pricing Reuse Packages 1 Input Output Data DW A S K Mame Input Output Required Default Value Type Multiple I Ee Vz E Movie Ticket Pricing Constant Data e E Input Actions CG i coupon i false Boolean No Coupon is c Data Types x E show_date i 2000 1 1 Date Ho Date of sho Extensions a Ei seat_no i Integer Mo oe be GG audtorum mp i Integer No F E student i Boolean Mo visitor is as Holas a BR bonus card i BONUS CARD No Permissions E E output Advanced Be ja 4 Select each data element that you want to reorder and use the arrow symbols and to move it up or down Related Concepts e Section 3 13 Data 67 Related References e Section 5 5 1 Rule Explorer View 223 e Section 5 5 2 Project Explorer View 223 e Section 5 5 6 Properties
99. the Properties on the Decision Overview tab do the following L Double click in the condition column in the first row the decision to open an inplace editor 2 Enter the expression to be used as the common condition prefix Use Alt Enter to start a new line 3 Press Enter to close the editor or click with the mouse outside of the editor In the Properties on the Decision Details tab do the following 1 Select the first row the decision To the right you see the common condition prefix 2 Enter the expression to be used as the common condition prefix Bosch Software Innovations GmbH 111 270 Chapter 4 Tasks 4 3 11 Editing an Assignment Element An assignment element can contain one or more individual assignments The following sections describe how to add remove sort and edit assignments in an assignment element Related Concepts e Section 3 5 2 Assignments 35 e Section 3 12 Expressions 55 Related Tasks e Section 4 10 1 Using the Code Assist 157 Related References e Section 5 6 2 3 Assignments Tab 232 4 3 11 1 Editing an Assignment For each assignment within an assignment element you must specify a left side an operation and a right side ex cept for the CLEAR assignment which only has a left side In the flow rule editor do the following 1 Make sure the contents are displayed by activating the Hide Show Contents toolbar button 2 Double click the assignmen
100. the called rule may have fired This way actions can be considered one kind of output of rules Actions have a type The default type is Standard which is one of the built in action types Actions of type Stan dard do not have any special behavior when fired See the section about action types to read about other built in and custom action types Related Concepts e Section 3 5 3 Fire Action 37 Bosch Software Innovations GmbH 79 270 Chapter 3 Concepts e Section 3 17 Action Type 80 Related Tasks e Section 4 3 12 Editing a Fire Action Element 114 3 16 1 Action Settings Depending on the action type additional action settings may be necessary that are used to initialize the action These are specified on the Action Settings tab See the reference sections about the built in action types for fur ther details Write_Customer_File Standard Action Settings Description Action Write Customer File Type Write CS File Motes Pee File name Ci lvisualrulesfcustomer csv Overwrite existing File Column name Field separator i name score A Line separator CRLF a score P score T Character set windows 1252 Ka write column names Figure 3 15 Action settings of a CSVWrite action Related References e Section 5 6 7 3 Output message Action Tabs 250 e Section 5 6 7 4 Log message Action Tab 251
101. the editor Related Concepts e Section 3 10 State Flow Element 53 e Section 3 15 Description and Note 78 4 5 7 Editing a Transition Rule A transition rule i e the flow rule which a rule based transition is based on can be edited in the same way as any other flow rule A transition rule can be opened in the flow rule editor by double clicking on the icon e of the respective transition Related Concepts e Section 3 10 4 Transition Rule 53 Related References e Section 5 6 3 State Flow Elements 240 4 5 8 Copying or Moving a State Flow Element 1 Copying and moving single state flow elements is done using drag amp drop Select a state flow element and hold down the left mouse button Bosch Software Innovations GmbH 138 270 Chapter 4 Tasks 2 Drag the state flow element to its destination If you want to create a copy you must press the Ctrl key Other wise the state flow element is moved 3 Let go of the mouse button to drop the state flow element 4 5 9 Changing the Size of a State Flow Element e Select a state flow element and drag the frame into any direction There is a minimum size for a state flow element You can also automatically set a state flow el ement to its optimal size via the context menu Optimal here means just big enough to have the related description fully displayed 4 5 10 Deleting a State Flow Element Deleting a state also deletes all inc
102. the name and type of the exception attributes Cells in this column are read only Value The value you want to assign to this attribute You can edit cells in this column by dou ble clicking them Code Assist Ctrl Space is available Description The description for this row You can edit cells in this column by double clicking them e Somme This button will expand all elements so that all elemtents are visible pe Removes the currently selected value e Inserts another element to a collection list or set This is only available when the selected attribute is a collection list or set 5 6 2 10 Handle Exception Tab This tab is shown when a handle exception node is selected in the rule editor You can specify a data element that shall hold the exception for further processing C Properties F 7 D Handle Exception 1 f Handle Exception Description Assign value of Exception Element to Doo O OE G Notes Figure 5 52 Handle Exception tab C Assign value of Enter an expression that specifies a data element to which the value of the exception ele Exception Element mentis assigned Only exceptions of the data element s type are handled to 5 6 3 State Flow Elements The following properties tabs are available when state flow elements in the state flow editor are selected 5 6 3 1 State Tab This tab is shown when a state flow element is selected in the state flow editor It shows the
103. the new condition will be inserted Alternatively you can use the Insert key to add a new condition In order to add multiple new condition columns or rows to the decision table do the following 1 Select the Decide element in the palette by clicking on it 2 Now drag the mouse over an existing condition of the decision table A black arrow will appear to show you where the new decisions will be added Depending on the exising decision columns and rows this can be ei ther before after above or below an existing condition Accordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow press Ctrl and drop the element A dialog appears to allow the entering of the number of new condition columns or rows which will be inserted Enter the number as desired and press OK The conditon columns or rows are automatically inserted in the decision table Related Concepts e Section 3 7 1 Condition Column Row 49 Related Tasks e Section 4 4 2 Adding a new Decision Column or Row 125 e Section 4 4 3 Editing Conditions 126 e Section 4 4 5 Adding an Else Condition 127 e Section 4 4 8 Rearranging Condition Columns or Rows 129 4 4 5 Adding an Else Condition In order to add an else condition to
104. with very large flow rules Bosch Software Innovations GmbH 109 270 Chapter 4 Tasks 1 To collapse individual branches of a flow rule click on the minus sign a next to a rule element A collapsed branch is represented by a grey rectangle 2 Click on the plus sign m in front of the grey rectangle to expand the branch again You can also press the Space key to expand and collapse branches Expanding and collapsing branches is for visual purposes only The rule is not changed in any way Related Concepts e Section 3 5 12 Branch Description 44 4 3 10 Editing a Decision Element A decision consists of one or more conditions an else exit and an optional condition prefix All parts can have their own descriptions The following sections describe how to add remove and edit the different parts of a decision ele ment Related Concepts e Section 3 5 1 Decision 33 e Section 3 12 Expressions 55 Related Tasks e Section 4 10 1 Using the Code Assist 157 Related References e Section 5 6 2 1 Decision Overview Tab 230 e Section 5 6 2 2 Decision Details Tab 231 e Section 5 6 1 1 Description Tab 229 4 3 10 1 Editing a Decision Condition In the flow rule editor do the following 1 Double click on the description or expression of a condition This will open the inplace editor 2 Enter the description or expression for the condition Use Alt Enter to start a
105. you have to open the related rule or decision table in the editor after you run your test Make sure you have activated the statistics view by clicking on the dh icon elp E of x lues WIR AQ alo Je Pricing Test a The Pricing GE determines the price for lt amovie ticket o on athe basis of partes entered The following simple rules are taken into account wh e The movie theater has three auditoriums of different sizes and different distributions of general and special seating The base price for a movie is dependent on the size of the movie auditorium and seating location general or special seating A weekend surcharge is calculated for the two large movie auditoriums on weekends The small movie auditorium has a constant admission price and no difference between general and special seating j Auditorium No Which seat auditorium pp seat mo Special seating Audit No 1 Special 7 between 1 200 price 7 E E Day of week weekDayi show date Ee weekend Weekend surcharge in 46 7 price price weekend surcharge E E 5 You can see now an additional box next to each rule element which tells you how many times this element was passed during your last test run Elements which were not passed are displayed in grey 6 You can change the display of statistics with the drop down menu from the toolbar
106. you run a search and find a topic you were looking for click either the Refresh Show Current Topic button or Show in Table of Contents button i to match the navigation tree with the current topic You might also find it useful to synchronize after following in topic links Bosch Software Innovations GmbH 2 270 Chapter 2 Getting Started Chapter 2 Getting Started 2 1 Learning the Basics 2 1 1 Layout of Visual Rules Modeler The Visual Rules Modeler provides views and editors to model execute and test rules Figure 2 1 Overview Visu al Rules Modeler 3 shows the main Visual Rules views and editors Each view is a window you can close resize minimize or maximize You can also change the location of views or rearrange the set of views to fit the way you work Read the Eclipse Workbench User Guide for more information about working with views and perspectives Rule Explorer i Rule Test Editor Toolbar Perspective Sj Le Tubia First Puke Tutorial First Rule ES Bu Bed CB igea Data E Ce Tee EE rete Copie Si Pe Figure 2 1 Overview Visual Rules Modeler The menu gives you access to many features of Visual Rules and the underlying Eclipse plat form Toolbar The toolbar contains icons for common tasks Availability of icons depends on the selected perspective and selected view or editor same time Rule Explorer The Rule Explorer is the central view for w
107. you want to reorder the assignments in your assignment element you do this by either 1 Selecting the particular assignment in your assignment element and use the and buttons in the Proper ties on the Assignments tab OR 2 Use the drag amp drop functionality of the flow rule editor by selecting an assignment in the particular assign ment element and drag it to the correct position in the assignment list 4 3 12 Editing a Fire Action Element Different settings for an fire action element may be necessary depending on the action type of the action In the Properties of the fire action element on the Fire Action tab do the following 1 Inthe Fire Action field specify the action that should be fired Press Ctrl Space for content assist or click on to choose the action from a list of available actions 2 Ifyou leave the Fire Action field the view changes and the action specific settings appear 3 Insert the action specific settings These settings apply only to the selected Fire Action element and are used when the action is fired at this location in the rule For example these are the Properties of a Fire Action element that fires the action price_output of action type Output message Fire Action 86 a Fire Action Description Fire Action price_output om Motes Qutpuk expression The price For the movie ticket is amp janice ke Related Concepts
108. 09111955 7C7_EVBE_E Gok WST Common UI 3 0 2 v200009102124 7C7SELYEBH Gk WEST XML Core 3 0 2 200809120241 7A7NEGZEFS G WST XML User Documentation 3 0 2 2006091 20245 40E1J_KEF c sst XML Schema Definition Rurti 2 4 1 v200808251517 GP KSD Edit 240 v200806251517 directories named Features Features may also include other Features Induded Features Files named Teeture md may contain a list of the names and version numbers of I accept the terms of the lense agreements I do mot accept the terms of the license agreements 5 After downloading the installation of the software starts At the end of the installation the dialog Software Up dates appears to request the restart of eclipse Confirm the dialog by clicking on Yes and Eclipse restarts gt Software Updates effect For some add ons it may be possible to apply the changes you hawe eh Is strongly recommended you restart the system For the changes to take I a j made without restarting Would you like to restart mow If you need a new license please save the license file from our e mail to your hard disk and import the new license file with Visual Rules License Manager A short dialog will prompt you to restart Visual Rules for the changes to take effect After that your installation is complete and you are able to work with Visual Rules Second way to update Visual Rules with Installed Software 1 Use the Help gt Sof
109. 1748 4 2 2 ve0080828 1748 4 2 2 VELUDUDCG 174i 4 2 2 ve0000825 1749 4 2 2 ve0000825 1749 4 2 2 ve0080825 1748 4 2 2 Ve0080R28 1 748 9 2 2 Ve0080825 1 743 4 2 2 ve0080R25 1748 4 2 2 ve0080823 1748 4 2 2 ve0080E20 1748 4 2 2 ve0080825 1748 4 2 2 ve0080825 1748 4 2 2 ve0080823 1748 4 2 2 ve0080826 1748 4 2 2 EE Cl E iE 4 2 2 E EE 743 NEE Ke 4 2 2 CLU UDBCG L Z99 4 2 2 ve0000829 1748 ao 3 AWN TA Chapter 4 Tasks Visual Rules 3 Legacy Libraries E already installed a se OE EA bla ten Visual Rules 3rd Party Libs is already installed so an update will be performed instead Visual Rules Java is already installed so an update wall be performed rotes Visual Rules Documentation is already installed so an update will be performed instead nana grasa fe Lo s Noor erg 0 an update wil be performed instead Visual Rules Execution is already installed so an update will be performed instead Visual Rules Java Generator is already installed so an update will be performed instead Visual Rules Core Expression is already installed so an update wil be performed instead Visual Rules Walidation is already installed so an updabe will be performed instead Visual Rules Java UI is already installed so an update wil be performed instead Visual Rules Core Resource is already installed so an update will be performed insbead Visual Rules Core UL is already installed so an update will be performed instead Visual Rule
110. 2 Related Tasks e Section 4 10 3 Working with Auto Creation 159 Related References e Section 5 7 3 Auto Creation Preferences 264 5 4 4 Select Dialog The Select dialog is used to select rule model elements It appears whenever you click on any of the browse buttons found in many places e g when you select a data type for a data element the action to fire in a Fire Ac Bosch Software Innovations GmbH 218 270 Chapter 5 Reference tion element or a rule in a Call Flow Rule element The dialog is also available via the Select context menu entry wherever rule expressions are entered Select Select SE e E S Example Rules GD aaa S Rules 6 D BBE gt Execute Command Action El Movie Ticket Pricing eS Ciscounts 5 Pricing gt Tutorial Database User Defined Functions S Convert Fahrenheit to Celsius E User Manual Description The Discounts rule calculates the discounts the movie goer is eligible For two dollar discount applies to students For every movie If the movie goer submits a coupon he gets a one dollar discount However this coupon cannot be used in combination with a student discount i e either a student discount or a coupon discount is given Figure 5 24 Select Dialog Enter the beginning of the name of the element you want to select This will filter the list so that it only shows elements with matching names Initially the list will not be filter
111. 4 Palette Price Calculation for the Rental of a Car oi Rule Context S i fy Select eege G ET at usiness Rules i 7 Zoom dE Input Output Data 4 4 r Decision car_group L 4 Add Note Add a note Is the car group of the rented car compact or not E Ser 2 Describe Branch Add a Is the number of rented days 1 day or more l sae description to a whole 3 CH Calculation ig price branch ps ne Keen a i The price for car group compact is 50 for other car groups it is 60 Decide Make a decision IF the car was rented more than 1 day there is a discount of 5 allowed on the price per da Kl Internal Data ate E Assign Calculate values laction amp Constant Data ar and update data A brochure with special offers should be sent to customers who got a discount on the price G2 compact ki ite e Fire an E ig Full_size D Call Flow Rule call Is the rented car of Car Group C Actions ae enn decoumt allowed another Flow rule Call Decision Table Cal gt gt compact No discount allowed send_brochure small car 4 decision table 8 Services oe IA i l F4 Call Service Call a The price for i service this car is 50 Rule Tests Si E Done amp Return o Immediately return to the calling rule l Repeat Repeat the Following part of the Flow How long was the car rented eet mid size full size 1 day dl End Repeat Immediately it or luxury exit a R
112. 48 Related Tasks e Section 4 4 14 Adding a new Exception Column 132 Related References e Section 5 3 2 1 Decision Table Editor Palette 207 3 8 Decision Table Editor The decision table editor is used to view and edit a decision table Most of the decision table authoring process takes place here The editor is opened whenever you double click on a decision table e g in the Rule Explorer Multiple decision table editors can be open at the same time DON Poin EA e DI EE 4 Palette Rule Context m Select cT at Zoom St Input Output Data F E Bonus_Points _ Box Select Select multiple CG auditorium_no cells Decide Add a new Be condition column or row G price Else Add a fallback CG seat_no condition CG show_date Assign Add an assignment student cel dE Constant Data ESA Fire Action Add an action column E coupon_discount E student_discount amp weekend_surcharge actions sp 2 coupon_discount_granted e eneral seating special_seating eo student_discount_granted DS weekend surcharoe added Rule Tests EE e Bonus Points Test lt Return Exception Add an exception column Figure 3 7 Decision Table Editor The decision table editor is a sophisticated graphical editor with a tool palette drag amp drop capabilities zoom and inplace editing functionality In
113. 5 Me MD EIDEN 186 4 19 1 Printing a UE 186 4 20 Working with the User Interface eenegen Age EE aeren EE ee ege 187 4 20 1 Switching een 187 4 20 2 Customizing Perspectives and VIEWS tee Eege 187 420 3 elle 188 4 21 SENGINE a SUPDOIL REQUESE GE 188 4 22 Updating a new Version of Visual Hues 190 423 Upgrading Visual R les Models EE 196 5 RO E ET EES e e Ee 197 5 1 1 Rule Modeling Perspective cccc ccc esceeeceecteeceeeceeeceeesseeseeeseeeseeseesseesteesseesseesteeseeestenseeeees 197 Dez RUE MMe eration PeISD OCU E 198 5 1 3 Debug Perspective ccc ccc cece cece ese eecteeceeeseeeseeeseeeeeesteeseeeeeseesseeteeseeteesteesseectecstecseeeges 199 De VIZ ANS EE 200 5 2 1 New Rule Project Wizard sccsncuswosndterwvsaceasesinadusuesicaieecsuns bodeveenssesseenawernseesauowsina esuissieediocesebasveussoans 200 B22 NEW RUC Oe WNIT aeres nace sess E E E EE E EEE E EEE 201 5 23 NOW RUIG WIZA EE 201 BA NEW state FOW NIZO EE 202 Bosch Software Innovations GmbH xi 270 Modeling Guide B25 NEE Ee 203 5 2 6 Generate D cumentation Wizard eren 203 WO E OO a E E E E E EE E E E E E 205 Daie FOW EE e EE 205 Do dls FIOW ROC ele P al Weeg secsadecarcsestcaeeancessescetenresso acase aedsnstaecesseta esa ecasoemieeessseecae 205 Do e RUE OMe E We E E E TE S E E A A E A 206 D 2 IDCCISION Table EOT eege 207 5 3 2 1 Decision Table Editor Palette E 207 E EE E EE ee 208 O33 state RAON e e 209 Doky Stale WOW Er EEN
114. 7 Call Service This tab is shown when a Call Service element is selected in the rule editor Here you specify the service you want to call including any necessary input data Additionally you specify what to do with the output data returned by the service Bosch Software Innovations GmbH 236 270 Chapter 5 Reference E Properties E gt St EN Call Service Call Service Call Service aet_Movie_Information Description Motes mm P advanced SE Input Data Value Output Data Assign To za movie String GodFather E actors Actor List actors fea description String movieDescription GC 3 premiere Date Figure 5 47 Call Service tab om rem Call Service Enter the name of the service that you want to call Code Assist Ctrl Space is avail able Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if at least one element is available e Inserts another element to a collection list or set This is only available when the selected input data element is a collection list or set pe Removes the currently selected value for an input data element CG This button automatically inserts data elements as input data when they have the same name and type Only inputs still without a value will be affected e This button automatically inserts data elements to assign the outputs to when they have the same name and type Only outputs not yet
115. Action Column In order to add a new action column to a decision table do the following Option 1 1 Select the Fire Action element in the palette by clicking on it 2 Now move the mouse over an existing blue column header A black arrow will appear to show you where the new action column will be added This can be either before or after an existing assignment action or excep tion column Accordingly the black arrow will point to the left or to the right Move the mouse until the arrow points into the direction you want BETWEEN 1 200 auditorium _no Bous Points Ss a CR A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and the new action column will be inserted Option 2 1 Select an action from the Rule Context palette and drag it 2 Now move the mouse over an existing column header A black arrow will appear to show you where the new action column will be added This can be either before or after an existing assignment action or exception col umn Accordingly the black arrow will point to the left or to the right Move the mouse until the arrow points in to the direction you want A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow drop the action and the new action column will be inserted The action is auto matically inserted in the action column header
116. CONCCHOM FON UON EE 61 3 121514 COMING Of ee E 62 G2 Mee Sear MIC EIERE 63 3 12 15 3 Searching for maximums ANd MINIMUMS c cece cece eee ec ees eee eenseeeeesenseeeeensenseeaeeeseeseeenens 63 Sal 2 14 gt FEE e e EE 64 3 12 15 5 CONVENING Collections ccs vcsncorcwcteclesauvensteuctendencctas e r EIEEE TE ETET EENE ETEEN TEA 64 A ER E ellen lte de 64 3 12 16 Map Operators EE 64 GAZ ae MP E ie end e 65 Be be Oy mew e E d EE 65 CAPA Ee esto ea 0 lt 1 o E 66 3 12 20 Operator Precedence cccccccecec cence eenceeesceeeseeeeseeeeseeeeeeeesseenseeesseeenseeenseeesseeesseeesseeesseeess 66 E E E 67 3 13 1 Common Data eent 68 IA D RE 69 E e EE eege 69 EE Ee RE 70 Boe Datos VE e EENE E E EENE EA E EAEE N O E EE 71 EE EE 71 AALE EE 72 AA eer EE 12 e E BOO EE 73 CN DANG E A A E E A S E A E E S ET E A E ATE 13 E Aa K NOs Vin 73 Sarees MINE Tue EE 13 Bosch Software Innovations GmbH v 270 Modeling Guide AA EE EE Ee 74 Bo er 74 KE SUDEW WY OCS a A EE E EE E A A E A E A 15 204 5 ENUNT O sirudureeresaucnesacediwsbasciawnienatsuntecsscsm ima sruntenelavedawentuatennnenouens E E 76 OO e een WEE 76 E e Oe WEE 76 EE 18 3 15 Description ANd Note 78 SO ed EE 19 so LACON OC WINE eeit EE snteaakdewsonaveseiencesasedaaias lt dles baeeweanain cain nudes segbenusnabedentscatucesensecienns 80 BIT ce O EE 80 SE Ter ee ME 81 ele 81 2s ENCE VVC E 82 S221 AMMOCE ION enee 82 3 22 Rule TESTING cece ce
117. Conditions are always located at the left side or at the top of the decision table Conditions at the left side are oriented in a col umn vertically while conditions at the top are oriented in rows horizontally There can be any number of condition columns rows next to each other Each condition column row consists of the condition header and several conditions one of which can be a special else condition Condition columns rows are added to an existing decision table with the Decide tool in the palette or by dragging an input data element from the Rule Context palette Related Concepts e Section 3 7 Decision Table 48 Related Tasks e Section 4 4 2 Adding a new Decision Column or Row 125 Related References e Section 5 3 2 1 Decision Table Editor Palette 207 3 7 2 Assignment Column An assignment column in a decision table is used to specify values in its cells that are being assigned to the data element in the column header In other words the assignment column contains the values that are the output or one of several outputs of the decision table The selected cell is determined by the conditions specified in condi tion columns rows Assignment columns are added to an existing decision table with the Assign tool in the palette or by dragging an output data element from the Rule Context palette Related Concepts e Section 3 7 Decision Table 48 Related Tasks e Section 4 4 6 Ad
118. Data F t D Q Zoom amount Float C Add Note Add a note s d Zoe aL on choose_coffee insert_coin coffee String E p GB State Add a State gt en gt gt s End State Add an End State Coffee_chosen JM Transition Make a Transition switch_off insert in return a Campan amount Payment_not finish_brewing d t ayed_amoun r BB lt new_cup Payment _ sufficien went Figure 3 12 State Flow Editor The state flow editor is a sophisticated graphical editor with a tool palette drag amp drop capabilities zoom and in place editing functionality Inplace editing means that many things can be edited right within the graphical display Some other settings for each state flow element can be edited in the Properties view The Properties view always shows the settings for the currently selected state flow element When changes have been made to a state flow the state flow editor will indicate this by displaying an asterisk in front of the state flow name shown in the editor s tab Clicking the lal button or pressing Ctrl S will save these changes 3 11 1 State Flow Editor Palette The state flow editor has a palette from which the user can select new state flow elements to be inserted into the state flow The palette also contains tools for zooming and adding notes The palette can be collapsed and expanded by clicking on the small black arrow in the title bar of the palette
119. H 62 270 Chapter 3 Concepts Example 3 13 Sorting collections Sorting numbers by their value THIS SortAse 8 2 4 3 6 THIS 4 3 6 8 2 sortDesc 8 2 4 3 6 THIS 8 2 4 3 Sorting strings by their length length THIS sortAsc longer very long tiny length THIS Sorting customers descendingly by their account balance This will only work if the elements of the customers collection have a balance attribute sortDesc customres THIS balance In the last example we could also omit the keyword THIS sortDesc customers balance 3 12 15 2 Searching Collections The exists and forall functions test if a certain condition is fulfilled by at least one or all of the collection s ele ments respectively The condition is specified by an expression and must return a boolean value exists returns true if at least one element fulfills the condition fora11 only returns true if all elements fulfill the condition Sim ilarly the count function determines exactly how many elements fulfill the condition Example 3 14 Searching collections Yes there is one number greater than 5 exists 8 2 4 3 6 THIS gt 5 true but not all numbers are greater than 5 forall 8 2 4 3 6 THIS gt 5 false Is there a customer with a balance greater than 10 000 exists customers balance gt 10000 Are all cust
120. Je Contents W CalliAssignment Details Je Notes v Statistics W Exception Handling with Details of Rule Elements Jh Overwrite existing documentation Jh Open generated documentation Figure 5 9 Generate Documentation wizard a Select the element Here you select the rule model the rule package state flow or rule that you want to cre to generate the ate the documentation for If you select a rule model or a rule package the documenta documentation tion will include all the sub packages The selection will be set automatically when a rule model package state flow or rule was already selected when the wizard was started The list only includes rule models that have been opened Target Directory Enter the path of the directory where the generated documentation should go Click Browse to open a file browser Either select HTML for display in a browser or PDF for display in a PDF viewer for exam ple Adobe Reader Template The report template to use for the generated documentation This determines what infor mation will be included The language of the generated documentation Image Check all the informations that the images of rules should contain You can select De scriptions Contents Call Assignment Details Notes Statistics and Exception Han dling Bosch Software Innovations GmbH 204 270 Chapter 5 Reference eon eso with Details of Whether the documentation should include detailed information about indi
121. O VG ei er keng T bees D x oO bess o 2 5 D Priority Operator Meaning 14 Highest precedence with parentheses KA 3 Attribute access NO O l List element access per index first element has index 1 H H THIS Element access within collection functions 10 Type conversion w U D unary Negation Any Float Integer NOT Logical negation Any Boolean AVAILABLE OF Checks if an input data element has a value NAMEOF Returns the name of a data element Multiplication Any Float Integer Division Any Float Integer Whole number division Any Float Integer w H lt MOD Remainder of whole number division Any Float Integer Addition Any Float Integer Subtraction Any Float Integer INTERSECT Intersection of collections Concatenation Any String Less than Float Integer String Date Time Timestamp Greater than Float Integer String Date Time Timestamp Less than or equal to Float Integer String Date Time Timestamp Greater or equal to Float Integer String Date Time Timestamp BETWEEN Checks whether a value lies within the specified interval see below Number String Date Checks whether a value is present in a collection zZ isA Checks whether a value is of a specific type Equals operator A V Not equals operator AND Logical AND operation Boolean Logical OR operation Boolean 3
122. ORG te ime Open ES Movie Ticket Pricing J I Run Ae Debug As d 3 Delete Delete Rename Fz You can also open the Decision Table Editor for a decision table that is referenced in a call decision table element To do so press the Ctrl key and click on the reference in the Decision Table Editor Related Concepts e Section 3 8 Decision Table Editor 50 e Section 3 7 Decision Table 48 Related References e Section 5 5 2 Project Explorer View 223 4 4 2 Adding a new Decision Column or Row In order to add a new decision column or row to the decision table do the following Option 1 1 Select the Decide element in the palette by clicking on it 2 Now move the mouse over an existing yellow condition header of the decision table A black arrow will ap pear to show you where the new decision will be added Depending on the existing decision columns and rows this can be either before after above or below an existing decision Accordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want Bosch Software Innovations GmbH 125 270 Chapter 4 Tasks SE Ge Sp A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and the new decision column or row will be inserted Option 2 1 Select an input data element from the Rule Context palette
123. Runtime amibeans Figure 5 27 Select Dependency Dialog Dependency Add Dependency Figure 5 28 Dialog to define a new Dependency Select Dependency Beschreibung Dialog element Opens the dialog Dependency to define and a add new currently unknown library as de pendency Related References Section 5 3 6 Rule Project Editor 214 5 5 Views The user interface of Visual Rules consists of several views that are arranged next to each other The following sections describe the different views available in Visual Rules Bosch Software Innovations GmbH 222 270 Chapter 5 Reference 5 5 1 Rule Explorer View The Rule Explorer lists all the projects in the workspace and their rule models It hides away technical elements especially any Java specific elements That is why the Rule Explorer is used in the non technical Rule Modeling perspective El ES Movie Ticket Pricing S Movie Ticket Pricing ER Input Outout Data ER Constant Data ER Actions a Data Types ER Bonus Points S Discounts H t Pricing E ruleproject vr Figure 5 29 Rule Explorer view Description Collapses all expanded elements in the resource tree B Determines if the view selection is linked to the active editor When this option is selected changing the active editor will automatically update the Rule Explorer selection to the re source being edited Determines if data types of rule model elements are disp
124. SC weekDayt show date SC weekDayishow date Show as Tree Shows all found elements in a hierarchical view It always starts out from the rule model Use this view if you have many matches in a workspace with many models or rules ah A T a m ya Searching For date 3 matches a Movie Ticket Pricing ER Input Output Data SES Input fa show date i Pricing E lt gt Day of week SC weekDay show date E lt gt Day oF week SC weekDayt show datet e f you double click on a match in the Search view the related rule editor or Rule Explorer opens automatically and the correct item is selected Use the button to run the current search again With the button you Can open previous searches If you want to keep one search result shown even if you search for another element use the button to pin the search view If you execute a new search a second Search view will be opened and the new result will be displayed in it 4 15 Highlighting a referenced Element in the Rule Explorer You can highlight an element which is being referred to e g in the Flow Rule Editor or in the Properties View in the Rule Explorer This applies to data types data elements actions and services Bosch Software Innovations GmbH 179 270 Chapter 4 Tasks To highlight a referenced element press the Ctrl key and click on the relevant reference If the reference is contained in an editable field e g
125. Service 236 4 3 18 Editing a Return Exception Element In order to edit a Return Exception element open its Properties and select the Return Exception tab and do the following 1 Either select the Exception Element option or the Create Exception Element option The first option lets you specify an expression defining the returned exception element This is useful when the exception element is already available for example in a data element The second option is used when you want to create a new exception element 2 If you select Exception Element enter an expression to specify the exception element If you select Create Exception Element select an exception Type and then insert the values for the excep tion attributes Return Exception D Exception Element Notes Co Create Exception Element Type GeneralException Gal Attribuke gt Value Description message String Invalid input values Related Concepts e Section 3 5 10 Return Exception 42 Bosch Software Innovations GmbH 118 270 Chapter 4 Tasks e Section 3 14 6 Exception 76 Related References e Section 5 6 2 9 Return Exception Tab 239 4 3 19 Editing a Handle Exception Element In order to edit a Handle Exception element open its Properties and select the Handle Exception tab and do the following e Inthe Assign value of Exception Element to field insert the name of the data element that should be as s
126. Software Innovations GmbH 144 270 Chapter 4 Tasks 4 6 6 Specifying the Default Value of a Data Element Insert a default value of a data element in the Properties of the data element 1 Double click the data element to open its Properties 2 Insert the default value of the data element in the column Default Value 4 6 7 Deleting Data Elements On the Rule Context palette in the rule editor 1 Select the data element that you want to delete 2 Click on the button in the corresponding section of the Rule Context palette In the Rule Explorer 1 Select the data element in the Rule Explorer 2 Right click and select the Delete entry from the context menu or press the Del key On the Properties tabs Input Output Data Internal Data Constant Data tabs 1 Select the rule rule package or rule model in the Rule Explorer where you want to delete data elements 2 Inthe Properties view activate the according tab either Input Output Data Internal Data or Constant Da ta 3 Select the data element in the list 4 Click on the button to delete the data element Related Concepts e Section 3 13 Data 67 4 6 8 Copying Data Elements If you would like to copy a data element do the following 1 Right mouse click on the element to be copied and select Copy from the contextual menu that appears Alter natively you can select the element and use the Ctrl C key combination 2 Right mouse click on the tar
127. Special 7 Audit No 1 General 5 Special seating a Daora 37 0 General seating d 0 01 H 25 0 85 270 Chapter 3 Concepts Due to the nature of the Java virtual machine JVM individual execution times for the same rule may differ largely Most specifically the first call to a rule is usually way slower than the second by a magnitude of 1000 or more This is because the JVM does additional things incl class loading when it executes code for the first time The JVM further optimizes code when it is executed repeat edly HotSpot compiler so the performance increases over time The precision of time measurements possible with a specific Java VM can also have a great effect Most importantly you should use a Java 1 5 VM instead of a 1 4 VM because the 1 5 API offers nanosecond resolution while 1 4 offers only milliseconds So the displayed execution times during tests should not be used to estimate execution times during production 3 22 4 Test Suite A test suite is a collection of tests that can be executed together A test suite can consist of any number of rule tests and nested test suites When the test suite is executed all test failures of contained rule tests are displayed Test suites are defined edited and executed with the test suite editor Related Concepts e Section 3 22 5 Test Suite Editor 86 3 22 5 Test Suite Editor The test suite editor is used to define and edit t
128. TU 103 7 3 1 Opening Me Fow Rule Ten 103 4 3 2 SAVING CHAnges cccc cece ccc enccencceneeeneeeneeeneeesseesseesseesseeseeesseesseesteesteesseesteeseeseeeseeesteeneeees 104 43 3 Navigating in the Flow Rule EdItOr Seege ageet ee tege eege 104 433 1 Keyboard NAVISAUON E 104 TSG Eed ie E 105 D SE een 105 4 3 3 4 Collapsing Expanding Branches eg eege Been ee gedreet ee ae 105 4 3 4 Configuring the Appearance and Capabilities of the Flow Rule Editor ccc cece ccc eeeeeeeeeneeeneees 105 4 3 5 Extracting a branch of a Flow Rule as a new Flow Rule ccc cece cece nce enceenceenseenseenseenseenseensees 106 4 3 6 Extracting a branch of a Flow Rule as a new Decision Table 107 4 34 Adding New Flow Rule Elements cctcierccleriegcessusersceieacnetestanindessensabcauninttereedintdneednleaerseabunewess 108 4 3 8 Editing Descriptions of Flow Rule Elements 109 WO 9 GONANSINe EE ee 109 4 3 10 Editing a Decision Element 110 43 10 11 Editing a DECISION Condition 2 2cceededecerecsedeceedediedbeceubcenedenbecavciahianededeedbceuhcapeiuneesuesiahiawedenees 110 4 3 10 2 Adding a Condition to a Decision cece cece cece nc eenceenceenceenseeseeenseeneeenseesseeseeegeeesseesseegeegs 110 4 3 10 3 Deleting a Condition from a DECISION c cece ccc e eee ec cence eneeeneeenseenseeneeenseenseenseenseenseenseensees 111 4 3 10 4 Reordering Conditions in a Decision c cece eee cece cence eneeeneeenseenseens
129. Time ff addMinutes Timestamp timestamp Integer minute Timestamp ff addMonthsiDate date Integer months Date addDays 1999 12 12 10 1999 12 22 The 12 December 1999 plus 10 days evaluates to 22 December 1999 fij addMonthsi Timestamp timestamp Integer month Timestamp fij addSecondsi Time time Integer seconds Time i fra og Pe ial See ee E nee et ew Om Met EN Cin eng en vous ay Pere hy stn e ET EE atime ees cre ee Gi il gt Figure 3 16 Functions in the Content Asisst A function can define zero one or more parameters that need to be specified when the function is called A func tion returns a result All parameters and the result are of a specific data type For example the function addpays shown above has two parameters a Date and an Integer The result is a Date Visual Rules can be extended with user defined functions Related Concepts e Section 3 12 7 Calling Functions 58 3 19 Service A service is some functionality external to Visual Rules Services can be called by rules using the Call Service ele ment e g to fetch additional data or to trigger external processes A rule can pass data to a service and read any results the service may produce Therefore every service defines input and output parameters and their types A service is identified by its name Services are in a way similar to actions However actions can only have input parameters and don t return data while service
130. Visual Rules Suite Modeler Modeling Guide Version 5 4 Bosch Software Innovations S Americas Asia Europe Bosch Software Innovations Corp Bosch Software Innovations Bosch Software Innovations GmbH 161 N Clark Street c o Robert Bosch SEA Pte Ltd Ziegelei 7 Suite 3500 11 Bishan Street 21 88090 Immenstaad GERMANY Chicago Illinois 60601 USA Singapore 573943 Tel 49 7545 202 300 Tel 1 312 368 2500 Tel 65 6571 2220 info de bosch si com info bosch si com info sg bosch si com www bosch si de www bosch si com www bosch si com Modeling Guide Version 5 4 Visual Rules Modeling Guide Version 5 4 Copyright 2004 2012 Bosch Software Innovations GmbH Bosch Software Innovations GmbH 2004 2012 All rights reserved Dissemination or reproduction of this publication or any part of it for any purpose or in any form whatsoever is not permitted without the prior express written consent of Bosch Software Innovations GmbH Information contained in this publication may be subject to revision without advance notice MLDS Visual Rules and Work Frame Relations are registered trademarks of Bosch Software Innovations GmbH BOSCH and the symbol are registered trademarks of Robert Bosch GmbH Germany Some of the product and company names used in this document are trademarks and or registered trademarks They are used explicitly for reference purposes and are independent of marking prop erty of their respective owners Modeling Guide
131. a Structure Data 4 16 3 Working with the Compare View e At the top of the Compare view the Structural differences are shown If you double click on a change the rule element that has been changed is shown below If you compare with history the current rule version is shown on the left side and its earlier version on the right side You can switch between the Structure and Data tabs at the bottom of the view The Structure tab graphically shows the rule structure and the Data tab shows data elements actions types etc defined by the rule Bosch Software Innovations GmbH 182 270 Chapter 4 Tasks d 5 PE Spuer ZE die eelere SE SL S Structural differences El Te 6 changes overall S Attribute name in Flow Rule Discounts has changed From Discounts to Discount Movie Might 3 Sie Rule Variation Discounts has been removed Sr Description has been removed ce Rule Variation Discounts has been added G i Description has been added Ea Constant Data movie night discount has been added 8 Rule Compare GQ ie E ke CIE ES Lol SC SS db ar Movie Ticket Pricing Movie Ticket Pricing Discount Movie Night yrrule oS Movie Ticket Pricing Movie Ticket Pricing Discounts vrrule ia S Discount Movie Night S Discounts E Constant Data Discounts a movie night discount Ss Discounts Skrue Structure Data Structure Data Use th
132. a SSL nection SSL The corresponding Fire Action tab is shown when an invocation of the action is selected in the rule editor You can configure the contents of the e mail here Bosch Software Innovations GmbH 252 270 Chapter 5 Reference F IDET Sch eech Der dg KG SE EL Be 3 Fire Action 5 Fire Action l Description Fire Acten Eat y y O Notes From To customer email Subject ACME Newsletter Text Dear amp customer greeting amp ere is the ACME newsletter For August 2007 Figure 5 68 Fire Send e mail Action tab O omon O a Fire Acten Enter the name of the action that you want to fire Code Assist Ctrl Space is available From Enter the expression describing the from address of the e mail Enter the expression describing the to address of the e mail Subject Enter the expression describing the subject of the e mail Enter the expression describing the text of the e mail 5 6 7 6 Write CSV File Action Tabs This tab is shown when a Write CSV File action is selected Here you can configure the layout of the CSV file that will be written WriteCustomerToCsy Write CSV File Action Settings Description Action MWriteCustomerToCsy Type write CSV File LL Motes Advanced File name customerdatafcustomerData csv Browse C overwrite existing File Column name Field separator customerhame Soo Line separator
133. ab 240 3 5 12 Branch Description Branch descriptions are used to describe a whole rule branch instead of just individual elements This is often use ful to structure and describe a rule on a larger scale When a branch description is added to a rule element a box is drawn around the branch rooted at that element The branch description itself is then written across the top of that box Weekend surcharge m Day of week weekDayishow date SE SN et d Weekend surcharge SSC price price weekend surcharge Weekend surcharge added weekend _surcharge_added Related Tasks e Section 4 3 25 Adding a Branch Description 121 e Section 4 3 26 Deleting a Branch Description 121 3 5 13 Notes Rule elements can have notes attached to them All notes are displayed to the right of the rule and a line connects them to the rule element d Volker This should be a separate 5 discount allowed calculation rule to be reused on the price per day 5 discount is allowed per day more than 1 day The price is 60 5 discount per day Price with discount Send brochure with special offer Notes are meant to be used to leave editorial remarks for yourself or for others involved in the rule authoring pro cess For that purpose every note shows the name of the user who created it On the Notes properties tab you can also see timestamps for every note indicating when it was created
134. ackage or rule model in the Rule Explorer where you want to define a structure 2 Right click the element and select New Element gt Structure in the contextual menu that appears 3 A dialog appears for you to give the new structure a name 4 Click on OK to create the structure It appears in the folder Data Types in the Rule Explorer Related Concepts e Section 3 14 3 Structure 74 Related Tasks e Section 4 7 2 Defining Attributes of a Structure 151 Bosch Software Innovations GmbH 150 270 Chapter 4 Tasks 4 7 2 Defining Attributes of a Structure To define Attributes of a structure in the Rule Explorer do the following 1 Select an existing structure to which you want to add attributes 2 Right click on the structure and select New Element gt Attribute in the contextual menu that appears 3 A dialog appears for you to give the new attribute a name 4 Click on OK to create the attribute under the structure It appears in the folder Attributes under the Structure folder in the Rule Explorer 5 Insert the data element settings for the attribute In order to define Attributes on the Attributes tab in the Properties of the structure do the following 1 Click on the button to add a new attribute to the structure 2 Inserta new name for the inserted attribute 3 Insert the data element settings for the attribute For deleting an attribute select it and click on the X button Related C
135. action Code Assist Ctrl Space is available Category Enter the category to which you want to log here Log rule name and Check if you want information on the path to and name of the executed rule and the rule rule element ID element ID to be added in front of the log message The corresponding Fire Action tab is shown when an invocation of the action is selected in the rule editor You can specify the log priority and message here Bosch Software Innovations GmbH 251 270 Chapter 5 Reference Fire Action Description Fire Action Log Lu Notes Expression Infrared device Failed Figure 5 66 Fire Log message Action tab a Fie Acton Enere rame ofthe acten at you wart to fre Code Assist Space ash Enter the expression you want to log 5 6 7 5 Send e mail Action Tabs This tab is shown when a Send e mail action is selected Here you can specify what server to use for sending the e mails E Properties 3 a e en newAction Send e mail Action Settings Description Action eich Type Bend e mail JG Notes Server SMTP Server Port default 25 Security _ Use Authentication User m Password C Use secure connection 55L Figure 5 67 Send e mail Action tab C fasion mm Use Authentication Check if you want to authenticate yourself Password Enter your password Use secure con Check if you want your e mails to be sent encrypted vi
136. age In the bottom left corner the name of the previous page is dis played beneath the button if the current page is not the first page in the document This button directs you to the next page It is displayed both on the upper right and on the bot tom right corner of every page In the bottom right corner the name of the next page is displayed beneath the button if the current page is not the last page of the document This button directs you to the index page that is directly above the current page in the topic hi erarchy It is displayed on bottom of every page in the center but if the current page is not in the highest level of the hierarchy This button directs you to the index of the manual you are currently reading It is displayed on the Bottom of every page in the center Bosch Software Innovations GmbH 1 270 Chapter 1 Overview 1 3 1 Searching To quickly locate topics on a particular subject in the documentation enter a query in the Search field you can use or wildcard characters Use the Search frame to display the Search view You can narrow the scope of your search by selecting only the sections you are interested in To search only Visual Rules topics click on Search scope and select Search only the following topics Now press New In the dialog that appears enter a List name e g Visual Rules tick Visual Rules in the Topics to search list Now press OK in both dialogs 1 3 2 Synchronizing After
137. age s rule project In order to declare such a dependency follow the instructions given in Sec tion 4 1 3 Defining Rule Project Dependencies 90 5 Activate the checkboxes in front of all the rule packages or rule models that you want to reuse Click OK 6 The rule packages are added to the list of reused rule packages 7 Save the change If you no longer want to reuse a rule package do the following 1 Do steps 1 and 2 like specified above 2 Select an entry in the list and press the button to remove a package from the list of reused packages 3 Save the change 4 2 19 2 Executing an automatic Organization of Package Reuse on Package Level If you want to execute an automatic organization of package reuse on package level do the following 1 Right click on the rule package in the Rule Explorer that should reuse other rule packages 2 Inthe context menu select Organize Package Reuses 3 All required rule packages are now reused by the relevant rule package 4 Save the change 4 2 19 3 Executing an automatic Organization of Package Reuse on Rule Level If you want to execute an automatic organization of package reuse on rule level do the following 1 Double click on the flow rule or decision table that requires an element from other rule packages 2 Right click anywhere in the Flow Rule Editor or Decision Table Editor respectively 3 Inthe context menu select Organize Package Reuses 4 All requ
138. all Disable all Enable individually F ci weekend surchargoe added Fires if an extra charge is added at week T Action Type Description Enable all O coupon_discount_granted Standard Fires if the coupon discount was granted Disable all EI General zsezing Standard Fires if visitor takes a normal seat gO special_seating Standard Fires if visitor takes a deluxe seat O ko student_discount_granted Standard Fires if the student discount was granted g weekend_surcharge_added Standard Fires if an extra charge is added at week ends Simulate Calls Hitt wv Pa e Call To Substitute With Description Figure 3 19 Rule Test Editor Configuration Related Concepts e Section 3 22 1 Rule Test 83 Related Tasks e Section 4 11 Testing Rules 160 Related References e Section 5 3 4 Rule Test Editor 210 3 22 3 Statistics During rule execution Visual Rules can collect statistical and tracing information for later use This is especially useful during testing and provides the user an insight into the workings of the rules The display of statistics is turned on by activating the Hide Show Statistics button on the toolbar The small arrow to the right opens a drop down which allows you to specify what statistical information should be displayed Jr Jl Ey E D i Percentages C Times An important part of the statistical information are the execution counters for eac
139. all conditions which evaluate to true Related References e Section 5 6 2 1 Decision Overview Tab 230 5 6 2 3 Assignments Tab This tab is shown when an assignment element is selected in the rule editor It shows a list of all the different as signments within this assignment element Bosch Software Innovations GmbH 232 270 Chapter 5 Reference Properties 3 8 Assignments 17 Assignments Description Data Element Expression Type Description Notes Sk E score score_total Integer Use the total score for further calculation Advanced KH E name total Any CH E aue 0 Integer E J best String List 1 en String S D String E Figure 5 43 Assignments tab Initially all right sides of the elements are collapsed This button will expand them so that all entered values are visible This only has an effect if at least one element is available ne Adds another assignment Inserts another element to a collection list or set This is only available when the data el ement of the currently selected assignment is a collection list or set pe Removes the currently selected assignment Moves the currently selected assignment up one position within the list Moves the currently selected assignment down one position within the list Data Element This column shows the data element whose value is changed in the assignment You can edit cells in this column by double clicking them Operati
140. ame gender birthdate and address There is also a built in data type called any This is the default type of all newly created data elements and means that this element can have any kind of value This is convenient because it allows the rule author to ini tially ignore data types when writing rules Bosch Software Innovations GmbH 68 270 Chapter 3 Concepts Multiple A data element can be multi valued which means that it can hold multiple values of the same type These are called collections or maps A data element is a collection or map when the Multiple attribute is set There are special assignment rule elements ADD REMOVE CLEAR for working with collections and maps Also the Repeat element more precisely Repeat for each of multiple elements is very useful when a rule has to look at the individual elements of a collection Implementation A data element which is multi valued see above can be implemented in four different ways It can be ei ther a collection a list a set or a map See the related concepts Section 3 14 7 Collection 76 and Sec tion 3 14 8 Map 78 for details Related Concepts e Section 3 14 Data Type 71 e Section 3 14 7 Collection 76 e Section 3 14 8 Map 78 3 13 2 Input Output Data Input Output data is used to specify data that goes into rules and comes out of them as a result Each data ele ment in this category can be either input or output or bot
141. ant Data There is a third category of data called constant data The values of constant data as the name implies cannot be changed by any rule Constants usually define values that parameterize rules e g instead of defining a credit limit within a rule you can specify the limit as a constant and then refer to that constant from within your rule f Properties ie BA problems 7 Tasks EI Console G5 Navigator gt BR Constant Data Constant Data Advanced Mame Type Multiple Implementation Default Value Description E e Customer Rating fet MASIMUM_RATING Integer No 100 Related Tasks e Section 4 6 3 Defining Constant Data Elements 142 Bosch Software Innovations GmbH 70 270 Chapter 3 Concepts e Section 4 6 Working with Data 140 3 14 Data Type All data elements have a data type A data type specifies what kind of values the data element can contain There are several built in data types like pate or String OF Float A data element of type pate can contain only date val ues It can not contain a number or some text only dates There is also a built in data type called any This is the default type of all newly created data elements and means that this element can have any kind of value A data element of type any can also contain a data value but also a number or some text This is convenient because it allows the rule author to not have to consider data types initial ly wh
142. assigned will be affected Input Data This column shows the name and type of the intput data elements of the service you are calling Cells in this column are read only Value The data element you want to assign the value of the intput element to You can edit cells in this column by double clicking them Code Assist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them Output Data This column shows the name and type of the output data element of the service you are calling Cells in this column are read only Assign To The data element you want to assign the value of the output element to You can edit cells in this column by double clicking them Code Assist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them 5 6 2 8 Repeat Tab This tab is shown when a Repeat element is selected It allows you to define how often or under what conditions the successors will be repeated Bosch Software Innovations GmbH 237 270 Chapter 5 Reference E Properties s4 cA EE i E Repeat 1 Repeat Description Repeat for each of multiple elements while a condition holds with counter Notes Assign each element to Elements allCustomers Figure 5 48 Repeat tab for each Oe Assign each ele Enter an expression that specifies a data element that each element of the collection is ment to assigned
143. ategory of results is represented by a separate tab on top of the Output section By clicking on the symbols you can switch between viewing the result for Output Data Actions or Internal Da ta Related Tasks e Section 4 11 9 Copying and pasting values 164 4 11 17 Disabling Warnings for Missing Expected Results Visual Rules usually creates small warning markers for output data that does not have an expected result set This can be disabled for a rule test by checking Disable in the section Warnings For Missing Expected Results of the configuration tab Warnings For Missing Expected Results Disable 4 11 18 Defining Expected Exceptions If a rule returns an exception this is usually considered a test failure However it is possible to specify the excep tion as the expected result and the test to succeed if and only if the exception was returned 1 Click the icon in the test editor Output section to specify the exception 2 Select an option Expect no exception This is the default and will cause the test case to succeed only if no exception is returned Expect an exception This will cause the test case to succeed only if an exception is returned and the exception is of the given type Expect an exception with specific data This will cause the test case to succeed only if an exception is returned and the exception if of the given type and all attributes have the given expected values 3 Inthe Expect
144. atform Enablement for PostgreSQL 1 6 1 200809191145 441 ke c R_RCIOP L Eclipse SDK 3 4 0 M2008091 1 1700 Finish Cancel 5 After downloading the update of the software starts At the end of the Update the dialog Software Updates appears to request the restart of eclipse Confirm the dialog by clicking on Yes and Eclipse restarts Software Updates Itis strongly recommended you restart the system For the changes to take el effect For some add ons it may be possible to apply the changes you have made without restarting Would you like to restart now If you need a new license please save the license file from our e mail to your hard disk and import the new license file with Visual Rules License Manager A short dialog will prompt you to restart Visual Rules for the changes to take effect Bosch Software Innovations GmbH 195 270 Chapter 4 Tasks 4 23 Upgrading Visual Rules Models Visual Rules introduces some enhancements to the rule model format when you are upgrading to a higher version of Visual Rules A dialog will open whenever Visual Rules detects a rule model created with a previous version You can then choose to automatically upgrade the rule model on the fly It is recommended to upgrade your rule models all at once after upgrading to a higher version of Visual Rules Modeler e g from 4 2 to 4 3 You should al so make sure that all team members are using the same version of Visual Rules Modeler Once
145. automatically generat ed It is represented by the icon th and added to the test suite in the rule explorer Bosch Software Innovations GmbH 174 270 Chapter 4 Tasks Click the button in the test suite editor to execute all tests included in the suite Each test is selected in the tree view during its execution If a test fails then the selection does not change any more Failures are shown in the table on the right side of the editor In order to retrieve more information about the failures a test can be opened in its editor by double clicking it 4 13 Debugging Rules The following sections contain step by step procedures related to rule debugging 4 13 1 Setting Breakpoints Breakpoints define the locations in rules where execution should halt during debugging 1 Right click a rule element in a flow rule or a cell in a decision table where you want to set a breakpoint 2 Select the Toggle Breakpoint menu entry from the context menu This will create a breakpoint or remove an already existing breakpoint Deactivate Open in Editor SES Undo Copy Rule Node Chril z Copy ot Cut W Delete Delete This Element Only Export Image Toggle Breakpoint Disable Breakpoint H gave View 3 The breakpoint icon appears next to the rule element or decision table cell 4 Existing breakpoints can be disabled with the Disable Breakpoint entry from the context menu A disabled breakpoi
146. ay BR Assign 2 Insert now the different cases for the car type For the first case use compact and for the second case luxury like in the picture below E What is the car type Car_Type Price is 50 per day _ Assign Price is 60 per day nE Assign 3 The decision element is now complete and you should not have any error markers at your decision any more Bosch Software Innovations GmbH 15 270 Chapter 2 Getting Started Now insert the expressions for the price calculations into the assignment elements Calculate the price by multiply ing the value of the data element Rental_Days with the price for the car type per day that was defined in the rule el ement description 1 For compact car type use the expression Price Rental Days 50 2 For luxury car type use the expression Price Rental Days 60 Al What is the car type Car_Type l Compact i compact Price is 50 per day e Price Rental_Days 50 Price is 60 per day C BR tee Rental Day 60 Now check if the customer is a premium customer This is indicated by the input data element Premium Customer being true CH 3 Is it a premium customer Premium Customer Tes premium customer TRUE Price is 60 per day e Price Rental_Days 60 Mo premium customer Complete the assignment for the calculation of the price discount Use the expression Price round
147. b 257 3 14 3 Structure Structures are user defined data types Structures are a collection of multiple values called attributes that belong together A data element of a structured type can hold a value for each of these attributes Attributes can have a basic data type e g Float String Boolean Date etc or in turn be a structure or any other user defined data type Bosch Software Innovations GmbH 74 270 Chapter 3 Concepts Example 3 28 Structures Department Employee Appointment and schedule Four data types are shown in the following picture Department Employee Appointment and Schedule The at tributes for each data type are listed below it The employee data type for example has the attributes first name last name gender etc no Data Types GG Appointment 2 D Attributes date_of_appointment Date description String a Department E G Attributes E locations String List E ei projects String List mg ei salary levels Float List WW staff Employee List d supervisor Employee GG Employee 2 Attributes an birthday Date a email String oS Tiret name String bets gender Boolean Sg Jost name String F i projects String List Co salary Float i SB schedule Schedule a zip String B schedule Attributes j appointments Appointment List holidays Date List Access to the attributes is done using dot notation If a varia
148. base 1 oc XPath Functions SI SZbatb Service 2 Select a location in the workspace for the dependency diagram and enter a name 3 Press Finish An empty diagram is created and it is added at the respective location in the Rule Explorer Project Explorer with the symbol ZS The diagram is automatically shown in the Dependency Diagram Edi tor 4 To show the dependencies within a rule project move the rule project or the relevant elements into the dia gram from the Rule Explorer Project Explorer per drag amp drop To show an existing dependency diagram do the following 1 nthe Rule Explorer or Project Explorer double click on the respective symbol ZS 2 The dependency diagram is shown in the Dependency Diagram Editor Related References e Section 5 3 7 Dependency Diagram Editor 215 Bosch Software Innovations GmbH 92 270 Chapter 4 Tasks 4 1 4 2 Visualizing the Usage of Elements within a Rule Project Each of the data elements actions etc may be used in different contexts within a rule project i e in different flow rules decision tables or stateflows Which element is actually used in which context and how often it is used there can be visualized in a usage matrix To create a usage matrix do the following 1 Inthe Rule Explorer or Project Explorer right click on a rule project to open the contextual menu and select New gt Usage Matrix The dialog New Usage Matrix appears New Usag
149. ble for example is called employee and has the data type Employee from the picture above the expression employee first name designates the first name of the employee employee schedule appointment are Similarly the appointments from the schedule of the employee Structures in Visual Rules can define a default value including default values for some or all of the attributes These default values are used whenever a data element of that type is initialized and does not define different de fault values on its own Related Concepts e Section 3 14 1 Basic Data Type 71 Related Tasks e Section 4 7 Working with Data Types 150 Related References e Section 5 6 8 1 Data Types Tab 256 3 14 4 Super Types Structures can be derived from existing structures The derived structure is called a sub type of the original type which itself is called the super type of the derived structure For example you may have a structure named car which is a sub type of vehicle or a Structure named customer which is a sub type of Person In Visual Rules it is possible to specify the super types of a structure on the Super Types tab in the Properties view Every structure inherits the attributes of all its super types but may also define additional attributes Related Concepts e Section 3 12 19 isa and asa Operators 66 Related Tasks e Section 4 7 Working with Data Types 150 Related References e Sec
150. btraction multiplication or division of both operands Bosch Software Innovations GmbH 56 270 Chapter 3 Concepts The aiv operator divides both operands and delivers a whole number result 11 DIV 2 5 11 DIV 3 3 The modulo operator divides both operands and delivers a whole number remainder 11 MOD 2 1 11 MOD 3 2 3 12 2 String Concatenation Operator The operator is used to concatenate individual strings into a larger string This can be used to embed the values of data elements into a text like this outputText The price for the movie ticket is amp price amp including a weekend surcharge of amp weekend surcharge Data elements of a different basic data type e g Float will be automatically converted to strings before concate nated 3 12 3 Embedded Expressions in a String As a convenient alternative to concatenating strings with values using the operator the values may be embed ded in a string using the s notation You can put any expression between the curly brackets outputText S bonus points bonus points have been calculated for card bonus_card Strings cannot be used within a section i e you cannot put quotes there Related Concepts e Section 3 12 2 String Concatenation Operator 57 3 12 4 Comparison Operators The comparison operators are lt gt lt gt lt and gt They compare both operands and depending
151. can only be pasted within a decision Alternatively you can copy or move a branch with drag amp drop 1 Click on the rule element which is the root of the branch you want to copy or move and hold the mouse button pressed down Bosch Software Innovations GmbH 119 270 Chapter 4 Tasks 2 Drag the branch to its destination If you want to create a copy of the branch you must also press the Ctrl key Otherwise the branch is moved 3 Let go of the mouse button to drop the branch Related Tasks e Section 4 3 21 Copying or Moving a Single Rule Element 120 4 3 21 Copying or Moving a Single Rule Element 1 Copying and moving single rule elements is done using drag amp drop Select a rule element and hold down the left mouse button 2 Press and hold the Alt key This will only copy or move the selected element but not its successors 3 Drag the rule element to its destination If you want to create a copy you must also press the Ctrl key in addi tion to the Alt key Otherwise the rule element is moved 4 Let go of the mouse button to drop the rule element Related Tasks e Section 4 3 20 Copying or Moving a Branch of a Flow Rule 119 4 3 22 Deleting a Branch of a Flow Rule To remove a rule element and all its successors a branch of a flow rule do the following 1 Right click on the rule element you would like to delete and select the Delete menu item Alternatively you can select the rule elemen
152. canenemecesebcicaececnmestagseseecnesauenesenandecse nocesteeteseesreaeamsenetenseaemsecoetesectece 234 SAAM E EE EE 235 all CICS EA EIA E I A A O TEA 236 E RDE T e EE 237 5 6 2 9 Return Exception Tab 239 556 2210 Ee E euro e TaD EE 240 D0 3 State OW EE beet 240 DO Soe late ees 240 964 RUG e S ccc tancsqnsresestecessatasececoesestenesesescceciuesenceesesanecsaetesdaccwassedteeteudecsotspesenetescgavesscactectess 241 Oe EMISSIONS WAI enee ee 241 Oe UIC I ACh AOS e streetscene ecuiecbrccuennctian EAA E EA E O 241 OO ROUSE Pacha Ses E GE 241 E EE 242 BO Ose ID ata ECEN ee 242 5 6 6 2 Input Output Data Tab EN 244 Ee NMC Ma Ee 245 0014 Bo eTa 4 E EE 247 O e de EE 248 E lin PCOS HAD eE E sence os EEO E E E EE EE 248 Oat EE EEN WEE eege 249 5 6 7 3 Output Message ACTION Tabs cc ccc cccc cece nec e nce eneeeneeeneeenseenseenseenseesseenseesseenseesseesseesseegeess 250 KOLA LOS Message ACHOM EE 251 5 0 7 5 SMG emal ACON TADS eege eege 252 EEr E Ville Cov Wile EMT Taina 253 5 6 7 7 Read CSV File Action Tabs E 254 50 6 DT EE eege 255 50 8 1 Data Types TaD E 256 i WS el A EE 257 0 6 Eng e E EE 257 DESA COMstaint Date PAD E 258 0 650 CN CC S T TOA E I T O AI E uesecetoaeeeseoeatnaooaes 260 Too SUE T Wa EE 260 TO J M E E E EE E A E 261 0 Fede MeT Date Eiere 261 Bosch Software Innovations GmbH xiii 270 Modeling Guide De PETON OS Een 262 5 7 1 Expression Formatting Preferences ccccccceccen
153. cccccescescenc eee eee ees eens eee eee eens ees eeeeeeseeseeeseeseeeeeseeseeeeeanen 95 4 2 4 Creating a new Rule Package EE 95 4 2 5 Deleting a Rule Package see eteetege eege EE Eeer Eege 96 426 Renaming a Ole e 96 4 2 7 Moving a Rule Package ccccccescesceeeent enc eeseenseeseessenseeeeenseeseeeeeaseeseesesseeseeaseeseeasessesseeanees 97 428 Cleating a NeW Flow UE 97 Bosch Software Innovations GmbH vi 270 Modeling Guide A29 Peleinae a EE 98 2 Ae Renaming a RUIS sesrsreseurodsrseseainioetiicoro sn atiii y indor aN EO EE O nia 98 Died clits FNAN EE 98 4212 COPYINE a RUIE EE 99 AZA MOV a RUE aeea E E E E S 99 4 2 14 Creating a new State FIOW soneseesssssssssssseeeesessssssssseeeeeeessssssssseeeceeeesssssssseeeeeeeessssssssseeeeee 99 A2 Debie a e e EE 100 4 2 16 Renaming a State FIOW c ccc ccc ccc cece nce e eee ee eee e eee e neces eee e ee eee eens ens eee eeeseeseeeeeeseeseeesensenseeasens 100 Be fs COPYING a tee FOW geet Ee e 101 A218 Moving a State e E 101 E RONE ROUE F Ae Ka Ce eaa E TE EAT A A EEN T 101 4 2 19 1 Manually selecting Rule Packages to be reused cccceecceeenceeceeeeenseeseeeeeeseeseeesensenseeanens 102 4 2 19 2 Executing an automatic Organization of Package Reuse on Package Level 102 4 2 19 3 Executing an automatic Organization of Package Reuse on Rule Level 102 A O r A A DESC IION EE 103 4 2 21 Editing le 103 A 22 NONE Ei EE 103 4 3 Working with Flow
154. ccenccenceenseeneeenseenseenseenseenseenseesseenseenseegeeenges 262 Dales FION PRUE Editor GEET 263 GEES 264 5 1 As Syntax Highlighting Preferentes cccecietcseosatacaescttcamndetescuosntsawmsndecseooet josencuntedeccteaneesadesaenseiteaaes 265 D125 GOlOrS ale FONTS lt P IeTeClON CCS spaccdewtsceoccnnssmteuesesdee sas ander o ae ea eUa EEU ERE 266 EE TOSt SxCCUNOM 1s canes aeerereiancarsescece EE EE E E tensaane tn men EA es 266 Dill VANGAUION EE 262 D120 Noles Preie rence ee 268 DO HOU EE 269 Bosch Software Innovations GmbH xiv 270 Chapter 1 Overview Chapter 1 Overview 1 1 Organization of this Manual This manual is the Modeling Guide for Visual Rules It consists of four chapters e Getting started e Concepts e Tasks e References The Getting started chapter contains a simple step by step introduction into Visual Rules If you are new to Visu al Rules you should read this first You will learn how to setup Visual Rules create a rule project write rules and execute and test them For users of previous versions of Visual Rules this may also be a good way to get accus tomed to the new user interface of Visual Rules version 4 The Concepts chapter explains and defines the concepts of Visual Rules rule models Here you can learn for ex ample what a rule is what a rule package is and how they relate to each other You don t have to read this chapter from beginning to end It was organized to be usable as a referenc
155. ce cece cece t tsaint t rrt eee eee eee eee eeeeeeeeeeeeeneeeeeeeneeeeesenesenseenseenseenseenseenseenseensees 82 O22 Me FUNC EE 83 ee 22 R POST re 83 E SEET ee 84 Ee WES SUNG eege 86 O22 5 West Sune ONO aieea E ae sscose E E E 86 B20 PRUE DE DUS SINS os coca sealecen ccs oscrecnaeeu ced eee a seelase ween ose EN NAE EEE A EE N EN AEE 87 GE IDE DUS COL ee 87 3 23 2 Breakpoint ssssssirerrsrirrssssrsira iskin i rsi Er EErEE EP AR EETA EEEE TAE E EEEE E ETENE REENER ES 88 A TIS EE D 4 1 Working with Rule Projects sssssssseeeeeesssssssssseeceeeessssssssseeeeeeessssssssseeeeeeeesssssssseeeeeeeesssssessee 89 Ol as Creating anew Rule Froe EE 89 4 1 2 Setting Rule Project Identifiers Group Id Artifact Id Version ccsscoossssessseessesssesssereseresesssserreeee 89 4 1 3 Defining Rule Project Dependenties c cece cece ccc enceenteecteenseenteesseeseeseeesseesseeteesseeseeeseeseenses 90 AAA Analyzing Rule Projects 2 cscccsnsccnsosncosadesnectecetnersecatacecnecsseosdssieciecedoebsewotoeednecsseosucwsnecdesateeosses 92 4 1 4 1 Visualizing Dependencies between the Elements within a Rule Project ccccceseeseeeseeseeseeeses 92 4 1 4 2 Visualizing the Usage of Elements within a Rule Project cccccceccesceeseeceeseeeseeseesensenseeasens 93 A2 Working witi Rule ee TEE 93 4 2 1 Creating a new Rule Model EE 93 A2 elle a RE MOREN EE 94 4 2 3 Saving Changes in Rule Models c
156. cebisesinnecarie cs hence riacbodeassaduceensiuaaresadaeeieseedoasieeds 129 4 4 8 Rearranging Condition Columns or ROWS ccccccesccesceeceeesceeseeesseesseesseesseesseesseeseeesseeseeeseeas 129 4 4 9 Describing Decision Table Element cccccesccesccecceeceeeneeesseesseesseesseeseeesseesseesseesseeseeesgeens 130 4 4 10 Navigating in Decision Tables ccccccccesc enc eeeeene ens eee eens ees eeeeeseeseeaseeseeseeaseeseeaeensenseeaeenss 130 4 4 11 Configuring the Appearance of the Decision Table Editor c ccc ccc ccccescceceeecteeceeeteeseeeeeeees 130 4 4 12 Adding a new Action Column E 131 2 ek e e aA e O EE 132 4 4 14 Adding a new Exception Column 132 E 15 Edine ExXCeption COMMIS srerriiseroree ernan EE 133 Bosch Software Innovations GmbH viii 270 Modeling Guide 4 4 16 Rearranging Assignment Action Exception Columns ssssssssesesssseeseesssseeresssseeeesssseeeessssreeessese 133 4 4 17 Importing an Excel Sheet as a Decision Table 133 4 4 18 Converting a Decision Table into a Flow Rule 135 4 5 Working with State FIOWS ccccccccecccecceesteenteeneeesseesseesteesseesseeteesseesseesseeseesseesteeseeeeeeeeges 136 4 5 1 Opening the Slate Flow BCIOM EE 136 4 5 2 Configuring the Appearance and Capabilities of the State Flow Editor c ccc ccc cece eee eeeeeeeeeeeees 136 We DAV Cae EE 137 4 5 4 Adding New States cece ccc e cece eee eseeese eens
157. ch descriptions The palette can be collapsed and expanded by clicking on the small black arrow in the title bar of the palette Bosch Software Innovations GmbH 46 270 Chapter 3 Concepts K Select A Zoom L 7 Add Note Add a note Describe Branch Add a description to a whole branch lt gt Decide Make 4 decision Assign Calculate values and update data E Set Transition Target Set a Target State 6 Fire Action Fire an action Call Flow Rule Call another flow rule Call Decision Table Call a decision table Call Service Call a service Ze Done amp Return Immediately return to the calling rule Repeat Repeat the following part of the Flow 45 End Repeat Immediately exit a Repeat ES Return Exception Create an exception message and continue where exceptions are handled E Handle Exception Specify what to do When an exception message is returned Figure 3 3 Rule Editor palette Related Tasks e Section 4 3 Working with Flow Rules 103 Related References e Section 5 3 1 1 Flow Rule Editor Palette 205 3 6 2 Rule Context Palette The rule editor has a Rule Context palette which displays the data elements actions and services the rule can ac cess It also lists the rule tests available for the rule The palette gives quick access to all these items so that the rule author does not have to continuously switch to the Project Explorer This is especially useful when the rule
158. cing K Internal Data customer Customer E Data Types customer E E gt Attributes age Integer Create Don t Create Figure 3 17 Auto Creation dialog Auto Creation can not only create data and data types but also rules actions action types and services The be havior of Auto Creation can be configured individually for each of these element types You can choose if the ele ments should be created always or never or if the user should be prompted Click on Configure to bring up the user preferences for Auto Creation or open it with Window gt Preferences gt Visual Rules gt Auto Creation and set the elements that should be created automatically to Prompt Related Tasks e Section 4 10 3 Working with Auto Creation 159 Related References e Section 5 4 3 Auto Creation Dialog 218 e Section 5 7 3 Auto Creation Preferences 264 3 22 Rule Testing Rule testing is the process of ensuring the correctness and completeness of an individual rule or a set of rules This is achieved by defining tests and test cases for the rules and then by executing these test cases in an auto mated way Bosch Software Innovations GmbH 82 270 Chapter 3 Concepts The following sections describe rule tests and the test editor that is used to define and execute the tests in Visual Rules 3 22 1 Rule Test A rule test is a test for a specific rule It tests the correctness of this rule by exec
159. cing Table KZ E Properties E K Problems Decision 7 Decision Overview Decision Details cs E TER Description D ti m SEDIR eel ES E lt gt Auditorium No Motes g 1 P 2 The individual views can be changed in size and position Views can also be placed over each other as for exam ple the lower right section in the picture above where the Properties and Problems views are overlapping Click ing on the name tab of a view at its top border brings it to the front The default state of a perspective can be restored by selecting Window gt Reset Perspective from the menu General information about perspectives can be found in the Getting started section of the Work bench User Guide 4 20 3 Opening Views 1 Use the Window gt Show View menu entry to add views to the current perspective 2 Select a view from the sub menu or select the Other menu entry to open a list of all available views Select the view from the list and click OK 3 The view is added to the perspective You can now drag it to the desired position Visual Rules specific views can all be found in the Visual Rules category 4 21 Sending a Support Request If you encounter a problem while working with Visual Rules the product can aid you in submitting a support re quest 1 Use the Help gt Visual Rules Support Request menu entry to open the support request dialog Bosch Software Innovation
160. column by double clicking them Only input and input output parameters can be required Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available The type of the data element You can edit cells in this column by double clicking them This column shows wether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 Col lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implementation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited The description for this row You can edit cells in this column by double clicking them Related References e Section 3 14 7 Collection 76 e Section 5 6 6 3 Internal Data 245 e Section 5 6 6 4
161. created This name will be used both as a file name with an extension of vrmode1 and for the name of the rule model stored in this file Advanced gt gt This section allows to link to an existing file somewhere else in your file system This is an advanced feature of the Eclipse platform and should not be used with Visual Rules Read more about it in the New File wizard section of the Workbench User Manual Related tasks e Section 4 2 1 Creating a new Rule Model 93 Related concepts e Section 3 2 Rule Model 25 5 2 3 New Rule Wizard Use this wizard to create a new rule in an existing rule model or rule package Bosch Software Innovations GmbH 201 270 Chapter 5 Reference New Flow Rule Flow Rule Create a new Flow rule Rule model Movie Ticket Pricing Movie Ticket Pricing Rule package Malidation Rules Flow rule name ValidateCoupon Use a template Validation Rule Template Figure 5 6 New Rule wizard CSR Rule model Enter the rule model you want the rule to be added to Click Browse to list all available rule models Rule package Enter the path of the rule package within that rule model you want the rule to be added to Click Browse to list all available rule packages If this is left empty the rule will be created in the top level rule package the rule model itself Flow rule name The name of the new flow rule to be created This must be different from any other r
162. ction 3 3 1 Rule Package Reuse 28 Related Tasks e Section 4 2 8 Creating a new Flow Rule 97 3 4 1 Flow Rule Template Flow rule templates are blueprints for newly created flow rules Flow rules that are newly added to your rule model are usually empty They do neither have any data definitions nor any rule elements except for the start element Bosch Software Innovations GmbH 30 270 Chapter 3 Concepts New rules have to be defined from scratch unless you are using rule templates Templates can contain any num ber of predefined rule elements including input output data actions etc Templates are especially useful when you create a lot of similar rules e g data validation rules that all should follow a specific pattern A flow rule template is very similar to any regular flow rule They are defined within rule packages and have a name that identifies them You can use the same graphical editors to edit a flow rule or a flow rule template When a new flow rule is created the New Flow Rule wizard allows you to select a template for it The template with all its contents including data actions types rule elements is then copied into the newly created flow rule Related Tasks e Section 4 2 8 Creating a new Flow Rule 97 3 5 Flow Rule Element Every flow rule is composed of individual rule elements connected to each other This is the list of all available rule elements Start The Start e
163. current system time Timestamp A Timestamp IS a combination of a pate and a Time thus defining a day and a time Default value current sys tem time Related Tasks e Section 4 6 Working with Data 140 e Section 4 6 13 Displaying Data Types 148 3 14 1 1 Any Any Is the most general data type in Visual Rules A data element of this type can hold values of any type just like the name indicates It can be a string a Date a Float or any other built in or custom data type All operations can be applied to any values For example it is possible to add subtract multiply divide and compare two any values This makes the any data type a very convenient choice for many data elements This is also the reason why any is the default type for every newly created data element When the rule is executed Visual Rules will look at the actual data types of the any values and perform operations accordingly This may cause Visual Rules to convert a value from an incompatible type to a compatible one For example if an any value is added to another any value Visual Rules will check whether they are both numbers If one or both are not numbers then Visual Rules will try to convert them to numbers and then add them according ly This way it is possible to have numbers stored as strings and still be able to do computations because Visual Rules will try to convert the string into a number whenever necessary Note however that these type
164. cution or if errors exist in the rule model you will be asked how to proceed Execute the test in debug mode Test execution will halt when a breakpoint is reached Opens the editor for the flow rule or decision table being tested Shows the corresponding result file in the rule explorer The number next to this icon indicates the number of successful test cases in this test for the last execution The number next to this icon indicates the number of failed test cases in this test for the last execution Test Case Descrip This section contains a description for the currently selected test case It can be expand tion ed and collapsed Global Test Data This section gives access to the initial data setup where static internal data elements can be initialized before the test cases are executed 5 3 4 2 Input This panel shows all the input data possible for the rule and allows you to assign values to the input data for each test case Expands all elements that have children to show every element in the tree Hides the input parameters that are not used i e don t have a value assigned to them in the Input panel Inserts a new element into the list element selected in the Input panel pe Deletes the selected list element 5 3 4 3 Output Ta KH This panel shows all the output data actions and internal data for the rule and allows you to set expected results for these It also shows the actual results for the last test run rig
165. d References e Section 5 6 2 8 Repeat Tab 237 4 3 14 Editing an End Repeat Element The end repeat element has no specific element settings You have the possibility to insert a description and a note to describe what happens if this element is reached If the end repeat element is reached the nearest repeat element will be ended Related Concepts e Section 3 5 9 End Repeat 42 Related Tasks e Section 4 3 13 Editing a Repeat Element 115 4 3 15 Editing a Call Flow Rule Element In order to edit a Call Flow Rule element open its Properties and select the Call Flow Rule tab and do the follow ing Bosch Software Innovations GmbH 115 270 Chapter 4 Tasks 1 Select in the field Call Flow Rule the rule that should be called You can call rules from the same package or from any package that is defined to be reused Press Ctrl Space for content assist or click on to choose the rule from a list of available rules 2 The required input data elements of the called rule are displayed in the Input Data area You have to specify values for at least the required inputs Click on to automatically insert data elements as input values when they have matching name and type Only inputs still without a value will be affected 3 The output data elements of the called rule are displayed in the Output Data area Assign the output values to data elements of the calling flow rule Click on amp to automa
166. d state and the other way round via the context menu Related Concepts e Section 3 10 State Flow Element 53 e Section 3 11 State Flow Editor 54 Related References e Section 5 3 3 1 State Flow Editor Palette 209 4 5 5 Creating Transitions 1 Select the transition element in the palette by clicking on it 2 Move the mouse into the state flow editor to the state from which the changeover starts and click again Bosch Software Innovations GmbH 137 270 Chapter 4 Tasks 3 Now move the mouse to the state where the changeover ends and click again A new simple transition will be added 4 To turn the simple transition into a rule based transition double click on the little yellow diamond The underlying transition rule is automatically created and added in the Rule Explorer You can form a transition by selecting it and dragging its corners Related Concepts e Section 3 10 State Flow Element 53 e Section 3 11 State Flow Editor 54 Related References e Section 5 3 3 1 State Flow Editor Palette 209 4 5 6 Editing Descriptions of State Flow Elements Next to each state flow element is a box that contains the description 1 Double click a description you want to edit You can also just select it and start typing The inplace editor will open m Order 2 Enter the description 3 Press Ctrl Enter to close the editor or click with the mouse outside of
167. d their values st Variables KO ob D P Mame value l E S Input auditorium_no 1 i bonus_card i coupon False i seat mp 100 fa show date 2007 09 21 i student false l E amp Output f bonus points D i price 7 Figure 5 37 Variables view There are several options that affect the contents and display of the Variables view These options are available from the menu in the view toolbar a Show Input Output When selected input and output data elements are included in the view Data Show Internal Data When selected internal data elements are included in the view Show Actions When selected actions are included in the view Set Constant Da When selected constant data elements are included in the view Show Groups When selected groups are included in the view l selected When selected groups are included in the view are included in the view Related Tasks e Section 4 13 3 Stepping Through Rules 176 Bosch Software Innovations GmbH 228 270 Chapter 5 Reference Related References e Section 5 1 3 Debug Perspective 199 5 5 10 Breakpoints View The Breakpoints view shows all currently existing breakpoints in all projects and rule models Breakpoints can be temporarily disabled by unchecking the check box in front of it Breakpoints can also be deleted here The Breakpoints view is not specific to Visual Rules but par
168. data 3 All internal data elements that are defined as static are shown Insert values for these elements in the column Value The internal data elements are initialized with these values at the beginning of the rule execution and keep the values over the execution of test cases Bosch Software Innovations GmbH 171 270 Chapter 4 Tasks Initial Data Setup X Internal Data Value Description Movies 1 GoldenEye z Die Another Day o 3 Casino Royale o 4 The World Is Not Enough Gi Reserved Seats String List e 1 B15 o 2 A g9 e 3 ra An internal data element that you have defined as static inserted initial values for it and after wards redefined it as non static is still displayed with its values in the Initial Data Setup view If you define it as static again the initial values defined before are still available If you really want to delete the internal data element from the Initial Data Setup you have to delete it manually 4 12 Organizing Rule Tests in Test Suites The following sections contain step by step procedures for creating editing and running test suites Related Concepts e Section 3 22 Rule Testing 82 4 12 1 Creating a Test Suite 1 Right click on a rule project or a subfolder thereof in the Rule Explorer or Project Explorer 2 Select the item New gt Test Suite from the context menu 3 The New Test Suite wizard appears New Test
169. derscores this is a valid name Two data elements cannot have the same name when they are defined on the same rule or the same rule package However two data elements defined on different rules or different rule packages can have the same name Description Each data element can have a description Descriptions should fully explain the meaning of the data element and its value Users can access descriptions from many other places in Visual Rules e g from within the Code Assistant when entering a rule expression Default Value If a default value for a data element is specified then this will be its initial value until it is set to a different val ue If a default value is not specified then implicit default values for the data type apply For example a data element of type Float will have a default value of 0 Zero if not defined differently A structure is created by default To suppress the creation of a structure specify oui as the default value Default values can also be specified for structured data elements or data elements containing multiple values Type All data elements have a data type A data type specifies what kind of values that data element can contain There are several built in data types like pate Or String Or Float These data types can be extended by us er defined data types especially also structured types with multiple attributes e g a customer type that de fines the attributes of a customer first name last n
170. ding a new Assignment Column 128 Related References e Section 5 3 2 1 Decision Table Editor Palette 207 3 7 3 Action Column An action column in a decision table is used to fire actions if specific conditions are true The action column itself specifies the action to be fired in its column header The cells of the column either contain a cross x or a dash depending on whether the action should be fired or not under the conditions leading to that cell Action columns are added to an existing decision table with the Fire Action tool in the palette or by dragging an action from the Rule Context palette Related Concepts Bosch Software Innovations GmbH 49 270 Chapter 3 Concepts e Section 3 7 Decision Table 48 Related Tasks e Section 4 4 12 Adding a new Action Column 131 Related References e Section 5 3 2 1 Decision Table Editor Palette 207 3 7 4 Exception Column An exception column in a decision table is used to signal exceptions if specific conditions are true The exception column itself specifies the exception to be returned in its column header The cells of the column either contain a cross x or a dash depending on whether the exception should be returned or not under the conditions leading to that cell Exception columns are added to an existing decision table with the Return Exception tool in the palette Related Concepts e Section 3 7 Decision Table
171. dit its contents Ki EU Rent x es See i E cha Select pees jute base charge vehicle t Compute base charge per tal days E Zoom Up late record Use Alt Enter to start a new line 2 2 3 2 Adding a new Decision The rental for the car depends on the car type therefore you need to decide what the car type is Insert a new decision per drag amp drop from the palette 1 Select the rule element Decide in the palette by clicking on it 22 Eu gent 22 4 lt 2 Palette l Select EL eoom CA Add Note Add a note Fa Describe Branch Add a description to a whole branch E Decide Make a decision e Assign Catulate values and update data Now move the mouse over to the start element b gt in the flow rule A black arrow will appear to show you where the new element will be added Bosch Software Innovations GmbH 8 270 Chapter 2 Getting Started mea EL Rent te a 2 _ e Palette l Select A oom CA Add Note Add a note Describe Branch 4dd a description to a whole branch be O Decide Make a decision bol Assign Calculate values and update data 3 When you see a black arrow click again and the new rule element will be inserted 2 2 3 3 Adding a new Decision Condition In this example you will check three different car groups compact full size or other For this you need to insert a new condition to your decision 1 Select again the Decide ele
172. dual operations by selecting Edit gt Undo Operation from the menu The last operation you carried out is shown in place of Operation Alternatively press the Ctrl Z key combination to undo the last opera tion performed To redo undone operations select Edit gt Redo Operation from the menu You can also use the Ctrl Y key com bination Related References e Section 5 8 Hotkeys 269 4 3 32 Displaying Statistics In order to display statistics do the following 1 Open the flow rule or decision table in the editor for which you want to view the statistics Bosch Software Innovations GmbH 122 270 Chapter 4 Tasks Click on the icon itself in the toolbar to show or hide statistics The icon will toggle between a white bar chart and a colored barchart indicating whether the display of statistics is turned off white or on colored TAuditoriumNo No 18 914m Me l g 18 Cl 62 23 5 8 116ms Sieg SEA 10 tt e Special seating seating Audit No 1 Special 7 5 Special seating A dech l SE i ce 37 0 37 0 37 0 WW lt General seating Audit No 1 General 5 5 General seating w ll SCH a lt l mees 0 25 IK 25 0 3 Click on the small arrow to the right of the icon to open a drop down which allows you to further specify what statistical information should be displayed a ell s g D Percentages
173. duplicates IN Operator cess allowed em Related Concepts e Section 3 12 14 Collection Operators 60 e Section 3 12 15 Collection Functions 61 e Section 3 5 8 Repeat 40 3 14 8 Map A Map is a collection of multiple elements that are each identified by a unique key Values and keys can be of any data type including structured types The elements of a map don t have a specific order and indexed access is consequently not possible Accessing the elements is done via the key only The following screenshot shows a data element named state which is a simple string gt String Mapping The default value has three entries for the states CA MA and NY To define a map Multiple must be activated and the implementation has to be set to Map You can then enter a type for the keys Key Type in addition to the type for the values Type state String gt String Mapping Data Element Name e Types String pe Notes Jee Key Type Bring iG _ Static i Mame Default value Description g stater String gt String Mapping Kl entry oO key String TA CO value String California H key String A CO value String Massachusetts entry key String WY CO value String New York Related Concepts e Section 3 12 16 Map Operators 64 e Section 3 12 17 Map Functions 65 e Section 3 14 7 Collection 76 3 15 Description and Note Almos
174. e auditorium mo CS Coupon fea Price CG Seat np ge show_date CG student LS Constant Data e 7 et coupon_discount g student discount Fi weekend_surcharge E Actions e 7 D coupon _discount_granted WP general_seating ie special seating et student _discount_granted fet weekend surcharge added g Rule Tests e le e Bonus Points Test Figure 3 10 Decision Table Context palette 3 9 State Flow A state flow is a graphical representation of the different states which a system can adopt during runtime and it specifies the events which may cause changeovers between individual states Every state flow has a name that identifies it All state flows in a rule package must have different names so that each state flow can be uniquely identified by its name and package State flows can have the same name if they are located in different rule packages ee on finish_brewing choose_coffee choose coffee gt B _ __ e ica SE e Coffee_chosen return_payed_amount Payment_not_ sufficient ayed_amount el coc new cup Ready fof brewing Payment sufficient Ereignis Figure 3 11 Graphical representation of a state flow in Visual Rules Related Tasks e Section 4 2 14 Creating a new State Flow 99 Bosch Software Innovations GmbH 52 270 Chapter 3 Concepts 3 10 State Flow Element 3 10 1 State The state element represents an intermed
175. e price weekend surcharge Weekend surcharge added Figure 3 1 Graphical representation of a flow rule in Visual Rules Visual Rules lets you model your rules graphically Every flow rule is composed of individual rule elements con nected to each other The start element at the top left indicates the start point of a flow rule This is where execu tion of this rule always begins Execution then continues to the right and to the bottom just like you read a book Execution ends at the latest when all elements of a flow rule have been processed in this manner Every rule clearly specifies the data that goes into the rule input data and the data that comes out of the rule as a result output data Additionally a flow rule may define data that it uses internally only internal data or constant data The complete set of input output and internal data of a rule is the sum of all data elements defined for the rule plus all data elements defined for the rule package plus all data elements defined for packages above that In other words a rule has access to all data elements that can be found by go ing up the package hierarchy starting from the rule up to the rule model which is the top level rule package All available data is also called the data context of each rule Related Concepts e Section 3 5 Flow Rule Element 31 e Section 3 3 Rule Package 26 e Section 3 4 1 Flow Rule Template 30 e Se
176. e 1 and buttons to navigate through the changes Depending on the type of the selected change the Structure or Data tab will be shown e Itis possible to redo changes by copying changes from the history into the current rule element That means copy changes from right to left Use to copy all changes from right to left Use to copy the currently selected change from right to left 4 17 Import and Export 4 17 1 Importing a Rule Model You have the option of importing an existing rule project into your Visual Rules workspace This can be useful for transferring a rule project from another Visual Rules installation To import an existing rule project located outside your workspace do the following 1 Select File gt Import from the menu 2 Select the item Existing Project into Workspace from the list of import sources Then click on the Next gt button 3 Choose if you want to import a rule project that is an archive file or not Select root directory if it is not an archive file and Select archive file if it is one 4 Nowclick on Browse and select the rule project folder 5 Check the Copy projects into workspace checkbox if you want to copy the files into your workspace recom mended Otherwise the files will remain at their location and your project will be linked to these 6 Complete the process by clicking on the Finish button Bosch Software Innovations GmbH 183 270 Chapter 4 Tasks 4 17 2 Exporti
177. e 4 3 Individual options for configuring the appearance and capabilities of the state flow editor a e amp Transition Rule Names Show hide names of transition rules Show hide notes of transition rules and states You can also set the line style of the state flow e g to either rectangular oblique or rounded This can be done via the line style menu in the toolbar button gt These settings are also available in the Preferences Visual Rules gt State Flow Editor 4 5 3 Saving Changes 1 When you do any changes to a state flow the tab of the state flow editor will show an asterisk right in front of the state flow name To save the changes made in the current editor press the Save button E on the toolbar This button is only enabled when changes were made Alternatively you can press Ctrl S or select the File gt Save menu item If you want to save all unsaved changes and not just the changes made in the current editor you can press Ctrl Shift S or select the File gt Save All menu item Related Concepts e Section 3 11 State Flow Editor 54 Related References e Section 5 5 2 Project Explorer View 223 4 5 4 Adding New States 1 Select the respevctive element in the palette by clicking on it 2 Now move the mouse into the state flow editor and click again The new state will be added You can drag the state to any location within the editor A state can be turned into an en
178. e Dependency dialog specify the Group Id Artifact Id and Version e g commons math commons math 1 2 Click OK Visual Rules Modeler will now try to resolve the newly defined dependencies If some dependencies cannot be resolved you will see error markers at the ruleproject vr file and in the rule project editor Section 4 1 2 Setting Rule Project Identifiers Group Id Artifact Id Version 89 91 270 Chapter 4 Tasks 4 1 4 Analyzing Rule Projects Large projects often contain lots of rules and rule packages For a better understanding of the relationship and us age of the elements included you have the following possibilities 4 1 4 1 Visualizing Dependencies between the Elements within a Rule Project Between the elements within a rule project there may be different kinds of dependencies like rule calls rule pack age reuses etc These dependencies can be visualized in a dependency diagram To create a dependency diagram do the following 1 Inthe Rule Explorer or Project Explorer right click on a rule project to open the contextual menu and select New gt Dependency Diagram D The dialog New Diagram appears New Diagram Create a new Dependency Diagram Enter or select the parent Folder Movie Ticket Pricing SR E3 SI BOM Example D Early WwarningSystem E Movie Ticket Pricing Rule Execution API Example S Rule Project 1 vrteam Team Server LATEST Repository 1 Resource 1 D E Tutorial Data
179. e Matrix Usage Matrix Create a new Usage Matrix Enter or select the parent Folder Movie Ticket Pricing Lama I gt Movie Ticket Pricing a Rule Project 1 vrteam Team Server Connection Repository oo Rule Project 2 i Rule Project 3 D po StateFlow Finish Cancel 2 Select a location in the workspace for the usage matrix and enter a name 3 Press Finish A usage matrix is created and added in the Rule Explorer Project Explorer with the icon The matrix is automatically shown in the Usage Matrix Editor To show an existing usage matrix do the following 1 Inthe Rule Explorer or Project Explorer double click on the respective icon 2 The usage matrix is shown in the Usage Matrix Editor Related References e Section 5 3 8 Usage Matrix Editor 216 4 2 Working with Rule Models The following sections contain step by step procedures for different tasks you may want to perform with rule mod els e g create new rules or rule packages 4 2 1 Creating a new Rule Model 1 Right click on the rule project or a subfolder thereof in the Rule Explorer or Project Explorer 2 Select the item New gt Rule Model from the context menu Bosch Software Innovations GmbH 93 270 Chapter 4 Tasks 3 The New Rule Model wizard appears Rule Model Create a new Rule Model Enter or select the parent Folder My Rule Project De G My Rule Project File name My Rule Model 4 Specify the
180. e New Element gt Rule Package entry from the context menu Bosch Software Innovations GmbH 95 270 Chapter 4 Tasks 3 4 The New Rule Package dialog opens Enter the name of the package you want to create This name must be different from any other rule package or rule on the same level Press OK to create the rule package Related Concepts Section 3 2 Rule Model 25 Section 3 3 Rule Package 26 Related References Section 5 5 2 Project Explorer View 223 4 2 5 Deleting a Rule Package 1 2 3 To delete a rule package right click on the rule package you wish to delete and select Delete from the context menu Alternatively press the Del key Visual Rules will ask whether you are sure you want to delete the rule package Click on Yes The rule package and all its contents are deleted Related Concepts Section 3 2 Rule Model 25 Section 3 3 Rule Package 26 Related References Section 5 5 2 Project Explorer View 223 4 2 6 Renaming a Rule Package 1 4 To rename a rule package right click on the rule package you wish to rename and select Rename from the context menu Alternatively press the F2 key A dialog will open where you can enter the new name You must enter a name that is different from any other rule package or rule on the same level ETE Mew Mame Validation Rules Preview gt OK Cancel Click on Previe
181. e New Input Output Data dialog appears Enter the name car _ Type for the new data element Select Input Visual Rules Input Output Data Create a new input output data element Name Car Type pe Le Input Output Input Output Required Multiple Create the data element by clicking OK The car Type data element is shown in the Rule Context palette under Input Output Data Rule Context at GE Input Output Data 9 Por Lar_Type 4 Internal Data EE Constant Data ab 29 1 Bosch Software Innovations GmbH 14 270 Chapter 2 Getting Started Create the input data elements Premium Customer and Rental Days in the same way as the car Type These ele ments will be used for the calculation Create the output data element price like the input data elements before Since this is to act as an output select t Output in the New Input Output Data dialog This element will be the result of the calculation Rule Context m G Input Output Data F le CG Car_Type CG Premiunm_Customer GG Price E Rental_Days 4 Internal Data ab e 2 2 4 3 Edit Rule Elements Insert the contents for the decision now and check which car type was rented 1 Type in the name of the input data element car Type as the decision criterion at the top of the decision ele ment Calculate rental charges po What is the car type Price is 50 per d
182. e Return Exception Rule Element Ctri Up Decrease max height of rule elements Ctrl Left Decrease max width of rule elements Ctri L Go to Rule Element Ctril Down Increase max height of rule elements Ctrl Right Increase max width of rule elements Ctrl Shift Home Reset size Ctrl Alt R Brings up the Open Rule Dialog Rename selected element Bosch Software Innovations GmbH 270 270
183. e Section 5 6 7 5 Send e mail Action Tabs 252 e Section 5 6 7 6 Write CSV File Action Tabs 253 3 17 Action Type The value of an action is set to true when it fires This happens independently of the action type However addi tional things may happen depending on the type of the action The action type of an action defines what exactly happens when the associated action is fired Visual Rules has some built in action types but can also be extended by any number of custom action types See the Java Integration Guide for how to define custom action types The following action types are available by default Standard An action of type Standard does nothing else when fired Actions of this type are used to represent logical re sults only Output message An action of type Output message prints a message to the screen console or to a file depending on its set tings Log message An action of type Log message prints a message to a logging system This is useful for tracing or debugging purposes Send e mail An action of type Send e mail sends an email Sender recipient subject and email body can be defined dy namically Bosch Software Innovations GmbH 80 270 Chapter 3 Concepts Write CSV file An action of type Write CSV file writes a record into a CSV file comma separated values This file can then e g be read by Excel or other applications Read CSV file An action of type Read CSV file reads records f
184. e calling Cells in this column are read only Assign To The data element you want to assign the value of this output element to You can edit cells in this column by double clicking them Code Assist Ctrl Space is available Description The description for this row You can edit cells in this column by double clicking them 5 6 2 6 Call Decision Table This tab is shown when a Call Decision Table element is selected in the rule editor Here you specify the decision table to be called and any necessary input data Additionally you specify which data elements the output of the de cision table should be assigned to Call Decision Table 1 Call Decision Table Description Call Decision Table BonusPoints Gal Notes F Advanced Input Data value Output Data Assign To ia bonus_card BONUS CARD BONUS CARD GOLD fea bonus points Integer bonus_poinks i Ei money_spent Integer money _ spent Ga i weekday Integer z Figure 5 46 Call Decision Table tab Bosch Software Innovations GmbH 235 270 Chapter 5 Reference eon in Call Decision Table Enter the name of the decision table that you want to call here Code Assist Ctrl Space is available KE Opens the editor for the decision table being called Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if at least one element is available a Inserts another element to a collection list
185. e icon for rule execution in the Test Cases area and the rule will be executed Test Cases F CG Wa L Leo E Sin on LE d Test For discount granted 2 If you have not saved the test a dialog will appear and ask you if you want to save resources Resources Save resources The Following Resources must be saved to proceed Save always and don t ask again 3 Accept with OK You should check the Save always and don t ask again checkbox 4 A second dialog will appear and ask you if you want to generate code and continue P Code Generator Generate code and continue The Following elements must be generated dlways proceed without asking 5 Accept with Proceed Again you may check the Always proceed without asking checkbox 6 The rule is executed Bosch Software Innovations GmbH 22 270 Chapter 2 Getting Started In the Console view you see the output of the rule execution 2 3 6 Task 6 Inspect the Results of the Test Cases 1 The result of the rule execution is shown in the column Actual Result in the Output area For the second test case the rounded price is 108 Output ege enz x Output Data Expected Result Actual Result fa Price Any 106 106 2 On the left hand side of the test editor there is a marker on the test cases This marker shows that the test case was successful which means the actual result is the same as the expected result Test Cases P GG RJ H Test Case Desc
186. e is 60 per day Decide Make a decision E Assign Calculate values and update data ki Fire Action Fire an action Call Flow Rule Call another Flow rule E Call Decision Table Call a decision table 6 Inthe case of a luxury car there should be a discount granted for premium customers In the first step insert a decision to check if the customer is a premium customer Insert the new decision like described above You don t need to insert another decision condition this time Calculate rental charges What is the car type Price is 50 per day Br 7 Is it a premium customer um e Mo premium customer 7 Inthe second step insert an assignment where the new price after the discount will be calculated Bosch Software Innovations GmbH 11 270 Chapter 2 Getting Started Calculate rental charges d What is the car type Price 10 discount 2 2 3 5 Adding a new Action Finally an action should be fired when a discount was granted With this action you can see in the result if a dis count is included in the calculated price 1 Select the Fire Action element in the palette by clicking on it 2 Now move the mouse over an existing element in the flow rule Move the mouse until the arrow points down below the previously added assignment ER z Is it a premium customer L Tes premium customer So premium customer Price 10 discount
187. e rule element 2 Leave the expression field 3 The dialog for Automatic Element Creation appears 4 Any new element appears in blue bold font Visual Rules tries to determine the correct data type for the new data element If it is not able to do so it uses the general purpose type any The type can still be edited in the second column of the table 5 If you want to create a new element in a parent package instead of the current rule or rule package you can drag it with the mouse to the place where it should be created 6 Ifthe new element is not an attribute of a data structure you can choose to create input output data or con stant data instead of the default internal data To do so right click the new element and choose the appropri ate action from the context menu Automatic Element Creation x Automatic Element Creation WE Visual Rules can assist you in creating new model elements Configure Data Element E Movie Ticket Pricing E 8 Pricing E K Internal Data ZS name SSS GG Convert to Input Data Ze Convert ko Output Data faa Convert to Input Output Data 2 Convert to Constant Data 7 Confirm the creation of the new element s with Create or click Don t Create if you do not want the new ele ments to be created but the editing of the expression text should still apply Click Cancel to cancel everything Bosch Software Innovations GmbH 159 270 Chapter 4 Tasks 8 Af
188. e several ways to navigate a larger flow rule within the flow rule editor e Click and hold the middle mouse button Moving the mouse while holding the middle mouse button will move the flow rule within the flow rule editor e Use the scrollbars to the right and at the bottom of the flow rule editor window e Click on a specific part of the flow rule in the Outline view to scroll to that location You can also hold the left mouse button and move the mouse within the Outline view e Use the arrow keys on your keyboard to navigate from one rule element to another e When dragging amp dropping rule elements you can hold still near the border of the flow rule editor Shortly there after the flow rule editor will start scrolling into that direction This way you can drag amp drop between parts of the flow rule that are not visible at the same time 4 3 3 3 Zooming There are several ways to zoom in and out of a rule in the flow rule editor Use the zoom toolbar buttons f a and A to zoom in zoom out and reset the zoom to 100 e Use the zoom drop down on the toolbar Lo wi e Press and hold the Ctrl key and use the mouse wheel to zoom in and out 4 3 3 4 Collapsing Expanding Branches A branch of a flow rule can be collapsed or expanded either by e clicking on the m or a boxes behind every rule element e by pressing the Space key 4 3 4 Configuring the Appearance and Capabilities of the Flow Rule Editor You can configure
189. e very important for the collaboration between the business ex perts and the rule author who may not necessarily be the same person It should always be pos Bosch Software Innovations GmbH 32 270 Chapter 3 Concepts sible to understand a rule by looking at the descriptions only and not at the actual contents rule ex pressions Rules are often drafted using descriptions only and later on in a second step the rule is refined by writing the corresponding rule expressions Related Concepts e Section 3 4 Flow Rule 29 e Section 3 12 Expressions 55 3 5 1 Decision Decisions are the most important concept of many rules They are used whenever a rule needs to make a distinc tion between two or more different situations e g for a specific rule about customers it may be relevant to check whether the customer is an adult or not This is what such a decision looks like in Visual Rules only descriptions are shown A decision element is displayed as a vertical yellow box with a description on top This box has one or more exits displayed as yellow diamonds within the box each with its own description Every such diamond defines one con dition If that condition is true the rule elements attached to that exit are executed If none of the conditions are true then the else exit is executed The else exit is a small grey diamond and is always the last exit of every deci sion Related Tasks e Secti
190. e with many links that help you to navigate from one concept to other related concepts The Tasks chapter contains many step by step procedures for different tasks you may want to perform when us ing Visual Rules For example it tells you how to create a new rule how to reuse other rules and how to enter rule expressions and many things more Again this chapter was written and organized to be used as a reference for when you want to do a specific task So all the procedures that have to do with similar concepts are grouped to gether That way it should be easier to find them The References chapter contains detailed information about all the wizards dialogs menus properties tabs etc 1 2 Support For support visit http www visual rules com or send an email to support visual rules com For information about the built in support request sending facility see Section 4 21 Sending a Support Re quest 188 1 3 Using the Visual Rules Online Help In Visual Rules Modeler select the menu entry Help gt Help Contents to open the online help All Visual Rules re lated information can be found in the Visual Rules section Browse topics in the Contents frame on the left Click on a topic to have it displayed Use the Back and For ward buttons to navigate within the history of viewed topics 1 am This button directs you to the previous page It is displayed both on the upper right and on the bottom left corner of every p
191. e with the corresponding icons mn WEB in the toolbar 2 2 Tutorial 1 Modeling Your First Simple Rule This section provides step by step instructions for building drafting and modeling a new flow rule that calculates the price for the rental of a car After this first tutorial you will have a complete rule that can be executed and tested in the next tutorial Testing Your First Rule In this tutorial you perform the following tasks e Create a new rule project e Create a new flow rule e Draft your first flow rule e Finalize your first flow rule 2 2 1 Task 1 Create a New Rule Project 1 Select the menu item File gt New and select the Rule Project entry from the list Rule Modeling Visual Rules Modeler Edit Navigate Search Project Run Window Help alt Shift n HIE Rule Project Open File Pej Project 2 The New Rule Project wizard appears 3 Enterthe name tutorial First Rule for the rule project Bosch Software Innovations GmbH 6 270 Chapter 2 Getting Started New Rule Project Rule Project Create a new rule project Project name Tutorial First Rule Use default location i Location C Dokumente und Einstellungeni inm0262 workspace_ M1 _EN Tut Browse Use default rule model name Rule model name Tutorial First Rule 4 Press Finish to create the new rule project When a new rule project is created Visual Rules automatically creates a new rule model inside Per default
192. ections include detailed descriptions for working with state flows rules and the state flow editor 4 5 1 Opening the State Flow Editor e inthe Rule Explorer double click on a state flow 8 to open the state flow editor Alternatively you can right click on the state flow and select Open aw ShateFlow a gt OrderProcess l EK Package aes ee New Element j RS S hen T lt Undo Delete Chr CS Delete Delete l tic Rename Fz gt StateFlow FS Copy Ctrl C aa ae F 8PCQen Paste Chr HHA IRE System HBA Visual Rules py Import Ra L ruleproject Export d of Refresh i Search References Find unused elements Team j Compare With Replace With KC Generate Rule Code clean Alk Enker Properties Related Concepts e Section 3 11 State Flow Editor 54 e Section 3 9 State Flow 52 Related References e Section 5 5 2 Project Explorer View 223 4 5 2 Configuring the Appearance and Capabilities of the State Flow Editor You can configure the appearance as well as the capabilities of the state flow editor via the View dropdown toolbar button gt Transition Rule Names S Descriptions w _ Notes Alternatively you can also right click in the state flow editor and select the according entries from the View context menu The following table shows the individual options Bosch Software Innovations GmbH 136 270 Chapter 4 Tasks Tabl
193. ed You can use an asterisk to represent any number of characters e g Score Final Will match all names containing both the words score and Final You can use a question mark to represent exactly one character e g category will match all names containing the word category preceded by exactly one character Initially the dialog will only show those elements that are accessible from the rule or rule package you are currently editing When you activate the Show all checkbox the dia log will show all elements from all rule models in your workspace When you now select an element that was not previously visible and click OK the Select dialog will also add the newly referenced rule package to the Reuse Packages tab of the current package This helps to save a lot of manual steps when reusing rules types or else from other rule packager or rule models The Show all checkbox will not be available when the type of element to be selected cannot be reused e g data elements and actions Displays the elements in a flat list sorted alphabetically Use this if you know the name of the element Displays the elements within the rule model and rule package hierarchy Use this if you know where the element can be found Related Tasks e Section 4 10 Working with Expressions 157 Bosch Software Innovations GmbH 219 270 Chapter 5 Reference Related References e Section 5 6 2 4 Fire Action Tab 234 e Section
194. ed exception field specify the exception type You can use to browse the existing exception types 4 Optionally specify expected values for the attributes of the exception This is only possible if you selected the third option above Output amp 69 gt SS CH Expect no exception oO Expect an exception Expect an exception with specific data Expected exception GeneralException Exception Attributes Expected Result Actual Result message String validation Failed 4 11 19 Executing a Test When executing a test a corresponding result file with the same name is automatically generated It is represented by the icon and added to the test in the rule explorer Bosch Software Innovations GmbH 167 270 Chapter 4 Tasks After you have entered all required test input data and the related expected results click on the button to run the rule test During execution all system messages like execution time are displayed on the Console at the bottom of the screen 4 11 20 Showing Results for a specific Execution of a Test A test might have been executed individually or in the course of executing a test suite At each time a correspond ing result file represented by the icon has been added to the test or to the relevant test suite in the rule explor er To show the results of a specific execution of a test do the following 1 Double click on the corresponding result file in the rule
195. edit conditions in the decision table do the following 1 Double click on the condition in the decision table This will open the inplace editor 2 Enter the expression for the condition mm O i 200 3 Press Enter to close the editor or click with the mouse outside of the editor Related Concepts Bosch Software Innovations GmbH 126 270 Chapter 4 Tasks e Section 3 7 1 Condition Column Row 49 Related Tasks e Section 4 4 2 Adding a new Decision Column or Row 125 e Section 4 4 4 Adding a new Condition 127 e Section 4 4 5 Adding an Else Condition 127 e Section 4 4 8 Rearranging Condition Columns or Rows 129 4 4 4 Adding a new Condition In order to add a new condition in the decision table editor do the following 1 Select the Decide element in the palette by clicking on it 2 Now move the mouse over an existing condition of the decision table A black arrow will appear to show you where the new condition will be added This can be for condition columns above or below or for condition rows before or after an existing condition or condition header Accordingly the black arrow will point to the left to the right up or down Move the mouse until the arrow points into the direction you want BETWEEN 1 200 1 A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and
196. editor is maximized Depending on the state of the al toolbar button the list only shows the elements defined and owned by the rule it self or all elements in the rule package hierarchy or being reused All elements can be edited by double clicking them A single click on a selected item allows it to be renamed Ele ments can be created and deleted using the corresponding and buttons The palette can be collapsed and expanded by clicking on the small black arrow in the title bar of the palette Rule Context Gi GE Input Output Data f CG Car_group Dm CG customer ID Any g days_rent Integer ia Price Integer C2 Internal Data G i x Q Constant Data G i deal i compact Any g Pull size Any E Actions di x S no_discount_allowed Standard Ey send brochure Standard Services DA E Rule Tests JP 24 g Price_Calculation Test Figure 3 4 Rule Context palette Bosch Software Innovations GmbH 47 270 Chapter 3 Concepts Related Tasks e Section 4 3 Working with Flow Rules 103 Related References e Section 5 3 1 2 Rule Context Palette 206 3 7 Decision Table A decision table is a rule representation especially suited for rules with many decisions based on only a few inputs The following image shows a Visual Rules decision table that determines the number of bonus points a customer receives depending on the kind of bonus card he or she holds
197. eeceaeatananeuctancussqossesteeneestesosaseseewtandeeewunese 161 Ai EIGN eS a RUS TES E 162 ah E CODY Ne ERT E 162 4 11 5 Moving a Test from one Rule to another niviscccdeasscaccswendsccsaaveesdeavesesdesssandacsasdeusssedssuceeeescaseeswers 163 4 11 6 Adding Test Cases asaciveucscscoyestacsubessasncden iecsevepoceaieaplensuaueenoocdsousctetavecnbosstausutepseaquceesesseoeseaet 163 Ady Ton eer 164 AMO Etienne El E 164 A AN COOVING and DASHING Vale E 164 4 11 10 Enabling Disabling Test Cases ccccccccccec ence nce ntentee testes ees eeseeseesensensenseseaseeeateneeaeegeegeesens 165 A T11 Duplicating EE 165 4 11 12 Deleting Test Cases EEGEN 165 AII Reordenne lest e 166 4 11 14 Selecting the relevant Output Data 166 AAS Ee EECHER Ehe 166 4 11 16 Defining Expected Results aegietaktesgieigure sta gen dree AER ebe ee EEGENEN drerte eh 166 4 11 17 Disabling Warnings for Missing Expected Results cccceccescesceeceeseeeseeseesenseeseessensesseeanen 167 4 11 18 Defining Expected Exceptions cccc cece cccenccenceecteesseesteesteesteeseeesteeseeseeteesseegeeeseeeqeeges 167 AMA eS gt PCCM 1a WOSU EE 167 4 11 20 Showing Results for a specific Execution Of a lest 168 AT ANN Cer Ie US e E E E E E E O TE 168 4 11 22 Creating and Configuring Statistics ccc ccc cce esc e eee nc ence es eee eee eeeseeseesenseeeeeeseeseeeeeeseeseeasens 169 4 11 23 Selecting a Configuration for the Rule Execution
198. eeee eee eee eee eeeeeeeeeeeeeeeeeeeeeeeeeseeeseenseenseeeseeeeeensees 137 Ass ClEAUNe Mans OMS EE 137 4 5 6 Editing Descriptions of State Flow Elements 138 a EE ECM ee SIUION E UE 138 4 5 8 Copying or Moving a State Flow Element 138 4 5 9 Changing the Size of a State Flow Element 139 4 5 10 Deleting a State Flow Element 139 AE E Adae le 139 4 5 12 Deleting a Note esssseeeesecesesesereserererererererererererererereresererererererererererereeeeeeeeerereeeeeeeeereees 140 AS os Re ee TE NEE 140 A6 Working wih Data ee 140 4 6 1 Defining Input Output Data Elements sidcninseiesciwinecetocesiecetsantesncascisadecsvaiasecssindadoetesaiwnedesaueanecees 140 4 6 2 Defining Internal Data Elements 141 4 6 3 Defining Constant Data Elements cc cccc cece nc ceneeenceeneeeneeenseenseenseesseenseesseesseeseeesseesseesgeeas 142 4 6 4 Importing a CSV file as a Constant Data Element 142 4 6 5 Specifying the Data Type of a Data Element 144 4 6 6 Specifying the Default Value of a Data Element 145 4 6 7 Deleting Data Elements attente eege ee ee 145 4 6 8 Copying Data Elements 145 AG 9 COnVet Data EISENI ee 145 4 6 10 Moving Data Elements 146 4 6 11 Sorting Data Elements Manual 147 4 6 12 EIERE CHE EC 148 AG a gt ee Data TPES ee ege 148 4 6 14 Creating GroUDS EE 149 Lo Tae Deen Ee Te EE 149 46 16 Editing RE le 149 AO r OnE NOO oan a EE E E E E T E 150 4 7 Working with Data Types
199. eenseenseesseegseenseeseeegeess 111 4 3 10 5 Editing the Common Condition Prefix cece cece cece eee e nce eeeeeneeeneeenseenseeneeeneeenseeneeeneeenseensees 111 4 3 11 Editing an Assignment Element csccsccsccsvccsccsvcssccsccsvesncessessesseeseeseessesseseeessessseseessesees 112 OS e EGUNE ATAS SENNEN EE 112 4 3 11 2 Adding an Assignment to an Assignment Element 113 4 3 11 3 Deleting an Assignment from an Assignment Element 114 Bosch Software Innovations GmbH vii 270 Modeling Guide 4 3 11 4 Reordering the Assignments in an Assignment Element 114 4 3 12 Editing a Fire Action Element 114 AT Edine a Reveal EENE E 115 4 3 14 Editing an End Repeat Element 115 4 3 15 Editing a Call Flow Rule Element 115 4 3 16 Editing a Call Decision Table Element 116 4 35172 Eating a Call Service Elemen EE 117 4 3 18 Editing a Return Exception Element 118 4 3 19 Editing a Handle Exception Element 119 4 3 20 Copying or Moving a Branch of a Flow Rule 119 4 3 21 Copying or Moving a Single Rule Element 120 4 3 22 Deleting a Branch of a Flow Rule ccc cece cece nce e cee ee eee eeeeeeseeneeeeeeeneeenseeneeenseenseenseenseensees 120 4 3 23 Deleting a Single Rule Element 120 4 3 24 Deleting Multiple Rule Elements cccccceceeccenceeceeceentenseeesesseeseesesseeseeasesseseseasensesaeense 120 A 3520 e Tee a Branch Rei lee EE 121 4 3 26 Deleting a Branch Description
200. efined there All dependencies of a rule project are defined in the file ruleproject vr The contents of the ruleproject vr file can be viewed and edited with the rule project editor This file has two purposes e specify a unique identifier for the rule project itself consisting of a Group Id Artifact Id and a Version e specify the dependencies of the rule project i e Group Ids Artifact Ids and Versions of other rule projects or rule artifacts or libraries required by this rule project en E ema 2 E Movie Ticket Pricing gt Movie Ticket Pricing ER Input Outout Data DOE Constant Data ER Actions a Data Types ER Bonus Points S Discounts Es Pricing i gt ruleproject vr Related Concepts e Section 3 2 Rule Model 25 Related Tasks e Section 4 1 1 Creating a new Rule Project 89 e Section 4 1 2 Setting Rule Project Identifiers Group Id Artifact Id Version 89 e Section 4 1 3 Defining Rule Project Dependencies 90 Related References e Section 5 5 2 Project Explorer View 223 e Section 5 3 6 Rule Project Editor 214 3 2 Rule Model A rule project contains at least one rule model Every rule you define is part of a rule model A rule model can contain only a few or maybe hundreds or thousands of such rules Rule models and their contents are shown in the Rule Explorer or Project Explorer Rule models are represented by this icon
201. either gold or silver and the money spent for the purchase According to the decision table a gold card holder which has spent more than 8 will receive 50 points A silver card holder who has spent less than 8 will receive only 15 points What Bonus Card How much did does the customer have the customer pay bonus points bonus_card money_spent BONUS_CARD GOLD BONUS_CARD SILVER Figure 3 5 Decision table Conditions yellow can be either positioned at the left side of the decision table or at the top For example the following picture shows the decision table with an additional condition row for the day of week On Wednesday bonus points are doubled On all other days expressed by the empty condition the normal bonus points apply Day of week st cata WEDNESDA weekday What Bonus Card How much did does the customer have the customer pay bonus_points bonus_ points bonus_card money_spent BONUS_CARD GOLD BONUS_CARD SILVER Figure 3 6 Decision table with conditions to the left and at the top Related Concepts e Section 3 4 Flow Rule 29 Related Tasks Bosch Software Innovations GmbH 48 270 Chapter 3 Concepts e Section 4 4 Working with Decision Tables 125 Related References e Section 5 3 2 Decision Table Editor 207 3 7 1 Condition Column Row Condition columns or rows yellow define the conditions that are being checked by the decision table
202. elf are displayed with a grey background These buttons add a new element into the corresponding section e g a new internal data element or a new rule test These buttons delete the currently selected element They only activate when an element is selected Sections can be pinned open with these little pin buttons This will prevent the section from collapsing automatically to make room for others zer iesean dsn atte conato O Senes Tis seater dss aie sees aaeeei 5 3 2 Decision Table Editor The decision table editor is used to view and edit decision tables 5 3 2 1 Decision Table Editor Palette The decision table editor palette contains all available elements that can be added to the decision table Addition ally it contains tools for selections and zoom Bosch Software Innovations GmbH 207 270 Chapter 5 Reference K Select DL Zoom GE Box Select Select multiple cells lt gt Decide Add a new condition column or row Else Add a fallback condition E Assign Add an assignment column Fire Action Add an action column ES Return Exception Add an exception column This is the default tool Use this to select move and copy elements of the decision table Double click on cells to edit them This is the zoom tool Click to zoom in Press Shift and click to Zoom out Draw a rectan gle to zoom the enclosed area Box Select This allows to make rectangular selections of cells Decide Inserts a
203. en writing rules However it is also easier to make mistakes when using the any type E g it is perfectly fine to multiply two any values in a rule However if they are actually a date and a string then multiplication doesn t make any sense and will cause the rule to fail when it is executed So it is always a good idea to not overuse the any type In addition to the built in data types it is also possible to have user defined data types User defined data types are located in the Data Types folders They can be defined on the rule level On the other hand it is advisable to de fined them on the package or even rule model level so that they are shared among all the rules in the model There are different kinds of user defined data types The most important one is a structure Structures are a col lection of multiple values called attributes that belong together e g a customer structure defines the attributes of a customer first name last name gender birthdate and address A data element of type customer Can contain a value for each of these attributes Other kinds of user defined data types are enumerations type aliases and exceptions These and all the other kinds of data types will be explained in detail in the following sections It s a convention for data type names to have an uppercase letter as first character Related Concepts e Section 3 14 1 Basic Data Type 71 e Section 3 14 2 Type Alias 74 e Secti
204. ens the flow rule being called in the rule editor Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if at least one ielement is available a Inserts another element to a collection list or set This is only available when the selected input data element is a collection list or set Removes the currently selected value for a collection data element If the input data ele ment of the rule you are reusing does not exist anymore you can remove the value you previously assigned to it with this button CG This button automatically inserts data elements as input data when they have the same name and type Only inputs still without a value will be affected a This button automatically inserts data elements to assign the outputs to when they have the same name and type Only outputs not yet assigned will be affected Table Column Column o Deseription Bee Data This column shows the name and type of the input data of the rule you are EEN Cells in this column are read only Value The value you want to assign to the input data This can be any expression You can edit cells in this column by double clicking them Code Assist Ctrl Space is available Description The description for this row You can edit cells in this column by double clicking them Table Column Column o Deseripion SC Data EE column shows the name and type of the output data of the rule you ar
205. ent nothing happens Because every element can only ap pear once within a unique collec tion the element is guaranteed to not be contained in the collection af terwards For data and data types defined outside of Visual Rules the behavior of the ADD assignment may be different Especially it is possible that the element is not added to the end of the collection but some where else The exact behavior is defined by the implementation of the collection within your busi ness object model Related Concepts e Section 3 14 7 Collection 76 3 5 3 Fire Action Bosch Software Innovations GmbH 37 270 Chapter 3 Concepts Actions are used to define the consequences of a rule The Fire Action element is used to trigger a specific ac tion The value of the fired action is set to true This status can then later be evaluated by any caller of the rule Additionally depending on the type of action fired specific things can happen E g the action may send an email or trigger another process or produce other domain specific results Visual Rules can be extended by adding any number of custom action types The Fire Action element specifies which action it wants to fire It can fire any action that is defined for the rule itself or for the packages containing the rule The name of the action is displayed next to the Fire Action element e g this fires the action named EMail if today is the customer s birthday
206. epeat No discount is allowed The price for this cars is 60 KI Return Exception Create an exception message and continue where exceptions are handled EI Handle Exception D ore than d s Specify what to do when an wi exception message is 7 a es returned Po LW a Figure 3 2 Rule Editor The flow rule editor is a sophisticated graphical editor with a tool palette drag amp drop capabilities zoom and inplace editing functionality Inplace editing means that many things can be edited right within the graphical display e g all the descriptions and or rule expressions shown next to each flow rule element can be edited simply by dou ble clicking on them Some other settings for each flow rule element can be edited in the Properties view The Properties view always shows the settings for the currently selected rule element When changes have been made to a flow rule the flow rule editor will indicate this by displaying an asterisk in front of the flow rule name shown in the editor s tab Clicking the al button or pressing Ctrl S will save these changes Related Tasks e Section 4 3 Working with Flow Rules 103 Related References e Section 5 3 1 Flow Rule Editor 205 3 6 1 Rule Editor Palette The rule editor has a palette from which the user can select new rule elements to be inserted into the rule The palette also contains tools for zooming adding notes and adding bran
207. er a specific description 4 11 12 Deleting Test Cases 1 Select the test case you want to remove 2 Click the button Bosch Software Innovations GmbH 165 270 Chapter 4 Tasks 4 11 13 Reordering Test Cases 1 Ifyou want to reorder your test cases you do this by selecting the particular test case in the list 2 Use the 7 and buttons to send the test case to the right position in the list 4 11 14 Selecting the relevant Output Data 1 To select the data elements for which results should be considered in the test you have to switch to the Con figuration tab of the test editor 2 Inthe Relevant Output Data section you have the possibility to de select either all or every single data ele ment separately or use the Select All and Deselect All buttons Relevant Output Data Oal None Selected Data Elernent Description S BC Output Data E E ca output faa bonus_points ia price Calculated price fc actions ri coupon discount grante Fires if the coupon discount was granted ri general seating Fires if visitor takes a normal seat ki special seating Fires iF visitor takes a deluxe seat T student_discount_grante Fires if the student discount was granted ki weekend surcharge ad Fires if an extra charge is added at week 4 11 15 Enabling Disabling Actions 1 In some cases it might be useful to prevent certain actions from being executed during a test run They are fired and you can list them as
208. es e Section 3 5 3 Fire Action 37 e Section 3 16 Action 79 Related Tasks e Section 4 8 1 Defining Actions 154 Related References e Section 5 6 7 3 Output message Action Tabs 250 Bosch Software Innovations GmbH 114 270 Chapter 4 Tasks e Section 5 6 7 4 Log message Action Tab 251 e Section 5 6 7 5 Send e mail Action Tabs 252 e Section 5 6 7 6 Write CSV File Action Tabs 253 4 3 13 Editing a Repeat Element Different settings for a repeat element may be necessary depending on the type of repeat In the Properties of the repeat element on the Repeat tab do the following 1 Select the type of repeat you want to use in the repeat element You can choose between for each of multi ple elements while a condition holds and with counter 2 After the selection of a repeat type the view changes and the repeat type specific settings appear 3 Insert the repeat type specific settings For example the properties of a repeat element from repeat type Repeat with counter Properties x BR EI Repeat 87 Repeat Description Repeat for each of multiple elements while a condition holds Co with counter Counter counter Stark 1 Related Concepts e Section 3 5 8 Repeat 40 e Section 3 14 7 Collection 76 e Section 3 12 Expressions 55 Related Tasks e Section 4 10 1 Using the Code Assist 157 Relate
209. es and to inspect the state of the data currently being processed 3 23 1 Debugger The debugger is a separate perspective built into Visual Rules Modeler The perspective is named Debug and Vi sual Rules automatically switches to it when needed e g when a breakpoint is reached The debugger is used to manually step through rule execution inspect the data being processed and by doing so identify errors bugs in the rules gt Debug Movie Ticket Pricing Movie Ticket Pricing Pricing vrrule Visual Rules Modeler File Edit Navigate Search Project Run Window Help E Bei Els Sum ep Oil dn Uell E 6 Bac o ZE ECH SOP GH Hwee F Debug 22 a Servers O variables 23 Soe 7 Em ze i bF z Th E Name Value E gt Pricing Test vrtest visual Rules Fa coupon False la de visualrules rulerunner RuleRunner at localhost 2628 ij auditorium_no 1 ER Sue faa show date 2007 09 21 gt Condition 11 i seat_no 201 Decision 4 i student False 0 Condition 10 EES gt Decision 7 i price o M Pricing fa bonus_points 0 eal C Programme Javaljdki 5 0_12ibinijavaw exe May 15 2006 10 57 09 AM 28 rom N BE outline 22 Audit No 1 Special T price r UE Ke Palette Ke Ke Rule Context b General seating Audit No 1 General 5 el between 201 600 price 5 Ke EEN o ege id Leena af cken daka gt i 53M of 71M D
210. es that are located in the same rule package or in any subpackage or in rule packages that are defined to be reused See Section 3 3 1 Rule Package Reuse 28 for details about reusing packages The Call Decision Table elements specifies the name of the decision table being called This name is displayed next to the element like this Bonus Points The values for any required input of the called decision table are also specified within the Call Decision Table ele ment This way rules can forward data to the decision table In the same way any results coming out of the deci sion table can be assigned to data elements of the calling rule This is also specified within the Call Decision Table element In other words the Call Decision Table element calls a decision table and handles all the data flowing to and from the decision table Input and output data is specified on the Call Decision Table Rule tab in the Properties view Related Concepts e Section 3 7 Decision Table 48 e Section 3 3 1 Rule Package Reuse 28 Related Tasks e Section 4 4 Working with Decision Tables 125 Related References e Section 5 6 2 6 Call Decision Table 235 Bosch Software Innovations GmbH 39 270 Chapter 3 Concepts 3 5 6 Call Service Call Service elements are used whenever a rule wants to call a service The service is called and afterwards pro cessing continues after the Call Service element Service
211. es that the value limit is inclusive An open interval bracket turned to the outside indicates that the value limit is exclusive In the example above 15 9 means that the value is greater than 5 but it does not equal 5 3 12 7 Calling Functions To call a function specify the function name followed by parentheses containing a list of parameters Functions can have one multiple or no function parameters Example 3 6 Calling functions currentDate 2007 12 24 sqrt 2 startsWith String Characters The examples above show the currentDate function call without function parameters and function calls with one and two parameters Related Concepts e Section 3 18 Function 81 3 12 8 Accessing Attributes Data elements of a structured type have one or multiple attributes In order to refer to the value of a specific at tribute of a structured data element you write the name of the data element followed by a dot and the attribute name E g customer name refers to the value of the attribute name of the customer If an attribute itself is a structure repeated use of the dot is used to navigate to the desired attribute Bosch Software Innovations GmbH 58 270 Chapter 3 Concepts Example 3 7 Accessing attributes of structures g Data Types GG Appointment GG Attributes ge date_of_appointment Date description String ERo Department 2 Attributes CS locations String List oe ei pro
212. escriptions These are automatically underlined if the protocol e g http resource or file is specified marking them as links Click ing on a link opens the associated application displaying its contents Related Concepts e Section 3 15 Description and Note 78 4 6 17 Editing Notes You can enter notes for rule models rule packages and rules 1 Inthe Rule Explorer select a rule model rule package or rule that you want to add the note to 2 Inthe Properties view activate the Notes tab Click on the button to add a new note or click on the corresponding button to remove a note 4 Enter the text of the note You can also specify hyperlinks to external documents within notes These are automatically under lined if the protocol e g http resource or file is specified marking them as links Clicking on a link opens the associated application displaying its contents Related Concepts e Section 3 15 Description and Note 78 4 7 Working with Data Types The following sections contain step by step procedures for different tasks with data types e Section 3 14 3 Structure 74 e Section 3 14 2 Type Alias 74 e Section 3 14 5 Enumeration 76 e Section 3 14 6 Exception 76 4 7 1 Defining Structures In order to create a new Structure for a rule a rule package or a rule model in the Rule Explorer do the following 1 Select the rule rule p
213. est suites It shows the description of the test suite and displays all contained rule tests and nested test suites Actions for ex ecuting the test suite and for opening the contained tests in their respective editor are available as well as a bar that shows the progress of the test suite execution and the overall success Test failures are displayed in the table on the right side re Test Suite 3 S Test Suite Description Tests x OG Ze BL 5 11 iji H Test Description Tests Test case Failure message fa Test Testcase values differ expected 2 but was 1 element inout type Any Figure 3 23 Test Suite Editor Related Concepts e Section 3 22 4 Test Suite 86 e Section 3 22 1 Rule Test 83 Related Tasks e Section 4 11 Testing Rules 160 e Section 4 12 Organizing Rule Tests in Test Suites 172 Bosch Software Innovations GmbH 86 270 Chapter 3 Concepts Related References e Section 5 3 5 Test Suite Editor 213 3 23 Rule Debugging When new rules are created they sometimes do not work as they should right away They may produce unexpect ed results or seem to make the wrong decisions In these situations it is important to have a means to more closely inspect what is going on during rule execution This is what rule debugging is about Rule debugging lets the user step through the rule execution one step at a time halt at specific locations in the rul
214. ferences e Section 5 6 4 1 Extensions tab 241 5 6 8 Data Types The following sections describe the properties tabs available for the different kinds of data types like structures type aliases enumerations and exceptions Bosch Software Innovations GmbH 255 270 Chapter 5 Reference 5 6 8 1 Data Types Tab This tab is shown when an element that contains data types like a rule model a rule package or a rule is selected in the Rule Explorer You can edit the data types here Note that this tab has four sub tabs for Structures Enumerations Exceptions and Type Aliases C Properties 3 zc op Data Types Data Types ALES d Name Type Multiple Implementation Default Yalue Description E A z TH Structures P ES Appointment Customer Department Employee Schedule E El Structures Enumeratians Exceptions Type Aliases Figure 5 72 Data Types tab e eum Initially all elements are collapsed This button will expand them so that all elements are visible Adds a new data type The data type created depends on the sub tab at the bottom you are in Creates a new group This allows you to organize your data types Pe Removes the currently selected data type or group Inserts another element to a collection list or set This is only available when the selected attribute of a data type is a collection list or set This column shows the name
215. flect the new name 4 Click on Preview gt to get a list of all the upcoming changes that the rename will cause You can also uncheck only some of the changes that you don t want to make while leaving others checked Click on Cancel if you don t want to make the changes 5 Click on OK to perform the rename Related Concepts e Section 3 4 Flow Rule 29 4 2 11 Finding a Rule 1 Open the Open Rule dialog by selecting the Navigate gt Open Rule menu entry clicking on the Open Rule toolbar item i or by pressing Ctrl Alt R 2 A dialog will open that contains a list of all rules in all rule models in the workspace 3 Enter the beginning of the name of the rule you want to open This will filter the list so that it only shows rules with matching names If nothing is entered the list will show all rules You can use asterisks or question marks as wildcard characters 4 Selecta rule in the list and press OK to open that rule in the rule editor Alternatively you can double click an entry in the list Bosch Software Innovations GmbH 98 270 Chapter 4 Tasks Instead of using the Open Rule dialog you could also use the search capabilities of Visual Rules to search for specific rules in your rule models Related Concepts e Section 3 4 Flow Rule 29 Related Tasks e Section 4 14 Searching Rule Models 178 Related References e Section 5 4 1 Open Rule Dialog 216 4 2 12 Copying
216. formation for the elements in the palette Bosch Software Innovations GmbH 208 270 Chapter 5 Reference When this button is not pressed the palette only shows elements that are defined by the decision table itself When the button is pressed the palette will show all elements the decision table has ac cess to thus including elements that are defined on the rule packages above Elements not defined by the decision table itself are displayed with a grey background These buttons add a new element into the corresponding section e g a new input data element or a new rule test These buttons delete the currently selected element They only activate when an element is selected Sections can be pinned open with these little pin buttons This will prevent the section from collapsing automatically to make room for others ze ssar days ane aeons avalible deson 5 3 3 State Flow Editor The state flow editor is used to view and edit state flows 5 3 3 1 State Flow Editor Palette The state flow editor palette contains all available state flow elements that can be added to the state flow Addition ally it contains tools for selection zoom and notes N Select GC Zoom L Add Note Add a note eg State Add a State Ej End State Add an End State Ei Transition Make a Transition Figure 5 14 State flow Editor palette This is the default tool Use this to select move and copy state flow elements descrip ti
217. get you want to paste the copy into and select Paste from the contextual menu Alternatively you can also select the target and use the Ctrl V key combination 3 The copy is pasted Please be aware that the copy has a different name like the original When no copy can be pasted the Paste menu item is greyed out This is because the copied item cannot be pasted to this location In this case select a different appropriate target 4 To give the copied item a meaningful name rename it using F2 When copying you can also copy and paste multiple items at the same time To do this simply select all the ele ments you want Keep the Ctrl key held down to select multiple items Then carry out the procedure above Related Concepts e Section 3 13 Data 67 4 6 9 Convert Data Elements To convert data elements do the following Bosch Software Innovations GmbH 145 270 Chapter 4 Tasks 1 Select the data element in the Rule Explorer 2 Right mouse click and select the Convert To entry from the context menu and select the new data element type You can also convert data elements by moving them into another data element folder This works only if there al ready exists a data element in the target folder else the target data element folder is not displayed Please be aware that the properties of different element types can vary When moving between data element types information may be lost Related Concepts e Sec
218. gher performance of the IN operator to check if a specif ic element is contained in the set compared to a list or a collection This is especially true if the set contains a lot of elements The elements of a set don t have a specific order and indexed access is consequently not possible Accessing the elements is done via the Repeat rule element Two sets are equal if they contain the same elements be K Data Element Name alMMyCustomers Name Default Value Description allMyCustomers Customer Set Collection If a data item is a Collection the elements of this collection don t have a defined order and indexed access with square brackets e g customer 3 is consequently not possible The collection can contain the same ele ment multiple times Duplicates are not eliminated automatically as is the case with sets Accessing the elements is done via the Repeat rule element Two collections are considered equal if they contain the same elements the same number of times indepen dent of their order You cannot manually define a collection with Visual Rules Modeler However collections may appear in imported data models e g when importing JavaBeans The following table illustrates the most important differences between Collection List and Set Indexed ac Can contain duplicates IN Operator cess allowed slow Bosch Software Innovations GmbH 77 270 Chapter 3 Concepts Indexed ac Can contain
219. gure 5 71 Fire Read CSV File Action tab O omo O a Fire Acten Enter the name of the action that you want to fire Code Assist Ctrl Space is available Data source ID Enter an ID representing the CSV file This ID is used when calling the next function in order to repeatedly read the next record line from the file Enter the file name of the CSV file that will be read Click on Choose to open a file browser Field separator Select the separator that is used between the columns Click on Preview to open a dia log showing the CSV file contents This lets you check if the current settings for the sepa rator and quote character work properly Quote character Enter the character that acts as a quotation start end identifier Character set set Select the character set of the file the character set of the file Use See line as ey this if the first line in the CSV file contains the column names column names Target object Specify a data element that will hold each record line of the CSV file This object must have attributes whose names match with the column names It is set to the next record every time the next function is called with the specified data source id see above Click on Create to automatically create both a data type and a data element to hold each record If the CSV file contains column names in the first line these will be used as the names for the attributes of the created data type Related Re
220. h Software Innovations GmbH 267 270 Chapter 5 Reference type filter text Validation General gt Ant Data Management gt Help Install Update gt Java gt Model Validation gt Plug in Development gt Report Design Run Debug gt Team Validate Rule Projects automatically during build isual Rules Automatic Element Creation Dependency Management Editors Expressions Notes Test Execution User Settings Validation Figure 5 85 Validation preferences C Validate Rule If activated rule projects are automatically validated during build Projects automati cally during build You can manually start the validation of selected rule projects with the button in the toolbar 5 7 8 Notes Preferences This preference page is used to define different categories of notes with different settings e g whether or not for a note a corresponding task is automatically created Here some predefined categories are provided by default Bosch Software Innovations GmbH 268 270 Chapter 5 Reference Preferences type Filter text General Define categories For your notes Ant IF the text of a note starte with the name of a category the Data Management note is treated according to the settings made bere Help Instali Update Mote categories Java default gt Model validation i Plug in Development Report Design Run Debug Team Down Visual Rules oo Auto Creation Delete C
221. h in element descriptions Expressions will search in rule expressions Notes will also search in notes Bosch Software Innovations GmbH 220 270 Chapter 5 Reference C Determines which rule models or which parts of rule models are searched e Workspace will search all rule models in your workspace e Selected elements will limit the search to those rule models rule packages or rules that are currently selected This option is only available if a suitable selection was done before the dialog was opened Enclosing rule models will search all of the rule models for which one element con tained within was selected This option is only available if a suitable selection was done before the dialog was opened 5 4 6 Compare Results Dialog This dialog allows to compare the expected with the actual result within the test editor Compare Results Dialog Expected Result Actual Result Visuell Rules is an especially intuitive Visual Rules is an especially intuitive and high performance Business Rules and high performance Business Rules Management ayetem BRMS for developing Management Sstem BRMS for developing business rules as part of agile software Ee rules as part of SES software Business logie is modeled graphically tested B logic is modeled _ teste and automatically translated into Java Bch automatically translated into Java program
222. h input and output This is defined by the Input Output setting Additionally input data elements can be defined to be required That means that a value must always be specified for this input element when the rule is called When the input is not required a value is optional Required input data will be indicated by a small red dot in the element s icon E Properties 3 i Problems 3 Tasks EI Console TS Navigator ae OS Input Output Data Input Output Data Advanced EN Mame InputfOutpuk Required Default Yale Type Multiple Implementation Description Vz E SS CustomerRating e E Customertd in YES Integer Mo CG fa customerRating out No Integer No Ee customers in Tes Customer List Yes Input data can be defined both on the rule level or on the rule package level Values for input data defined on the rule level will always have to be specified when the rule is reused Values for input data defined on the rule pack age level will have to be specified only if the rule reusing the other rule is not located in that same package or any sub package thereof In other words input data on the rule package will have to be initialized only when a rule of that package is reused from outside of that package Related Tasks e Section 4 6 1 Defining Input Output Data Elements 140 e Section 4 6 Working with Data 140 3 13 3 Internal Data Internal data elements are used by rules internally only
223. h makes it easy for the business user to concentrate on the modeling of the business log ic It is not a prerequisite to define the data items first that will be used during rule modeling Instead data ele ments can be created automatically during rule authoring After finalizing the rule modeling Visual Rules provides a powerful testing functionality to guarantee high rule qual ity When the business analysts complete the rule modeling process the rules are handed over to IT The technical experts don t need to know about the modeled business rule logic and just have to deal with the integration of the rule model For a start we focus on the Rule Modeling perspective and on working with the rule editor For rule modeling tasks most of the rule authoring process takes place in the rule editor and for basic modeling of rules it is sufficient to see just this editor Bosch Software Innovations GmbH 4 270 Chapter 2 Getting Started LR a BeuRent a Palette p Select Zoom Add Mote aided a note E tr Dese Branch idia Geescription be a whole branch D Decide Make a decision and update dats Fire Action Fire an action E Call Flor Rule Cal nother Hoe rule E Cal Decision Take Cal a deisi Libe E Call Service Cal 4 sarria di Done amp Return Jeeredateke veien to Ve calling rue J Reperat Deco thee EEN 4 Fred Bepeat lmreciatety eo a Rep aj Ratun Exception Create A EE Mec
224. h rule element These indicate how often each rule element was executed When statistics are activated these counters are displayed next to each rule element like shown below Bosch Software Innovations GmbH 84 270 Chapter 3 Concepts Audit No 1 Special 7 Lo Special seating General seating Audit No 1 General 5 5 Figure 3 20 Display of statistics in the flow rule editor Special seating General seating Little barcharts are added when you activate the Percentages option from the statistics drop down The percent ages specify how often each individual element was executed in relation to how often the whole rule was execut ed Audit No 1 General 5 General seating el Lt ee Figure 3 21 Display of statistics with percentages Special seating General seating 25 You can also look at execution times by activating the Times option from the statistics drop down This will show execution times at each element Please note that these times always specify how long it took to execute the whole branch So times are added up from right to left F Auditorium No a 10 L 0 574ms 0 d ec 37 0 El i 3 37 General seating LES HI 25 0 a A 3 ll ec 25 0 Figure 3 22 Display of statistics with percentages Bosch Software Innovations GmbH Special seating Audit No 1
225. he mouse button Related Concepts e Section 3 9 State Flow 52 Related Tasks e Section 4 2 17 Copying a State Flow 101 4 2 19 Reusing Rule Packages You have the following possibilities to reuse rule packages e Section 4 2 19 1 Manually selecting Rule Packages to be reused 102 e Section 4 2 19 2 Executing an automatic Organization of Package Reuse on Package Level 102 e Section 4 2 19 3 Executing an automatic Organization of Package Reuse on Rule Level 102 In specific cases an automatic organization of package reuse on package level is not possible If so a corresponding message appears Related Concepts Bosch Software Innovations GmbH 101 270 Chapter 4 Tasks e Section 3 3 1 Rule Package Reuse 28 Related References e Section 5 6 5 1 Reuse Packages Tab 241 4 2 19 1 Manually selecting Rule Packages to be reused If you want to manually select the rule packages to be reused do the following 1 Select the rule package in the Rule Explorer that should reuse other rule packages 2 Inthe Properties view activate the Reuse Packages tab Press the button to add one or more packages to the list of reused packages 4 Adialog will appear that shows all rule models in the workspace and their rule packages If you miss a rule model then the rule project containing the currently selected rule package does not declare a dependency to this rule pack
226. he namzor operator This will simply return the whole ex pression as a string For example NAMEOF shoppingcart product 5 price will produce the string shoppingcart product 5 price Note If the expression is enclosed in brackets these will not be included in the resulting string 3 12 14 Collection Operators If a data element is a collection it can hold multiple values of the same type other terms you may be familiar with for this kind of data element are list or array A collection itself is defined by listing the desired elements in curly brackets The elements in a collection are separated by commas An empty collection is simply written as Example 3 9 Collection values Ze ze E RED GREEN YELLOW BLUE customerA customerB customerC Bosch Software Innovations GmbH 60 270 Chapter 3 Concepts Two collections are unified using the plus operator The result is a collection that contains the elements of the first collection and those of the other collection Example 3 10 Union of collections collectionl collection2 stringList anotherstring The minus operator is used to produce a collection that is the difference between two other collections The re sult is a collection that contains the elements from the first collection that are not in the second collection The operation takes into account the number of times an element is contained in the collections Th
227. ht next to it so you can easily see the results of the test execution Pressing this button will show the input output data elements in the Output panel Pressing this button will show the actions in the Output panel You will be able to see which actions fired and which did not Pressing this button will show the expected exception in the Output panel Expands all elements that have children to show every element in the tree Pressing this button will show the internal data elements in the Output panel Bosch Software Innovations GmbH 212 270 Chapter 5 Reference Hides the input parameters that are not used i e don t have a value assigned to them in the Output panel Inserts a new element into the list element selected in the Output panel Deletes the selected list element Copies the currently selected result values to the expected result column Copies all result values to the expected result column Opens the Compare Results Dialog 5 3 5 Test Suite Editor The test suite editor allows you to group and execute existing rule tests together in a test suite It has a bar that vi sualizes the progression of the test execution A green bar indicates that all tests passed while a red bar shows that at least one of the executed rule tests failed Test Suite 3 Test Suite t Description Tests x O 2 e f Whee o 1 H Test Description Tests Test case Failure message H Test Testcase values differ expected 2
228. ialog opens and initially displays all rule tests in the workspace Bosch Software Innovations GmbH 173 270 Chapter 4 Tasks RT ee M w e i A All Tests KO EE Select tests t Description Ka d ZE o Oo ts e gt BonusFoints Test iMovie Ticket Pricing Bonus Pa l K gt Pricing Test H Test Description F iMovie Ticket Pricing Bonus Points 3 Optionally you can click the button to display test suites 4 Optionally you can type the first letters of the test to add This filters the tests being displayed 5 Select all tests to add and press OK A rule test can be added to any number of test suites or to no test suite at all 4 12 4 Removing Tests Removing a test from a test suite does not delete the test It simply means that the test will no longer be executed with the suite 1 Select all tests you want to remove in the test suite editor 2 Click the button either in the test suite editor s tool bar or in the context menu Only tests that are directly included in the edited test suite can be removed this way If you want to remove tests that are part of a test suite in the test suite you have to open the nested test suite in another editor by double clicking it and remove the test in this editor 4 12 5 Executing a Test Suite Execution of a test suite means the sequential execution of all included tests When executing a test suite a corresponding result file with the same name is
229. iate state that a system can adopt Related Concepts e Section 3 9 State Flow 52 3 10 2 End State The end state element represents a final state that a system can adopt There may be several end states within a state flow Related Concepts e Section 3 9 State Flow 52 3 10 3 Transition JA The transition element represents a changeover between states Within a state flow it is accompanied by a yellow diamond Ka A transition can be based on a transition rule If so this is indicated by a rule symbol o gt in the yellow diamond Related Concepts e Section 3 9 State Flow 52 3 10 4 Transition Rule A transition rule is a flow rule which a transition in a state flow is based on Related Concepts e Section 3 9 State Flow 52 Bosch Software Innovations GmbH 53 270 Chapter 3 Concepts 3 10 5 Transition Target A transition target is a flow rule element that represents the exit of a transition rule Here a state is specified which is adopted next Related Concepts e Section 3 9 State Flow 52 3 11 State Flow Editor The state flow editor is used to view and edit a state flow The editor is opened whenever you double click on a state flow e g in the Rule Explorer Multiple state flow editors can be open at the same time Context Palette lt 2 Palette GER Select ec Coffee d Input Output
230. ick OK to add it to the list of dependencies Bosch Software Innovations GmbH 90 270 Chapter 4 Tasks D 6 Version Select Libraries Type filter text ISS Libraries ai LAT Any AT_Any AT_Any 1 0 rule Project 4 i Rule Project B Rule Project q 1 Commons Collections ri 3 3 a m L e cu a de JavaBeans Activation Framework 1AF _ JavaMail API J DCH KK D ei GG 5 o 1 7 SAK L Gi D cu H 1 rei i D 3 3 ON 3 L i rm D T T T CO 3 L lg Ch CH OO 3 gJ 3 3 DO a a L t L i F be iog a 2 1 commons Parent Ji JavaBeans Activation Framework JAF _ JavaMail API JavaMail APT distribution Ji DCH a del Gi D SAK T Cr Ex 2 Ex a eS T LI u D x d Visual Rules Database Connectivity Runtime Visual Rules Runtime mlBeans Dependency Add Dependency Save the changes made to ruleproject vr Related Concepts Section 3 1 Rule Project 25 Related Tasks Bosch Software Innovations GmbH Projects el i AT Am General Group Id AT An Artifact Id AT An Version 1 0 Rule Models AT Any If you want to add a dependency to a library or rule artifact which is neither in your workspace nor in a Maven repository of the Visual Rules Team Severthat your rule project is connected to click on Other In th
231. igned the value of the exception element that occurred The data element must have a suitable data type i e it must be an exception element The Handle Exception element will only handle exception elements of this type or subtypes thereof Other exception elements will remain unhandled You can also leave this empty In that case all exception elements are handled but you will not be able to in spect the exception element from within the Handle Exception branch dee Se all Handle Exception 1 Handle Exception Description Assign value of Exception Element to Invalid_Input_ alues cd Mokes E Related Concepts e Section 3 5 11 Handle Exception 43 e Section 3 5 10 Return Exception 42 e Section 3 14 6 Exception 76 Related References e Section 5 6 2 10 Handle Exception Tab 240 4 3 20 Copying or Moving a Branch of a Flow Rule To copy a branch of a flow rule do the following 1 Select the rule element which is the root of the branch you want to copy 2 Right click and select Copy from the context menu You can also use the Ctrl C key combination to copy it 3 Now select the rule element after which you want to paste the previously copied branch 4 Right click and select Paste from the context menu or press Ctrl V to paste the branch 5 A copy of the previously copied rule element and its children is pasted A case in a decision
232. iguring Statistics 169 e Section 4 3 32 Displaying Statistics 122 4 3 34 Changing Flow Rule Editor Preferences 1 Select Window gt Preferences to open the preferences dialog 2 Click on the plus sign to the left of the Visual Rules item 3 Click on the Flow Rule Editor item to view the preferences for the flow rule editor Preferences type Filter text Flow Rule Editor General E Ant E Data Management Maximum element height E Help 5 Instal Update H Java Show transparent elements during drag amp drop E Model Validation El Plug in Development 5 Report Design 5 Runi Debug El Team E Visual Rules Auto Creation Content Assist Dependency Management Maximum element width Text padding Open properties in dialog instead of in Properties views 3 Syntax Highlighting i Test Execution User Settings Restore Defaults Apply 4 Change the settings as desired 5 Ifyou would like to reset the preferences to their default values click on Restore Defaults 6 Click OK to confirm your changes Related References e Section 5 7 2 Flow Rule Editor Preferences 263 4 3 35 Exporting a Rule as an Image Visual Rules provides an option for exporting a rule as an image You can either export the image to the clipboard or to a file The following file formats are supported e Portable Network Graphics PNG Eclipse 3 3 only e Bitmap BMP e JPEG JPG To export a
233. ill always end the nearest Repeat element This is important to keep in mind when you have multiple Repeat elements following each other This example illustrates how a Repeat End element is used to end a Repeat once a thousand gifts have been sent to customers Is the revenue generated by that customer Check every preferred customer greater than US 10007 Send a free gift to the customer Count sent gifts Have we sent 1000 gifts already Related Concepts e Section 3 5 8 Repeat 40 Related Tasks e Section 4 3 14 Editing an End Repeat Element 115 3 5 10 Return Exception The Return Exception element can be used whenever the rule has detected an exceptional situation where it can not execute any further e g if necessary data is missing or validations have failed In this case a message de scribing the exception is generated with the Return Exception element Afterwards execution immediately contin ues at the most recent Handle Exception element at which rule execution came by before The most recent Handle Exception element is determined by going backwards from the Return Exception ele ment towards the Start element of the rule and if no Handle Exception element was found this way search contin ues in the calling rule backwards from the corresponding Call Flow Rule element This goes on until the Start ele ment of the initial rule is reached If no Hand
234. in the decision table do the following 1 Double click on the column header This will open the inplace editor 2 Enter the name of an output data element that will receive the corresponding value 3 Press Enter to close the editor or click with the mouse outside of the editor In order to enter values in cells of an assignment column do the following 1 Double click on the cell in the decision table This will open the inplace editor You can also simply start typing when a cell is selected 2 Enter the value that should be assigned This can be just a simple value or some expression If left empty the decision table will simply not assign any value in that case BETWEEN 1 200 3 Press Enter to close the editor or click with the mouse outside of the editor Related Concepts e Section 3 7 2 Assignment Column 49 Related Tasks e Section 4 4 6 Adding a new Assignment Column 128 e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 8 Rearranging Condition Columns or Rows In order to rearrange condition columns or rows do the following 1 Select the condition header of the decision that should be moved and drag it 2 Now move the mouse over an existing condition header of the decision table A black arrow will appear to show you where the new decision will be added Depending on the exising decision columns and rows this can be either before after above or below an
235. ine a new service 2 Inthe Properties view activate the Servicess tab 3 Click on the button to add an action The new service is shown in the Rule Explorer in the Services folder E Path Service ER Services thy Path XPath Service ER Service Types e i ETS Path Service B 48 Evaluate xPath El Ki Input Output Data ER Rule Tests It is also displayed in the Rule Context of all rules in which it is available Bosch Software Innovations GmbH 156 270 Chapter 4 Tasks Related Concepts e Section 3 19 Service 81 e Section 3 20 Service Type 82 Related Tasks e Section 4 9 2 Specify a Service Type for a Service 157 4 9 2 Specify a Service Type for a Service In order to specify a service type for a service do the following 1 Select a service in the Rule Context or in the Rule Explorer 2 Open the Properties by double clicking it and navigate to the Service Settings tab 3 A service is per default created with Standard service type If you want to use another service type use the button of the Type field and choose a service type from the list Select VI Path Service Description Evaluates an Path expression op some ML and returns the matching Fragment 4 The view of the Service Settings tab will change its view depending on the choosen service type 5 Insert the service type specific settings for the service Related Concepts e Section 3 19
236. ing fall O From Fo Mone Visible elements gt Movie Ticket Pricing Rule Packages Rules Tests and Tesk Suites SE Discounts Lt elle 2 Pricing alts Bonus Points Visible dependencies ei Package Reuses Rule Calls Enclosure of elements Testing and Test Calls E Pricing Test a BonusPoints Ba lt 2 e All Tests Diagram Configuration Si Figure 5 19 Dependency Diagram Editor Description 2 High lighting Kind of dependencies which are highlighted with respect to a selected element Kinds of elements which are visible Elements of all other kinds are hidden Kinds of dependencies is visible Dependencies of all other kinds are hidden A detected cycle in the reuses of Rule Packages is marked with a warning icon Visible elements Visible dependen cies For a clear view elements can be moved within the editor by drag amp drop Double clicking on a rule or test opens that element in the respective editor Double clickting on a rule call opens the calling rule Bosch Software Innovations GmbH 215 270 Chapter 5 Reference in the Flowrule Editor and there selects the relevant rule element Call Flow Rule or Call Decision Table respectively Deleting an element via the conext menu applies to the editor only Related Tasks e Section 4 1 4 1 Visualizing Dependencies between the Elements within a Rule Project 92 5 3 8 Usage Matrix Editor
237. ing rule This concept allows to organize rules into fine granular pieces that can be easily reused anywhere necessary a Call Decision Table The Call Decision Table element triggers the execution of a decision table Once the decision table is finished execution continues again in the original rule Data can be forwarded to the decision table being called and the results can be evaluated by the calling rule Bosch Software Innovations GmbH 31 270 Chapter 3 Concepts Call Service The Call Service element is used to call a service external to Visual Rules This enables rules to reuse func tionality available elsewhere e g in legacy systems or anywhere else Visual Rules can be extended by adding custom services and service types Done amp Return The Done amp Return element stops any further execution of the rule This is often used when the rule has de cided that any further processing is unnecessary e g if some required preconditions are not met Execution then immediately continues where the rule was originally called 5 Repeat The Repeat element is used to execute parts of the rule multiple times This is often useful if the rule must process multiple data items e g all the items of an order End Repeat The End Repeat element is used in cases when the rule has decided that it can end an ongoing Repeat pre maturely e g when the Repeat was used to search data and the matching data was found so the
238. ing table lists all map functions Table 3 4 Map functions copy Any gt Any Mapping Returns a deep copy of the map and all contained elements from Any gt Any Map ping count Any gt Any Map Returns an integer value with the number of elements i e keys of the map ping map Integer keys Any gt Any Mapping Returns a set of all keys of the map map Any Set values Any gt Any Map Returns a collection of all values of a map ping map Any Collec tion 3 12 18 new Operator The new operator creates a new instance of a structure or exception The syntax iS new lt name of structure gt g Bosch Software Innovations GmbH 65 270 Chapter 3 Concepts The newly created object is initialized with the default values specified for the structure s attributes It is possible that there are structures that are not createable and you will get an error marker if you use the new operator These structures are external and imported You have to contact your technical expert to get a solu tion to this problem Related Concepts e Section 3 14 3 Structure 74 e Section 3 14 6 Exception 76 3 12 19 isa and asa Operators The isa and asa operators are useful for working with structures that are sub types of each other They allow to check for the actual data type of a value and to convert a data type to a sub type thereof In order to test for the specific type of a st
239. ions The rule package contains the definitions of all the actions that rules can trigger Depending on the type of action fired specific things can happen E g the action may send an email or trigger another process or produce domain specific results Services Rules can call services A rule package contains the definitions of available services Services are external to Visual Rules i e they enable rules to reuse functionality available elsewhere e g in legacy systems Visual Rules can be extended by adding custom services and service types Data Types Every data element has a specific data type that defines the possible values of the data element There are built in data types like integer String Date etc Additionally a rule model can define user defined data types e g a Customer type that defines the attributes of a customer first name last name gender birthdate and address Functions A rule package can define custom functions in addition to the built in functions These custom functions can then be used within expressions Functions usually perform specific calculations but they could also do other things like fetch data from an external source e g a database Action Types A rule package can also define custom action types Every action has a type that specifies what it will do when it is fired Custom action types allow you to introduce action behavior specific to your domain amp Service Types Every service is
240. ip tions Expressions and Notes 7 Select the scope to be searched Select Workspace to search in all rule models in the workspace Select Selected elements to search in those rule models rule packages or rules that you have selected be fore opening the search dialog Select Enclosing rule models to search in those rule models in which at least one element was selected Bosch Software Innovations GmbH 178 270 Chapter 4 Tasks 8 Finally click on Search to start the search The Search view appears automatically The search now runs in the background and updates the list of search results in the Search view Related Tasks e Section 4 14 2 Searching References to Elements 179 Related References e Section 5 4 5 Rule Search Dialog 220 4 14 2 Searching References to Elements In order to search the references to a specific element do the following 1 Inthe Rule Explorer select the specific element you want to search the references for 2 Right click on the selected element 3 Select Search References from the context menu and select the scope of your search The Search view ap pears automatically and displays all references to the element 4 14 3 Working with the Search View Search offers two different views Use the button to switch between the different views Show as List Shows all found elements in a list WP Search 2 SPX 7 Oy no Bearchng Fer date a matches fod show dote
241. ired rule packages are reused by the rule package including the relevant flow rule or decision table H any of the elements required in the relevant rule or decision table is available in different rule packages then a dialog appears that allows you to select the rule package to be actually reused Bosch Software Innovations GmbH 102 270 Chapter 4 Tasks 5 Save the change 4 2 20 Editing Descriptions You can enter descriptions for rule models rule packages and rules 1 Inthe Rule Explorer select the rule model rule package or rule that you want to add a description to 2 Inthe Properties view activate the Description tab 3 Enter the description You can also specify hyperlinks to external documents within descriptions These are automatically underlined if the protocol e g http resource or file is specified marking them as links Click ing on a link opens the associated application displaying its contents Related Concepts e Section 3 15 Description and Note 78 4 2 21 Editing Notes You can enter notes for rule models rule packages and rules 1 Inthe Rule Explorer select a rule model rule package or rule that you want to add the note to 2 Inthe Properties view activate the Notes tab Click on the button to add a new note or click on the corresponding button to remove a note 4 Enter the text of the note You can also specify hyperlinks to external documents within notes The
242. is a collection list or set Removes the currently selected attribute or group Moves the currently selected constant data element up one position within the list Moves the currently selected constant data element down one position within the list This column shows the constant data elements available on the selected element You can edit cells in this column by double clicking them The type of the data element You can edit cells in this column by double clicking them This column shows whether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 Col lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implementation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells i
243. it shows the description and the expression of the currently selected condition This tab gives the user more room for editing the descriptions and expressions but does not show ev erything at the same time like the Decision Overview tab Bosch Software Innovations GmbH 231 270 Chapter 5 Reference Properties lt s p ee eg ek Decision Overview Decision Details Overview displaying descriptions Condition Prefix E CH Day of week weekend Decision 1 eekDay om date ail Description Nies Description Allow multiple matches fnot just the First one a lt Toggles between display of the descriptions and conditions Adds another condition Removes the currently selected condition including all rule elements that may be at tached to it Condition E This input field is displayed when the first row in the list the decision is selected Enter the optional prefix for all the conditions here Condition This input field is displayed when a condition in the list is selected Enter the expression for the condition here Enter the description for the currently selected item decision conditions or else exit here Allow multiple When unchecked only the branch of the first condition which evaluates to true is execut matches not just ed the first one When checked the decision will evaluate all conditions and execute the branches of
244. it to one Page button to print the rule on one page The Reset button allows you to reset the scale to the original value of 100 If needed you can also set a margin in the margin settings or select that header or footer should be printed for the rule Bosch Software Innovations GmbH 186 270 Chapter 4 Tasks 4 Select the desired printer and set the print options 5 Click on Print to start printing The exported image displays the rule exactly as displayed in the rule editor This makes it possi ble for example to hide specific branches in the exported image Related References e Section 5 7 2 Flow Rule Editor Preferences 263 4 20 Working with the User Interface 4 20 1 Switching Perspectives A perspective is a pre defined user interface layout Visual Rules offers several different perspectives for different tasks e g general rule modeling should be done using the Rule Modeling perspective e Currently open perspectives are displayed at the top right Click on the corresponding icon to switch to either the Rule Modeling or the Rule Integration perspective E Rule Modeling L i Rule Integration If the desired perspective is not available add it by clicking on the E icon Select Other from the menu and then select the perspective from the list Alternatively you can add the perspectives via the following menu Window gt Open Perspective gt Other Related References e Section 5 1 1
245. ither a student discount or a coupon discount is given Rule Rules Discounts Pricing uw Coupon discount granted price price coupon discount coupon discount granted A IE Related Tasks e Section 4 18 1 Generating Documentation 184 4 19 Printing 4 19 1 Printing a Rule To print a rule do the following 1 Open the rule editor with the rule you want to print If necessary set preferences for things that may influence the appearance of the printout such as the maxi mum element width or height 2 Now select File gt Print from the menu 3 Print options can be set in the dialog that appears Enter a scaling factor for the rule at the top left This influences the number of pages required to print out the rule in full You can also insert the number of pages available to print the full rule on The scaling factor will be adjusted automatically to the maximum size possible for printing on the available number of pages A preview of the rule is displayed on the right showing how the rule will look like on the printed pages Besides the scaling factor another important thing that influences how the rule is printed across several pages is the printer and page format selected Both can be set via the Printer Options button The Fit to Pages button scales the rule to the current number of pages shown The number of pages also de pends on the scaling factor Click on the F
246. jects String List fae e salary levels Float List So Employee o attributes rg birthday Date Ser email String Firstname String gender Boolean gei Jost name String Sa e projects String List ge salary Float tie schedule Schedule CG zip String 2 G3 schedule G E attributes ay appointments Appointment List La holidays Dake List Assuming there are two data elements employee of type Employee and department Of type Department employes first neme Value of the attribute first name of employee employee schedule appointments 3 date_of appointment Value of the attribute date of appointment in the 3rd element of appointments in the schedule of employee employee department supervisor Returns true if the employee is the supervisor of department Related Concepts e Section 3 14 3 Structure 74 e Section 3 13 Data 67 3 12 9 Accessing List Elements Accessing a specific element of a list is accomplished by specifying the list followed by an index enclosed in square brackets Any expression can be used as the index as long as it returns a whole number result In Visual Rules the first element of a list has index 1 Example 3 8 Accessing elements in a list list 3 customerList index 1 Related Concepts e Section 3 14 7 Collection 76 3 12 10 NULL The literal vr has a special meaning It indicates a missing value Input or interna
247. ks 4 9 Working with Services The following sections contain step by step procedures how to define services e Section 3 19 Service 81 e Section 3 20 Service Type 82 4 9 1 Defining Services To add a service to a rule you can simply use the Rule Context palette in the rule editor 1 Click on the button in the Services section to add a new service 2 Enter a name for the new service in the dialog that appears 3 Press OK The service is created under the rule in which it was created and is shown in the Rule Context palette T 7 at G Input Output Data ae aed 4 Internal Data E Constant Data a Sie BI Actions db 291 i eit Se Services KW Path Z gt Rule Tests a oe g gt Evaluate Path Test It is also displayed in the Rule Explorer in the Services folder under the rule In order to create a new service for a rule a rule package or a rule model in the Rule Explorer you have two op tions Option 1 1 Select the rule rule package or rule model in the Rule Explorer where you want to define a new service 2 Right click the element and select New Element gt Service in the contextual menu that appears 3 A dialog appears for you to give the new service a name 4 Click on OK to create the service It appears in the folder Services in the Rule Explorer Option 2 1 Select the rule rule package or rule model in the Rule Explorer where you want to def
248. l 5 ae E E Deg No 3 General 5 Ga RS weekend surcharge Ge Compute customer bonus points Figure 5 33 Search view The Search view is not specific to Visual Rules but part of the Eclipse platform underlying Visual Rules You can find more information in the Workbench User Guide part of the documentation for the Eclipse platform Related Tasks e Section 4 14 Searching Rule Models 178 5 5 6 Properties View The Properties view shows informations and settings for the currently selected element Whenever you select an item in the Rule Explorer or in the rule editor the Properties view will be updated and show the properties of that element ot Movie Ticket Pricing Reuse Packages f dea taa Mame InputiOutput Required Default value Type Multiple 1 aber net SE g gt Movie Ticket Pricing o d GE SE H Constant Data E Input Actions Gs auditorium mo i Integer Data Types ER bonus card i BONUS CARD Extensions E coupon i False Boolean reer E seat_no i oO Integer f E show date i 2000 1 i Date bores E student i False Boolean Visitor is a 5 Permissions E E Output Advanced gt Figure 5 34 Properties view Properties are usually displayed on several tabs You can bring a tab to the front by clicking on the tab name dis played to the left Detailed descriptions of the different tabs for specific rule model elements can be found
249. l data elements can have the value nut It is possible to check if this is the case using this expression Bosch Software Innovations GmbH 59 270 Chapter 3 Concepts This expression returns true if the variable var does not have a value Using a decision node you can thus for ex ample query a non initialized input data element and react accordingly 3 12 11 1n Operator The rn operator returns true if a value is present in a collection 5 IN 1 2 3 false 5 IN 1 5 3 true NOT 5 IN 1 2 3 true Related Concepts e Section 3 14 7 Collection 76 3 12 12 avarLasLe Operator The avarLaBLe operator can be used to check if an input data element was given a value That is useful if the input data element is not required There is a shorthand for the avarLasLe operator which is simply a question mark AVAILABLE optionalParameter optionalParameter The avAILABLE operator can only be used for input data elements You cannot specify other expres sions Related Concepts e Section 3 13 2 Input Output Data 69 3 12 13 namzor Operator The nameor operator returns the name of a data element For example NAMEOF price will return the string price The advantage of using the namzor operator instead of simply specifying the name as a String is that the namzor expression will correctly be updated whenever the data element is renamed It is also possible to use more complex expressions with t
250. l the rule packages referenced for reuse Bosch Software Innovations GmbH 241 270 Chapter 5 Reference Eee SS EE a Business Object Model l Reuse Packages Input Output Data SE eT Mame Description Internal Daka ER bene Date H Rule Library Data Warehouse Functions Several Functions For data warehouse access _ Constant Data U BS Rule Ubrapabortal Form Validation Actions Use these actions to signal validation errors on web Forms in the portal server Actions Data Types Extensions Description Motes Advanced Figure 5 55 Reuse Packages tab a C C Eeeeeeeeeeeeeeeg C C lace This column shows the name and the rule model of the rule packages you are reusing Cells in this column are read only The description for this row You can edit cells in this column by double clicking them Project The Project this package is in Cells in this column are read only Related Concepts e Section 3 3 1 Rule Package Reuse 28 Related Tasks e Section 4 2 19 Reusing Rule Packages 101 Related References e Section 5 4 4 Select Dialog 218 5 6 6 Data The following properties tabs are available where data elements can be defined i e rule models rule packages or rules 5 6 6 1 Data Element This tab is activated when one or multiple data elements are selected Bosch Software Innovations GmbH 242 270 Chapter 5 Refe
251. layed or not This is used to toggle if data elements are displayed in alphabetically or manual order e Section 3 1 Rule Project 25 Related Concepts e Section 3 2 Rule Model 25 Related Tasks e Section 4 2 Working with Rule Models 93 e Section 4 6 11 Sorting Data Elements Manually 147 Related References e Section 5 1 1 Rule Modeling Perspective 197 e Section 5 5 2 Project Explorer View 223 e Section 5 5 6 Properties View 226 5 5 2 Project Explorer View The Project Explorer is the general purpose view for working with projects It lists all the projects and their con tents files models etc including different technical elements Bosch Software Innovations GmbH 223 270 Chapter 5 Reference DS E Execute Command Action aE Movie Ticket Pricing ER Movie Ticket Pricing G Input Output Data i GER Constant Data ER Actions HgO Data Types o D Bonus Points e S Discounts eS eae 9 8 vr sregen E JRE System Library jre1 6 0_04 i Gs Visual Rules Runtime Library MA Rule Project Dependencies E E bin a Movie Ticket Pricing Java Client Ee Rule Execution API Example Ee Tutorial Database aE Path Service Figure 5 30 Project Explorer view The Project Explorer view is not specific to Visual Rules but part of the Eclipse platform underlying Visual Rules You can find more information in the Workbench User Guide part of the docu
252. le Unless you deactivated the corresponding checkbox the flow rule editor will automatically show the new flow rule Related Concepts e Section 3 4 Flow Rule 29 e Section 3 3 Rule Package 26 e Section 3 2 Rule Model 25 e Section 3 4 1 Flow Rule Template 30 Related References e Section 5 2 3 New Rule Wizard 201 e Section 5 5 2 Project Explorer View 223 4 3 6 Extracting a branch of a Flow Rule as a new Decision Table You can extract a branch of a flow rule as a new decision table Instead of executing the respective branch the original flow rule will call the newly created decision table such that the overall behavior remains unchanged This way you can split a large flow rule into pieces The new decision table is automatically added all necessary elements like data elements actions etc Only if the new decision table is placed in a different rule project the file ruleproject vr might need to be adapted Bosch Software Innovations GmbH 107 270 Chapter 4 Tasks 1 Right click on the first element of the branch A context menu will appear 2 Select the Extract Branch as New Decision Table entry from the context menu 3 The Extract Decision Table wizard appears P Extract Branch As New Decision Table Extract Decision Table Extracts selected Flaw rule branch as new decision table Lu Rule model Rule Project Rule Model vrmodel seie netia Show new
253. le Exception element was found even then rule execution terminates and the exception is returned to whoever was calling the rule initially Bosch Software Innovations GmbH 42 270 Chapter 3 Concepts Related Concepts e Section 3 14 6 Exception 76 Related Tasks e Section 4 3 18 Editing a Return Exception Element 118 Related Reference e Section 5 6 2 9 Return Exception Tab 239 3 5 11 Handle Exception The Handle Exception element is used to react to exceptional situations It defines the alternative rule elements that are executed when normal rule execution within a rule branch triggered a Return Exception element or if some technical error has occured The Handle Exception rule element is displayed differently to all the other elements It is not attached to the right of another element but it is shown at the bottom of a box that is drawn around a rule branch A Handle Exception rule element is executed if an exception occurs somewhere in this branch or in other rules being called from within that branch The Handle Exception element and all elements attached to it are shown on a red background to make it easier to distinguish the normal flow from the exceptional flow This is an example for the use of the Handle Exception element A customer rating is calculated by reusing an ap propriate rule If anything goes wrong there e g an exception because of missing data or because of a di
254. le click the empty branch description This will open the inplace editor 5 Enter the description 6 Press Ctrl Enter to close the editor or click with the mouse outside of the editor Related Concepts e Section 3 5 12 Branch Description 44 4 3 26 Deleting a Branch Description 1 Select the branch description shown at the top of the box around the branch 2 Then use the right mouse button to select the Delete menu item Alternatively press Del Related Concepts e Section 3 5 12 Branch Description 44 4 3 27 Adding a Note 1 Select the Add Note tool from the Palette 2 Click on the rule element where you want to attach the note 3 A note will appear to the right of the flow rule 4 Double click the empty note This will open the inplace editor 5 Enter the text for the note 6 Press Ctrl Enter to close the flow rule editor or click with the mouse outside of the editor Alternatively you can use the Properties view to enter notes 1 Select the rule element where you want to attach the note 2 Inthe Properties view activate the Notes tab 3 Click on the button to add a new note 4 Enter the text of the note Related Concepts e Section 3 15 Description and Note 78 Related References e Section 5 6 1 2 Notes Tab 230 4 3 28 Deleting a Note 1 Select the note you want to delete 2 Use the right mouse button to select the Delete menu item Alternatively press Del
255. le was originally called Related Concepts e Section 3 4 Flow Rule 29 3 5 8 Repeat The Repeat element is used to execute a part of the rule multiple times This is often useful if the rule must pro cess multiple data items e g all the items of an order The rule elements that should be executed multiple times must be attached to the Repeat element which determines how often it will execute these Bosch Software Innovations GmbH 40 270 Chapter 3 Concepts Is the revenue generated be that customer __ qreater than US 1000 Send a free gift to the customer Count sent gifts Check every preferred customer Have we sent 1000 gifts already Ke P There are three different types of Repeat Repeat for each of multiple elements This is used to repeat execution for each one of multiple data elements specified in the Elements field Every time it executes the next data element is assigned to the data element specified in the Assign each element to field If the number of data elements is zero the Repeat is not executed at all A Repeat 14 Repeat For each of multiple elements while a condition holds O with counter 4ssign each element to kustomer Elements IMyCustomers Description Repeat while a condition holds Execution repeats as long as the specified condition is true and ends when
256. lement denotes the beginning of each flow rule Rule execution always starts from the start ele ment and continues to the right and down just like you are reading a book Decision Decision elements are used to represent any kind of decision the rule has to make Decisions have two or more exits that may be followed by additional rule elements Depending on the result of the decision the rule elements following the respective exit are executed or not executed Assignment Assignment elements are used to define any kind of calculation the rule has to make There are numerous op erations and functions available for calculation The assignment element stores the results for later use in oth er calculations as well as in decisions or actions Fire Action The Fire Action element triggers a specific action In the simplest case this merely sets the value of the fired action to true This status can then later be evaluated by any caller of the rule Depending on the type of ac tion fired specific things can happen E g the action may send an email or trigger another process or produce domain specific results Visual Rules can be extended by adding any number of custom action types Call Flow Rule The Call Flow Rule element triggers the execution of some other flow rule Once the other rule is finished ex ecution continues again in the original rule Data can be forwarded to the rule being called and the results can be evaluated by the call
257. lement in the collection for which the expression evaluates to the high est value Returns a collection that contains those elements of the given collection that fulfill the condition Returns a collection whose elements are the result of the expression evaluated for every element of the given collection Inserts the element into the list at the right position so that the list remains correct ly sorted ascendingly according to the sort expression If the resulting list contains more than maxElements elements the exceeding elements at the end will be re moved The remaining list is returned as the result Note This requires the given list to be already sorted ascendingly according to the sort expression Inserts the element into the list at the right position so that the list remains correct ly sorted descendingly according to the sort expression If the resulting list contains more than maxElements elements the exceeding elements at the end will be re moved The remaining list is returned as the result Note This requires the given list to be already sorted descendingly according to the sort expression 3 12 15 1 Sorting of Collections sortAsc and sortDesc sorta collection by a given criterion The criterion is defined by an expression specified as the second parameter The result of the sortAsc OF sortDesc function is the sorted collection The original collection is left unchanged Bosch Software Innovations Gmb
258. length of 9 digits Bosch Software Innovations GmbH 73 270 Chapter 3 Concepts Example 3 27 Timestamp values e 2000 1 1 10 25 30 0 corresponds to January 1 2000 at 10 o clock 25 minutes and 30 seconds e 2000 1 1 10 25 30 010 corresponds to January 1 2000 at 10 o clock 25 minutes 30 seconds and 10 mil liseconds e 2000 3 11 23 00 00 000123456 corresponds to March 11 in the year 20 at 11 p m and 123456 nanoseconds 3 14 2 Type Alias Type aliases are user defined data types that are basically synonyms for built in data types E g you may want to have a data type called amount Or Rate instead of using the built in type Float A type alias can be used everywhere the built in type could be used too In addition to the built in types however a type alias can have additional settings These settings are different de pending on the basic data type used e g it would make sense to define fixed point numbers for an alias data type Amount These additional settings for the type alias can only be inserted in the Rule Integration perspective Maybe contact your technical expert if you need additional settings for an alias type SC Di Type Alias Primitive Type Description Notes 4dyanced Related Concepts e Section 3 14 1 Basic Data Type 71 Related Tasks e Section 4 7 Working with Data Types 150 Related References e Section 5 6 8 2 Type Alias Ta
259. lette in the rule editor 1 Click on the button in the Internal Data section to add a data element 2 Specify the new element in the dialog that appears 3 Press Finish In order to add an internal data element to a rule a rule package or a rule model in the Rule Explorer do the fol lowing 1 Select the rule rule package or rule model in the Rule Explorer where you want to define internal data 2 Inthe Properties view activate the Internal Data tab 3 Click on the button to add a data element Bosch Software Innovations GmbH 141 270 Chapter 4 Tasks Alternatively you can use the context menu of the Properties view to add an internal data element to a rule that contains the possible operations Show All Values w 3 Sorter E Add Group S W Remove ZA dd List Element Crit ap Move Up Ttr Arrow Up T Move Down Ctrl arrow Down Related Concepts e Section 3 13 3 Internal Data 69 4 6 3 Defining Constant Data Elements To add a constant data element to a rule you can simply use the Rule Context palette in the rule editor 1 Click on the button in the Constant Data section to add a data element 2 Specify the new element in the dialog that appears 3 Press Finish In order to add a constant data element to a rule a rule package or a rule model in the Rule Explorer do the fol lowing 1 Select the rule rule package or rule model in the Rule Explorer where you want to define c
260. lette is shown on the right side of the rule editor It displays and gives access to data elements actions services and rule tests These elements are shown within their respective sections The sections can be collapsed or expanded and pinned open with the little pin symbols Double clicking on an element will open the Properties for this element or in the case of rule tests start the rule test editor Clicking on a selected element or pressing F2 will allow you to rename the element Rule Context E Ri G Input Output Data lt p 38 ia car group Any CG customer ID Any g days_rent Integer GG Price Integer 4 Internal Data Ce Q Constant Data cA C3 compact Any Co Pull size Any E Actions sis Wl E no_discount_allowed Standard 6 send brochure Standard Ss Services oe ot amp Rule Tests op i e Price_Calculation Test Figure 5 11 Rule Context palette Palette Item Description This button enables disables the display of type information for the elements in the palette Bosch Software Innovations GmbH 206 270 Chapter 5 Reference at When this button is not pressed the palette only shows elements that are defined by the rule itself When the button is pressed the palette will show all elements the rule has access to thus including elements that are defined on the rule packages above or in the case of services defined on any reused rule packages Elements not defined by the rule its
261. lphabetically Use this if you know the name of the test tz Displays the tests within the rule model and rule package hierarchy Use this if you know where the test can be found Related Concepts e Section 3 22 Rule Testing 82 5 4 3 Auto Creation Dialog The Auto Creation dialog informs the user about new rule model elements that Visual Rules wants to create auto matically because they don t exist yet Visual Rules tries to find the correct data type for the data element that should be created depending on the ex pression in which it is used If no data type could be identified the any data type is used It is possible to configure for which elements this dialog for automatic creation should appear Click on Configure to bring up the user preferences for Auto Creation or open it with Window gt Preferences gt Visual Rules gt Au to Creation and set the elements that should be created automatically to Prompt Automatic Element Creation Automatic Element Creation Visual Rules can assist you in creating new model elements Configure Data Element E Movie Ticket Pricing E 8 Pricing E KZ Internal Data customer Customer E SO Data Types customer E E Attributes age Integer Figure 5 23 Auto Creation dialog Decide if Visual Rules should create these elements for you and click Create Don t Create or Cancel respective ly Related Concepts e Section 3 21 Auto Creation 8
262. ment on the palette 2 Move the mouse over the decision where you want to add another condition A black arrow appears pointing up or down to indicate where the new condition will be inserted Zz i Palette E Select EL Zoom CA Add Note Add a note zl Describe Branch Add a description to a whole branch lt gt Decide Make a decision Assign Calculate values and update data 25 E Fire Action Fire an action Fa Call Flow Rule Call another Flow rule 3 Click again The condition is inserted De a ET eebe Crit ti 3 s A CS Palette ls Select EL Zoom CA Add Note Add a note Describe Branch Add a description to a whole branch g gt Decide Make a decision Assign Calculate values and update data ki Fire Action Fire an action Call Flow Rule Call another Flow rule Call Decision Table Call a decision table 4 Describe the decision element by double clicking on the description fields like in the picture below Bosch Software Innovations GmbH 9 270 Chapter 2 Getting Started fe EU Rent ii l d 25 Palette Calculate rental charges k Select Compute base charge per vehicle type Calculate discounts per rental days Zoom Update records CA Add Note Add a note E Fa Describe Branch Add a What is the car type description to a whole branch gt Decide Make a decision ae
263. mentation for the Eclipse platform en 1 eseription Collapses all expanded elements in the resource tree B Determines if the view selection is linked to the active editor When this option is selected changing the active editor will automatically update the Rule Explorer selection to the re source being edited Triggers rule code generation for the selected rule model Determines if data types of rule model elements are displayed or not This is used to toggle if data elements are displayed in alphabetically or manual order Related Concepts e Section 3 1 Rule Project 25 e Section 3 2 Rule Model 25 Related Tasks e Section 4 2 Working with Rule Models 93 e Section 4 6 11 Sorting Data Elements Manually 147 Related References e Section 5 1 2 Rule Integration Perspective 198 e Section 5 5 1 Rule Explorer View 223 e Section 5 5 6 Properties View 226 5 5 3 Problems View The Problems view displays a list of all current errors and warnings that Visual Rules has detected Double click on an entry to navigate to the problem location Bosch Software Innovations GmbH 224 270 Chapter 5 Reference infos Filter matched 3 of 362 items Description Resource Location Path B E Errors 3 items Data element coupon discount not found Discounts yrrule statement 4 Movie Ticket Pricing Movie Ticke Function weekDoy Date not Found Disco
264. ments defined for the rule plus all data elements defined for the rule package and all packages above that In other words a rule has access to all data elements that can be found by going up the package hierarchy starting from the rule up to the rule model which is the top level rule package The sum of all data available to a rule is also called the data context of the rule Related Concepts e Section 3 14 Data Type 71 e Section 3 4 Flow Rule 29 e Section 3 3 Rule Package 26 3 13 1 Common Data Properties All different kinds of data definitions input output internal constant have common properties e g every data ele ment has a name and a description The following table lists all common data properties and their meanings Name Every data element must have a name that is used in expressions to refer to the value of that data element Names can consist of letters and numbers but they must start with a letter They cannot contain whitespace However an underscore _ is a valid character For example valid names are customer CREDITLIMIT pre ferredCustomers this 15 a valid name It s a convention for all data elements to have a lowercase letter as first character except for constants which should have uppercase letters only When the name contains multiple words then either the first letter of each word should be written in uppercase e g preferredCcustomers or the words should be separated by un
265. mn except for the one in the first row by double clicking them The type of the data element You can edit cells in this column by double clicking them This column shows wether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 Col lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implementation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them Related References e Section 3 14 7 Collection 76 e Section 5 6 6 2 Input Output Data Tab 244 e Section 5 6 6 3 Internal Data
266. mount order amount item price the left side is total amount and the right side is order amount item price This is what this assignment looks like in Visual Rules ip d Calculate the total amount of this order item total amount order_arount tem price Sometimes you have multiple assignments that belong together It is possible to group multiple assignments into one element like in this example which contains three assignments Bosch Software Innovations GmbH 35 270 Chapter 3 Concepts od Initialize score total id score_total name total value 0 You can also have several assignment one after another These might concern the same data element in each case Description Description Description E value 1 E value 7 E value 3 If so one assignment is executed after another such that in the above example the eventual value of the data ele ment value would be 3 When an assignment concerns a structured data element i e a data element including multiple attributes then individual values can be assigned to each of these attributes Description e inouti Structure e attributei 1 o attribute one o attributes 1 2545 Here it is possible not to assign a value to individual attributes provided that at least to one attribute a value is as signed Description RR inouti Structure oe attributel 1 attribute e attributes If so then to th
267. n cannot be used in combination with a student discount i e either a EN KG Input output Data SH Constat Data E5 her Actions EN S Data Types EN Bonus Points 2 off 3 Discounts 3 Pricing EI i Movie Ticket Pricing Java Client HL Rule Execution APT Example H E Tutorial Database E Path Service Rule Context price price student_discount lt Lif ER e e a or Outline 25 E Properties 3 H Problems E Assignments 8 Assignments Description Data Element Operation Expression L ES orice price student_discount Figure 5 1 Rule Modeling perspective The Rule Modeling perspective focuses on the non technical aspects of rules and rule models Con sequently some properties tabs and specific settings relevant for technical users only are hidden from view Related Concepts e Section 3 6 Flow Rule Editor 45 e Section 3 8 Decision Table Editor 50 Bosch Software Innovations GmbH 197 270 Chapter 5 Reference Related References e Section 5 1 2 Rule Integration Perspective 198 e Section 5 5 1 Rule Explorer View 223 e Section 5 5 3 Problems View 224 e Section 5 5 6 Properties View 226 e Section 5 5 4 Outline View 225 e Section 5 3 1 Flow Rule Editor 205 e Section 5 3 2 Decision Table Editor 207 5 1 2
268. n this column by double clicking them Code As sist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them Bosch Software Innovations GmbH 259 270 Chapter 5 Reference 5 6 8 5 Literals Tab This tab is shown when an enumeration is selected in the Rule Explorer l Literals EE Name Default Value Description Constant Data g re Color Description Sa GREEN nats Le Sa BLUE advanced B RED Ss YELLOW Ke Figure 5 76 Literals tab This column shows the constant data elements available on the selected element You can edit cells in this column by double clicking them Type The type of the data element This column is readonly as literals are always the type of the literal and the type of attributes has to be changed in the attributes tab Default Value When your enumeration has attributes you can specify default values for an attribute for the given literal here You can edit cells in this column by double clicking them The description for this row You can edit cells in this column by double clicking them 5 6 8 6 Super Types Tab This tab is shown when a structure or an exception is selected Bosch Software Innovations GmbH 260 270 Chapter 5 Reference i sz Ei LJ Properties is Customer Attributes Super Types KC Mame Description Constant Data Person Figure
269. name of the element and whether or not it is an end state element Bosch Software Innovations GmbH 240 270 Chapter 5 Reference Meta Data H Figure 5 53 State tab Name B End State 5 6 4 Rule Models The following properties tabs are available for rule models 5 6 4 1 Extensions tab This tab allows to activate specific extensions for the rule models Extensions provide specific functions action types or service types that can be used anywhere in the rule model once the extension is activated Example Rules Input Output Data Visual Rules 3 x compatibility Functions actions inera bare Constant Data Database Connectivity requires visual Rules 3 x compatibility Functions actions Datatypes Extensions OO P y i Figure 5 54 Extensions tab SCC Visual Rules 3 x When activated gives access to some functions and action types that were available in compatibility func Visual Rules 3 x In particular this includes the string list functions and the Read CSV tions actions file action type Databaselntegrator When activated gives access to the action types for direct database access See the Databaselntegrator manual for more information The Databaselntegrator is an optional add on for Visual Rules 5 6 5 Rule Packages The following properties tabs are available for rule packages including rule models 5 6 5 1 Reuse Packages Tab This tab shows al
270. new line 3 Press Enter to close the editor or click with the mouse outside of the editor In the Properties on the Decision Overview tab do the following 1 Double click in either the description or the condition column to open an inplace editor 2 Enter the description or expression for the condition Use Alt Enter to start a new line 3 Press Enter to close the editor or click with the mouse outside of the editor In the Properties on the Decision Details tab do the following 1 Select the condition that you want to edit To the right you see the description and the expression of the se lected condition 2 Edit the description or expression 4 3 10 2 Adding a Condition to a Decision In the flow rule editor do the following Bosch Software Innovations GmbH 110 270 Chapter 4 Tasks 1 Select the Decide element on the palette 2 Move the mouse over the decision where you want to add another condition A black arrow appears pointing up or down to indicate where the new condition will be inserted 3 Click again The condition is inserted In the Properties on the Decision Overview or Decision Details tabs do the following 1 Select the condition in the list where you want to insert the new condition 2 Click on the button to insert the new condition 4 3 10 3 Deleting a Condition from a Decision In the flow rule editor do the following 1 Select the condition you want to remove 2 Right click and
271. ng a Rule Model You can export a rule project and save it in the file system outside the workspace Go through the following steps to export a rule project 1 Select File gt Export from the menu An export wizard opens 2 Select File system as the destination to save all rule project files directly to the file system Alternatively you can choose Archive file as the export destination to save all rule project files in a ZIP or tar gz archive out side the workspace 3 Now select the rule project to export on the left side of the dialog 4 Define a destination directory or an archive file in the desired format to save the rule project into 5 Complete the process by clicking on the Finish button 4 18 Generating Documentation 4 18 1 Generating Documentation Visual Rules can generate documentation for rule models rule packages state flows or single rules 1 Select the rule model rule package state flow or rule you want to create the documentation for in the Rule Explorer 2 Select File gt Export from the menu to start the Export wizard 3 Select the entry Documentation in the Visual Rules folder from the list 4 Press Next gt 5 Select the Target Directory where the documentation should be saved Click on the Browse button to open a file browser and select the target for the documentation 6 Select the Format HTML PDF or WORD in which you want the documentation to be generated The output as a Microsof
272. ng constants in an expression editor Attributes Choose the color used for displaying attributes in an expression editor Funcions Gosh er ed aspynainctosinanonressonedio Stings ose cbr ed rayne stings nan eresdoneion Numbers ose cbr ed asalna moesman enese 5 7 5 Colors and Fonts Preferences Choose the color used for displaying actions in an expression editor Choose the color used for displaying parameters in an expression editor This preference page is used to configure many of the colors and font settings for the user interface The tree con tains a Visual Rules section with the fonts used in the rule editor and the properties tabs Font settings can be changed either by selecting the font from the list and clicking Use System Font to choose the default system font or by clicking Change to open up a font selection dialog Reset can be used to return to the default value Preferences type filter text Colors and Fonts El General Colors and Fonts any character any string A El Appearance Colors and Fonts type filter text Use System Font GE Decorations 5 ei See Capabilities 1 Loi view and Editor Fold Compare Pakch a ee and Editor Folders led visual Rules Content Types i aoe Ad Expressions Ad Statistics Keys Network Connections Perspectives Aa YVisualRules Propertie F Search Security Startup and Shutdown Description Web Browser H Workspace Ant Data Management Preview
273. ng structured types To access and set values in a map you use square brackets and put the key value inbetween E g ina string gt String Mapping you Can Create an entry with the following assignment Bosch Software Innovations GmbH 64 270 Chapter 3 Concepts Example 3 19 Set map value state IN Indiana The key and value types can be any simple or complex type E g it is possible to have a customer gt Contract mapping To merge two maps you use the app assignment like this The result is a map that contains both the entries from mapl and map2 Example 3 20 Merge maps mapl ADD map2 You can remove an entry by specifying its key in a Remove assignment Example 3 21 Remove element from map map REMOVE key And you can empty a map remove all entries with the crear assignment Example 3 22 Clear map map CLEAR Related Concepts e Section 3 5 2 1 ADD REMOVE and CLEAR Assignments 36 3 12 17 Map Functions There are some built in functions specifically used for maps The functions keys and values give access to on ly the keys or the values of a map respectively keys returns a set of all the keys while values returns a collec tion of the values count Can now be used to count the number of entries keys in a map copy creates a copy of a map and all its elements The copy function performs a deep copy i e the map and all contained elements are copied The follow
274. ns GmbH 162 270 Chapter 4 Tasks 4 11 5 Moving a Test from one Rule to another You can move a test from one rule into another If so the latter will be subject to the test 1 Moving atest from one rule to another rule is done with drag amp drop Select the test you want to move click it and hold down the left mouse button 2 Drag the test to the rule you want to be tested 3 Let go of the mouse button to move the test If you want to create a copy of the test press and hold the Ctrl key when you release the mouse but ton Related Concepts e Section 3 22 1 Rule Test 83 Related Tasks e Section 4 11 4 Copying a Test 162 4 11 6 Adding Test Cases 1 After you have created a new test the test editor already has generated a test case 1 It is recommended to give each test case a specific name and description Both can be done using the inplace editing in the Test Cases table t Description Te ases Input PERG L E Ee KAREN Ai 1 o Input Data ert K Seen P Test Case Description SS auditor E coupor 1 a E seat_r ES show E studer The icon of a test case is decorated with small glasses when the test case has a description This way it is easier to see which test cases have descriptions see the last two test cases in the image below Test Lases F t H Test Case Description gE Auditorium 1 special seeting no weekend gE Auditorium 1 general seeting
275. nt Example 3 4 Expressions with data elements purchase limit gt 1000 disposal limit 100 0 deposit value amountOfShares ExRateEURO Share ExRateEURO 1 95583 lt Thresholdvalue When using data elements be aware that their data types have to correspond Data types can t be combined in just any fashion For example a string cannot be multiplied by a Float because there is no mathematical rule for do ing so Just like a Boolean can t be subtracted from a pate Example 3 5 Invalid expressions TEE Er 5 A true 10 1 Any expression you enter is validated by Visual Rules Any errors are shown in the Problems view and the ex pression will get a marker indicating the problem For example the expression voce 5 produces the following error message in the Problems view Operator is not defined for the types String Inte ger Related Concepts e Section 3 14 Data Type 71 e Section 3 13 Data 67 e Section 3 12 1 Arithmetic Operators 56 e Section 3 12 4 Comparison Operators 57 e Section 3 12 5 Logical Operators anp or not 57 e Section 3 12 7 Calling Functions 58 e Section 3 12 20 Operator Precedence 66 Related Tasks e Section 4 10 Working with Expressions 157 e Section 4 10 1 Using the Code Assist 157 3 12 1 Arithmetic Operators The simple arithmetic operators are They carry out addition su
276. nt has a white icon 5 Disabled breakpoints can be reenabled using the Enable Breakpoint menu entry Visual Rules provides a Breakpoints view that lists all existing breakpoints The view is part of the Debug perspective but can also be opened elsewhere with Window gt Show View gt Other Select the Breakpoints view from the list and click OK Related Concepts e Section 3 23 2 Breakpoint 88 Related Tasks e Section 4 13 3 Stepping Through Rules 176 Related References e Section 5 5 10 Breakpoints View 229 4 13 2 Debugging a Rule Test In order to execute a rule test in the debugger do the following Bosch Software Innovations GmbH 175 270 Chapter 4 Tasks 1 Open the rule test in the rule test editor 2 Seta breakpoint at the desired location where you want rule execution to halt If you want to halt right at the beginning you should set the breakpoint on the start element of the rule being tested Start the debugger by clicking on the Debug button shown above the list of test cases Test Cases Ft Rv i O ts Ek Sun on b Test Case Description CR Audit Execute Test In Debug Mode S gE Auditorium 1 general seeting no weekend gE Auditorium 1 general seeting weekend gE Auditorium 3 coupon gE Auditorium 3 student gE Auditorium 3 coupon and student G Auditorium 1 special seeting no weekend but sil 4 Once execution hits the breakpoint
277. number as its only parameter At runtime this number is returned rounded off If you position the cursor between the two parenthesis of the function and then activate code assist only the possible valid input output data elements internal data elements etc are displayed In this case these are data elements that are of type Number Anything else that is not a number may not be passed to the round function Bosch Software Innovations GmbH 158 270 Chapter 4 Tasks 4 10 2 Hyperlinking The data elements used in expressions are linked to the corresponding definition in the Rule Explorer You can show this link by pressing the Ctrl key while you are in an expression and move over a data element Which seat Click on the data element while holding Ctrl to navigate to the definition of this element in the Rule Explorer gt Rule Explorer 2 gt DS DI l E ES Movie Ticket Pricing El Movie Ticket Pricing E RK Input Outout Data B Input i iT auditorium no ES coupon in T seat no i GG show date i E student 4 10 3 Working with Auto Creation Data elements and other elements like services actions rules etc can be created automatically via automatic el ement creation To use auto creation with expressions do the following 1 Insert the name of the new element in the expression of the rule element in which the new data element should be used Use inplace editing or the Properties view of th
278. o ard Continue where snopki are handled i Handle Exception Specify what in do when an SXceplion marisa H Fetunred eS HCH Rule Context Palette Rule Modeller oh e oF P Im A A E dh af CH iT fet GE femmt gent Pata br 4 Gent Te i Premiu Cu carer o z ie Pe p LO Internal Data kr Constant Data KEE E Actions foont carted Setervices ES E Rule Tests eh gb EL Rent Test A Las Figure 2 2 Visual Rules Rule Editor foment Owen o Rule Editor Palette Rule Context Palette The rule editor is used to view and edit a rule Here you can model your rule graphically insert new rule elements from the palette and use data elements actions and services from the rule context palette The rule editor palette shows all the elements that you can use for rule modeling You can drag elements from the palette and drop them into the rule editor The palette also contains tools for zooming adding notes and adding branch descriptions You find more information about the rule elements here Section 3 5 Flow Rule Ele ment 31 The rule context palette displays and gives quick access to data that is available for this rule This includes data elements actions and services and also a list of all rule tests Data ele ments actions services and tests can be created renamed or deleted and the Properties can be opened by double clicking There are s
279. o the right up or down Move the mouse until the arrow points into the direction you want Which seat ee a e Kan Special seating Sch 8 Special seating General seating bool F Day of week Weekend surcharge _ er A stop icon indicates that the rule element cannot be added at this location 3 When you see a black arrow click again and the new rule element will be inserted Related Concepts e Section 3 5 Flow Rule Element 31 e Section 3 6 Flow Rule Editor 45 Related References e Section 5 3 1 1 Flow Rule Editor Palette 205 4 3 8 Editing Descriptions of Flow Rule Elements Next to each flow rule element is a box that contains the description and or content rule expressions 1 Make sure descriptions are displayed by activating the Hide Show Descriptions toolbar button 2 Double click a description you want to edit You can also just select it and start typing The inplace editor will open Send birthday greetings Action EMail 3 Enter the description 4 Press Ctrl Enter to close the editor or click with the mouse outside of the editor Related Concepts e Section 3 5 Flow Rule Element 31 e Section 3 15 Description and Note 78 4 3 9 Collapsing Branches Individual branches of a flow rule can be collapsed and expanded to get a better overview This is often helpful when working
280. o weekend EP Auditorium 1 special seating no weekend gt Global Test Data Test Configuration Figure 5 16 Rule Test editor Test Test editor element element o Deseription emer Toggles the alphabetical sorting of the data in Input and Output Determines whether or not type information is displayed for the data in Input and Out put Arranges the Test Cases Input and Output panels next to each other This is the de fault es Arranges the Input and Output panels vertically on top of each other P Hides the Output panel and shows only the Input panel Hides the Input panel and shows only the Output panel Clicking here will open a text field where you can enter a description for this test Related Concepts e Section 3 22 Rule Testing 82 5 3 4 1 Test Cases This panel shows the test cases defined in this rule test Test Test editor element element Desen e e Add another test case Duplicate the selected test case including all its input data and expected values o Importtestcases test cases Delete the selected test case e Move the selected test case one position up Bosch Software Innovations GmbH 211 270 Chapter 5 Reference 4 Move the selected test case one position down Ka Execute the test This will start the whole test and execute all test cases defined in this test If code needs to be generated before exe
281. of the new service to be created This must be different from any other service in the rule and rule package Service Type Filter Enter the beginning of the name of the service type you want to select This will filter the list so that it only shows elements with matching names Initially the list will not be filtered You can use an asterisk to represent any number of characters e g Service Final will match all names containing both the words service and Final You can use a question mark gt to represent exactly one character e g Service will match all names containing the word service preceded by exactly one character Check Show all to list all available services Service Type Select from the list the Service Type for the Service to be created 5 2 6 Generate Documentation Wizard Use this wizard to generate an HTML documentation for a rule model rule package state flow or a single rule Bosch Software Innovations GmbH 203 270 Chapter 5 Reference Generate Documentation EIEE Generate Documentation l Generates a documentation of a rule model rule package state Flow or a rule Select the element to generate the documentation gt Movie Ticket Pricing Target Directory D Workspaces Movie Ticket Pricing documentation Browse Options Format HTML POF C WORD Template D packages rules and state Flows with detail pages Language Engish Images with Je Descriptions
282. ol lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implementation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited Description The description for this row You can edit cells in this column by double clicking them 5 6 8 4 Constant Data Tab This tab is shown when an element that has constant data elements like an enumeration exception or structure type is selected in the Rule Explorer Bosch Software Innovations GmbH 258 270 Chapter 5 Reference H Properties 53 ep Schedule Attributes i e 2uper Types Mame Type Multiple Implementation Default value Description Constant Data 3 o Schedule Description mn GA DEFAULT_TIME Time Wo 13 350 00 l Motes Advanced Figure 5 75 Constant Data tab Initially all elements are collapsed This button will expand them so that all constant ele ments are visible This only has an effect if there is at least one element available Adds another constant data element Creates a new group This allows you to organize your constant data elements Inserts another element to an constant data element that is a collection list or set This is only available when the currently selected constant data element
283. olumn Accordingly the black arrow will point to the left or to the right Move the mouse until the arrow points into the direction you want BETWEENL1 200 aucitorium_no Bonus Points f A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow click again and the new assignment column will be inserted Option 2 1 Select an output data element from the Rule Context palette and drag it 2 Now move the mouse over an existing blue column header A black arrow will appear to show you where the new assignment will be added This can be either before or after an existing assignment action or exception column Accordingly the black arrow will point to the left or to the right Move the mouse until the arrow points into the direction you want A stop icon indicates that the decision table element cannot be added at this location 3 When you see a black arrow drop the output data element and the new assignment column will be inserted The output data element is automatically inserted in the assignment column header Related Concepts Bosch Software Innovations GmbH 128 270 Chapter 4 Tasks e Section 3 7 2 Assignment Column 49 Related Tasks e Section 4 4 7 Editing an Assignment 129 e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 7 Editing an Assignment In order to edit the assignment column header
284. omer accounts unlocked forall customers NOT account locked How many customers have overdrawn their accounts count customers balance lt 0 The first and last O functions find the first or last element of a collection that fulfills a condition This is often useful in connection with sorted collections The first last customer with over 10000 dollars in his account first customers balance gt 10000 last customers balance gt 10000 The customer that has minimally overdrawn his account first sortDesc customers balance balance lt 0 The customer that has just not overdrawn his account last sortDesc customers balance balance gt 0 3 12 15 3 Searching for maximums and minimums The functions min and max search collections for the lowest or highest element according to a specific criteri um Example 3 15 Searching for maximums and minimums The customer with the shortest name min customers length name The wealthiest customer max customers balance Bosch Software Innovations GmbH 63 270 Chapter 3 Concepts 3 12 15 4 Filtering Collections The filter function tests the elements of a collection whether they fulfill a certain condition The resulting col lection does only contain those elements that have fulfilled the condition All other elements are not in the resulting collection The given lt THIS expressi
285. oming and outgoing transitions To remove a single state flow element in a state flow do the following 1 Right click on the state flow element and select the Delete menu item Alternatively you can select the state flow element and press Del 2 The state flow element is deleted 4 5 11 Adding a Note 1 Select the Add Note tool from the Palette 2 Click on the state flow element where you want to attach the note 3 A note will appear to the right of the state flow You can move the note per drag amp drop 4 Double click the empty note This will open the inplace editor 5 Enter the text for the note 6 Press Ctrl Enter to close the state flow editor or click with the mouse outside of the editor Alternatively you can use the Properties view to enter notes 1 Select the state flow element where you want to attach the note 2 Inthe Properties view activate the Notes tab 3 Click on the button to add a new note 4 Enter the text of the note Related Concepts e Section 3 15 Description and Note 78 Related References e Section 5 6 1 2 Notes Tab 230 Bosch Software Innovations GmbH 139 270 Chapter 4 Tasks 4 5 12 Deleting a Note 1 Select the note you want to delete 2 Use the right mouse button to select the Delete menu item Alternatively press Del Alternatively you can use the Properties view to delete notes 1 Select the state flow element whose notes you want to dele
286. on open the folder in which the documentation was saved Open the generated documentation index html file with a web browser The documentation is divided in three parts On the left side is the documentation displayed for the element that is selected On top of the right side rule models and rule packages are shown If you click on the name of a specific one the documentation is displayed for it In the example this is the rule model Movie Ticket Pricing The documentation shows the Rule Package Name in this case the model name the Description and all da ta elements like Input Output Data that are defined for this model al Documentation Ti aj E 2 Dass Baies al Rules Modeler 4 0 ysorkspacel Mowe Ticket Priingidocumentationindez htrmi sw EP BH visual rules rule your business logic Rules Documentation Packages Documentation generated on Mar 6 2008 2 41 PM Movie Ticket Pricing Rule Package Name Movie Ticket Pricing Description The Frici ng rule determines the price for a movie ticket on the basis of parameters entered The calling program that enters all required parameters into the rule receives aS a result the price calculated as well as details about the pricing so that a corresponding receipt can be printed out The details about pricing are returned to the calling application via actions Input Output Data Input Output Required Default Description Rules Value 3 Discounts
287. on 3 14 3 Structure 74 e Section 3 14 5 Enumeration 76 e Section 3 14 6 Exception 76 e Section 3 14 7 Collection 76 Related Tasks e Section 4 6 Working with Data 140 e Section 4 7 Working with Data Types 150 e Section 4 6 13 Displaying Data Types 148 3 14 1 Basic Data Type Visual Rules supports the following basic data types Any The any type is used to represent a value of well any type It can be a string a Date a Float or any custom data type This is convenient because it allows the rule author to initially ignore data types when writing rules All operations can be applied to an any value However the operation may fail if the any value has an incom patible type Default value Float The Float type is used to represent decimal numbers Default value 0 Bosch Software Innovations GmbH 71 270 Chapter 3 Concepts integer The tnteger type is used to represent whole numbers without a fractional part Default value 0 String A string contains a sequence of characters and can contain any kind of text Default value empty string Boolean A Boolean Value represents a logical result and can be either true or false Default value false Date A pate consists of entries for year month and day Default value current date Time A Time value refers to a specific time of day and consists of hour minute second and millisecond Default val ue
288. on 4 3 10 Editing a Decision Element 110 Related References e Section 5 6 2 1 Decision Overview Tab 230 e Section 5 6 2 2 Decision Details Tab 231 3 5 1 1 Simple decision The smallest possible decision only has one condition The following picture shows such a decision Both the de scriptions bold font and the contents of the decision normal font are displayed rece customer age Ve is an adult 25 The meaning of the decision element shown above is as follows If the customer is an adult then continue with the first exit otherwise continue with the else exit 3 5 1 2 Multiple condition decisions Decisions can have more than one condition If you add another condition to the example above you get a multi ple condition decision Bosch Software Innovations GmbH 33 270 Chapter 3 Concepts e FS 25 older than 65 years This decision has two conditions and an else exit It has the following meaning If the customer is an adult then continue with the first exit or else if the customer is older than 65 then continue with the second exit otherwise continue with the else exit The decision has a problem in this form because if a customer is older than 65 years he or she is also an adult Consequently the first is an adult condition is already true and executed The second exit would never be execut ed This problem can
289. on This column shows the operation the assignment will perform When you double click a cell in this column you can choose the type of assignment The possible choices are Normal assignment default The data element will be assigned the result of the ex pression ADD Collection addition The result of the expression will be added to the collection spec ified as the data element For example 2 3 app 4 will produce 2 3 4 The data element must be a collection type If the expression is also a collection type the two collections will be merged For example 2 3 app 4 5 produces 2 3 4 5 REMOVE Collection removal The result of the expression will be removed from the collection on the left side For example 2 3 REMovE 3 produces 2 The data element must be a collection type If the expression is also a collection type all elements from the right collection are removed from the left collection For example 2 3 4 REMOVE 2 3 produces 4 CLEAR Collection clearing This removes all elements from the collection specified as the data element This operation does not have an expression on the right side This column shows the expression used to calculate the value which is then assigned to the data element You can edit cells in this column by double clicking them Bosch Software Innovations GmbH 233 270 Chapter 5 Reference This column shows the type of the data element to assign to Cells in this column are read onl
290. on for every invocation of the action aS f 1 newAction Send e mail Action Settings Description Action new ction Type Send e mail _ e Notes Server SMTP Server Port default 25 Security Cluse Authentication User l Password _ Use secure connection 55L Figure 5 62 Action Settings tab Oom O e Action Enter the name of the action Bosch Software Innovations GmbH 249 270 Chapter 5 Reference Description Enter the type of the action Code Assist Ctrl Space is available SMTP Server Enter the host of the smtp server that should be used to send an e mail Enter the port of the smtp server Use Authentication Check if you want to authenticate yourself ir renens Enter your password Use secure con Check if you want your e mails to be sent encrypted via SSL nection SSL 5 6 7 3 Output message Action Tabs This tab is shown when an Output message action is selected Here you can specify where the output of the ac tion should be written to Le roperties x 7 oF ieee ORE at S Output f q l Action Settings _ Description Action Output Type Output message e Motes Advanced OFF ile names chase Console ba S55 EE Figure 5 63 Output message Action tab o Action Enter the name of the action Enter the type of the action Code Assist Ctrl Space is available When you select this o
291. on gt must have a boolean result The filter function leaves the original col lection unchanged Example 3 16 Filtering collections Returns the numbers greater than 5 THIS gt 5 filter 8 2 4 3 6 THIS gt 5 8 2 6 Returns the strings shorter than 6 characters length THIS lt 6 filter longer very long tiny length THIS lt 6 Returns all customers with at least 10 000 on their accounts filter customers balance gt 10000 3 12 15 5 Converting Collections The select function is used to convert the elements of a collection into something else The conversion is speci fied by the lt THIS expression gt which is evaluated for every element The result of the select function is a collec tion with the same number of elements as the original collection but every element is the result of the evaluation of the lt THIS expression gt Example 3 17 Converting collections Converts all numbers to strings select 1 8 2 4 3 6 toString THIS 8 2 4 3 6 Returns a collection of customer names select customers firstname name Returns the customer numbers of all customers with at least 10 000 on their accounts Wi select filter customers balance gt 10000 customerno 3 12 15 6 Ranking functions The ranking functions are used to incrementally build sorted lists from single elements e g a list of the best cu
292. oncepts e Section 3 14 3 Structure 74 Related Tasks e Section 4 7 1 Defining Structures 150 Related References e Section 5 6 8 3 Attributes Tab 257 4 7 3 Defining Constants of a Structure To define constants of a structure do the following 1 Select an existing structure for which you want to define constants 2 Right click on the structure and select New Element gt Constant Data 3 Enter the name of the new constant 4 Click on OK to create the constant under the structure It appears in the folder Constant Data under the struc ture in the Rule Explorer 5 Insert the data element settings for the constant and insert a default value In order to define constants on the Constant Data tab in the Properties of the structure do the following 1 Click on the button to add a new constant to the structure 2 Enter the name of the new constant 3 Insert the data element settings for the constant and insert a default value For deleting a constant select it and click on the X button Bosch Software Innovations GmbH 151 270 Chapter 4 Tasks Related Concepts e Section 3 14 3 Structure 74 Related References e Section 5 6 8 4 Constant Data Tab 258 4 7 4 Defining Super Types of a Structure To define the super types of a structure do the following 1 Select an existing structure or exception for which you want to set the super types 2 Switch to the
293. ons contents and notes Double click on state flow elements descriptions contents or notes to edit them This is the zoom tool Click to zoom in Press Shift and click to zoom out Draw a rectan gle to zoom the enclosed area zen rosen um Tromm Bosch Software Innovations GmbH 209 270 Chapter 5 Reference 5 3 3 2 State Flow Context Palette The state flow context palette is shown on the right side of the state flow editor It displays and gives access to all the input output data elements available to the state flow It can be collapsed or expanded Double clicking on an element will open the Properties for this element Clicking on a selected element or press ing F2 will allow you to rename the element lad Is G Input Output Data ek g dateofpurchase Date fa orderdate Date ipa Price Float g value Float Figure 5 15 State flow Context palette Palette Item Description ET This button enables disables the display of type information for the elements in the palette at When this button is not pressed the palette only shows elements that are defined by the state flow itself When the button is pressed the palette will show all elements the state flow has access to thus including elements that are defined on the rule packages above Elements not defined by the state flow itself are displayed with a grey background The button adds a new data element The button deletes the currently selected data elemen
294. ons to select the rule model and rule package from a list Bosch Software Innovations GmbH 143 270 Chapter 4 Tasks 9 Enter a name for the new data element 10 Click on Next gt 11 The dialog shows the columns of an entry in the CSV file Import CSV file as Constant Data Element Column Configuration Specify the names and types of the columns to be imported You can use one or multiple columns as keys In that case the CS file is imported as a map e g For lookup data Import Use askey Mame e Regions Name oe Regions Country Code e Regions Couptrel mit Status Hegiops Couptrg mt Worldbeoon Regions _CountryLimit_WorldRegionSub 12 Select the columns to be imported The individual columns will be turned into attributes of the created data element 13 Select the columns to be used as keys if necessary If you select at least one column to be used as a key then the CSV file will be imported as a Map otherwise as a List 14 Specify the names and types of the respective attributes 15 Press Finish 4 6 5 Specifying the Data Type of a Data Element Specify the type of a Data Element in the Properties of the data element 1 Double click the data element to open its Properties 2 Select the data type in the column Type You can select the standard data types or structures Related Concepts e Section 3 14 1 Basic Data Type 71 e Section 3 14 3 Structure 74 Bosch
295. onstant data 2 Inthe Properties view activate the Constant Data tab 3 Click on the button to add a data element Alternatively you can use the context menu of the Properties view to add a constant data element to a rule that contains the possible operations Show All Values w Je Sorter CG Add Group S W Remove Sh Add List Element Crit ap Move Up Chrlt Arrow Up dt Move Down Chrl arrow Down Related Concepts e Section 3 13 4 Constant Data 70 4 6 4 Importing a CSV file as a Constant Data Element You can import a CSV file as a constant data element of the kind List 1 Select File gt Import in the menu 2 The Import wizard appears Bosch Software Innovations GmbH 142 270 Chapter 4 Tasks Select Choose import source Select an import source i General Im LG CVS E E Plug in Development H E Run Debug gt Team GE visual Rules gt XML lt Back Next gt Finish cancel 3 Open the folder Visual Rules 4 Select CSV File as Constant Data Element 5 Click on Next gt 6 The dialog Import CSV File as Constant Data Element appears Import CSV file as Constant Data Element Import Configuration Choose a CSV File and configure the new constant data element Source Target 7 Specify the relevant CSV file 8 Select the rule model and rule package where the new decisi on table should be located You can click on the corresponding Browse butt
296. ontains the business object model For all rules EE d ES Rule Library Data Warehouse Functions Several Functions For data warehouse access Data Types Description Ti Di Rule Library Portal Form validation Actions Use these actions to signal validation errors on web Forms in the portal serve Adyanced When a package reuses another package this does not only include rules but also all the data types action types functions and constant data defined there The following table specifies which package elements can be accessed from the same package from any of its sub packages or from packages that reuse the package respectively Bosch Software Innovations GmbH 28 270 Chapter 3 Concepts Table 3 1 Visibility of elements in the same or in other rule packages Available in any package and all its sub packages Rule Package Ele Available in the Available in any Available in any that reuses the ment same package sub package packages above package Decision Tables yes el yes Flow Rule Tem yes yes plates Internal Data yes yes amp Constant Data yes yes Actions yes yes amp Services yes yes Data Types yes yes Functions yes yes Action Types yes yes Service Types yes yes Related Concepts e Section 3 3 Rule Package 26 e Section 3 2 Rule Model 25 Related Tasks e Section 4 1 3 Defining Rule Project Dependencies 90 e Section 4 2 19 Reusing Rule Packages
297. ontent Assist AE Dependency Management Expression Formatting Flow Rule Editor Create tasks L Include author in task Syntax Highlighting Task priority Low Test Execution User Settings Colors in Rule Editors Foreground Background Restore Defaults Apply Figure 5 86 Notes preferences H the text of a note starts with the name of a defined category then the note is automatically consid ered to be of that category and the related settings are applied 5 8 Hotkeys The following hotkeys can be used in the rule editor Bosch Software Innovations GmbH 269 270 Chapter 5 Reference ry bd Si mm J bd m Q eF fe gt O er A lt 19 A D lt Cursor keys Navigate between rule elements Alt Cursor down Navigate into and down within a rule element Expand collapse rule elements Expand rule element Collapse rule element Delete the branch rooted at the currently selected element Alt Del Delete the currently selected element only Ctrl S Save the rule Ctrl Z Undo last change Ctrl Y Redo last change undone with Ctrl Z Create Assignment Rule Element Create Call Flow Rule Rule Element Create Call Service Rule Element Create Decide Rule Element Create Describe Branch Rule Element Create Done amp Return Rule Element Create End Repeat Rule Element Create Fire Action Rule Element Create Handle Exception Rule Element Create Note Create Repeat Rule Element Creat
298. op i Model validation Open properties in dialog instead of in Properties view H Plug in Development H Report Design Run Debug ER Team Visual Rules Auto Creation Content Assist z Dependency Management Flos Rule Editor Syntax Highlighting Test Execution epee Settings Restore Defaults Apply Maximum element width Text padding Figure 5 80 Flow Rule Editor preferences Oom OO e Maximum element This is the maximum width in pixels for all rule elements If descriptions or contents are width longer than this they will be wrapped Bosch Software Innovations GmbH 263 270 Chapter 5 Reference C Maximum element This is the maximum height in pixels for all rule elements If descriptions or contents are height longer than this they will not be fully displayed An ellipsis is displayed to indicate this Text padding This is the amount of padding in pixels done around descriptions and contents Show transparent Enable this to display a transparent image of the rule element s being moved during elements during drag amp drop You may want to disable this if it slows down your computer considerably drag amp drop Open properties in When enabled double clicking a rule element in the flow rule editor will open the proper dialog instead of ties in a dialog This is useful when working in a maximized flow rule editor Otherwise the in Properties View properties will be displa
299. or set This is only available when the selected input data element is a collection list or set Removes the currently selected value for a collection data element If the input data el ement of the decision table you are calling does not exist anymore this button removes the value you previously assigned to it GC This button automatically inserts data elements as input data when they have the same name and type Only inputs still without a value will be affected e This button automatically inserts data elements to assign the outputs to when they have the same name and type Only outputs not yet assigned will be affected Table Column Description Input Data This column shows the name and type of the input data of the decision table you are call ing Cells in this column are read only Value The expression you want to assign to the input data You can edit cells in this column by double clicking them Code Assist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them Output Data This column shows the name and type of the output data of the decision table you are calling Cells in this column are read only Assign To The data element you want to assign the value of this output element to You can edit cells in this column by double clicking them Code Assist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them 5 6 2
300. orking with projects It lists all the projects and their contents data elements files models etc You can create edit delete or move re sources in this view and organize the structure of your rule project Rule Editor The rule editor is used to view and edit a rule Most of the rule authoring process takes place here It is a sophisticated graphical editor with a tools palette left and rule context palette right see Figure 2 2 Visual Rules Rule Editor 5 You can open multiple rules at the Bosch Software Innovations GmbH 3 270 Chapter 2 Getting Started oe osn The Outline view displays a compact representation of the rule being edited A blue box is drawn around the currently visible part of the rule in the rule editor You can navigate through the rule by moving this box around The rule editor will scroll its viewport accordingly Properties The Properties view shows information and settings for the currently selected element Whenever you select an item in the Rule Explorer or in the rule editor the Properties view will be updated and shows the properties of this element The properties of an element are usually grouped on several tabs Navigate to a specific tab by clicking on the tab name dis played on the left side Problems The Problems view displays a list of all current errors and warnings that Visual Rules has de tected in the rule projects It describes the error says which rule contains the er
301. ose attributes to which no values are explicitely assigned type specific default values will auto matically be assigned instead E g in the example below the eventual value of the attribute 3 will be 0 instead of 1 2345 Description Description SS inouti j SS inoutt Structure Structure o attributel 1 o attributel 7 o attributez one o attribute bwo o attributes 1 2345 e attribute Related Concepts e Section 3 12 Expressions 55 Related Tasks e Section 4 3 11 Editing an Assignment Element 112 Related References e Section 5 6 2 3 Assignments Tab 232 3 5 2 1 ADD REMOVE and CLEAR Assignments The assignment element offers special operations for working with data elements that contain multiple values so called collections These operations are ADD REMOVE and CLEAR which allow you to add values to a collec Bosch Software Innovations GmbH 36 270 Chapter 3 Concepts tion to remove values from a collection or to empty a collection These special operations are indicated by the words ADD REMOVE Or CLEAR instead of the operation With an ADD assignment you can either add a single element or another collection In the latter case all elements of the collection are added The same is true for a REMOVE assignment Here you can remove a single element or all elements in another collection This is an example of an ADD assignment which adds a customer to a list of prefer
302. ou can check that on the Java Code Generator tab of the rule project Bosch Software Innovations GmbH 169 270 Chapter 4 Tasks F Properties H Problems E console TE Navigator ae Hierarchy E Movie Ticket Pricing 0 Reuse Packages Input Output Data Java Source AC Internal Data This project Po LEE Workspace ode Ticket Pricingfvr sregen Actions Data Types Code Settings Configurations Java eo 1 4 version 3 Compatibility Enable rule statistics and listener code Java Type Library Encoding windows 1252 K Java Code Generator EE d Internal package name internal Description EE i Package prefix Notes advanced Reformat generated source code 2 On the Configuration tab of the test editor you have further options to tune your statistics In the select box Create Statistics you can select whether you want the statistic being generated for the entire test or for every test case of your rule test separately If you select Yes for every test case then you can show the statistics for a single test case that is selected in the test editor Statistics Create Statistics Des For the entire test wi Detail Level Record number of visits and execution times w 3 To define the detail level of your statistics you can choose to either record the number of visits or to record both the number of visits and the execution times 4 To see the current statistics for your test
303. ovations GmbH 23 270 Chapter 2 Getting Started Huie Modeling Tetorial Fired Rula Talaria Fire Rula Bent wrrufe Nisaai Rules Modeler Fie Edt Abnagete Sech Pred Aun Window Help x fe RQ Be ee oy rude Modeling e GB Ingest Tuten EA Test for BU Rent in Tutorial First Rike s b Descriptio Diit aie Bel 2X Se Test ages Imtet LEE AT SS z O t tila 2 Go Fettes b Tei Cap Dess Er Prerarn_Custerrar Ar i Bartal Den Test for dont granted rite The rule elements that have not been executed for this test case are grey The colored elements have been executed and the number indicating how often is displayed next to each rule element 5 Show the statistics for another test case In order to do that select the other test case in the rule test editor The rule editor will now show the statistics for the selected test case Bosch Software Innovations GmbH 24 270 Chapter 3 Concepts Chapter 3 Concepts 3 1 Rule Project The workspace of Visual Rules Modeler can contain multiple rule projects which can be seen in the Rule Explor er or Project Explorer A rule project contains a rule model and the file ruleproject vr Rule projects are repre sented by this icon A rule project can define dependencies to other rule projects or libraries in order to reuse the rules data types services or other elements d
304. ow in the title bar of the palette 4 Palette l Select GL foom _ Box Select Select multiple cells Decide Add a new condition column or row Else Add a Fallback condition E Assign Add an assignment Column Fire Action Add an action column wi Return Exception 4dd an exception column Figure 3 9 Decision Table Editor palette 3 8 2 Decision Table Context Palette The decision table editor has a Rule Context palette which displays the data elements and actions the decision table can access It also lists the rule tests available for the decision table The palette gives quick access to all these items so that the decision table author does not have to continuously switch to the Rule Explorer This is especially useful when the decision table editor is maximized Depending on the state of the toolbar button the list only shows the elements defined and owned by the deci sion table itself or all elements in the rule package hierarchy or being reused All elements can be edited by double clicking them A single click on a selected item allows it to be renamed Ele ments can be created and deleted using the corresponding and buttons The palette can be collapsed and expanded by clicking on the small black arrow in the title bar of the palette Bosch Software Innovations GmbH 51 270 Chapter 3 Concepts Rule Context m ig G Input Output Data F 7 ia Bonus_Points C
305. pe CG Premium_Customer GG Price CG Rental_Days Internal Data Q Constant Data Discount_Granted 2 2 4 5 Conclusion The flow rule is now finalized and should look like the rule below There should not be any error or warning mark ers any more The result of this tutorial will now be used in the next tutorial about testing of rules Bosch Software Innovations GmbH 17 270 Chapter 2 Getting Started E 7 What is the car type Car_Type Compact lt Price is 50 per day compact e Price Rental_Days 50 gt g SCH Dr z Is it a premium customer Premium Customer _ Luxury i Price is 60 per day j j TES premium customer Price 10 discount 8 luxury e Price Rental_Days 60 T TRUE e Price roundiFrice 0 9 Discount on rental granted Discount_cranted Mo premium customer 2 3 Tutorial 2 Testing Your First Rule A rule test is a test for a specific rule It tests the correctness of this rule by executing the rule with given input data and inspecting the results that the rule produces One such execution is called a test case A rule test can consist of any number of test cases and there can be multiple tests for the same rule Rule tests are defined edited and executed with the rule test editor It consists of two tabs One named Test that includes test cases test data reference data and the result of the rule execu
306. pecial toolbar icons for the rule editor where you can change the appearance of the so called flow rule 100 wl EL GL B 71554 The elements in the rule editor can be turned on off in the drop down menu of the View icon which can be ac cessed by clicking the arrow next to the icon Among other things the display of descriptions gt contents or notes can be toggled here You can also modify the maximum height and width of rule elements This can be done via the increase and de crease buttons in the toolbar amp These settings are also available in the Preferences Window gt Pref erences gt Visual Rules gt Flow Rule Editor Bosch Software Innovations GmbH 5 270 Chapter 2 Getting Started SZ EURent 2 SATTE d Palette l Select G Zoom Add Note Add a note Description 7 Describe Branch 4dd a description to a whole branch Die What is the car type Content oo Note La imm0142 4 Compact Price is 50 per day compact O Decide Make a decision e Assign Calculate values and update data 6 Fire Action Fire an action Call Flow Rule Call another Flaw rule Call Decision Table Call a Luxury decision table retrait Call Service Call a service j Done amp Return Immediately return to the calling rule You can change the zoom level of the rul
307. place editing means that the contents of the decision table can be edited right with in the graphical display and can be edited simply by double clicking on the specific cell Some other settings for Bosch Software Innovations GmbH 50 270 Chapter 3 Concepts each decision table element can be edited in the Properties view The Properties view always shows the settings for the currently selected cell of the decision table When changes have been made to a decision table the decision table editor will indicate this by displaying an as terisk in front of the decision table name shown in the editor s tab Clicking the button or pressing Ctrl S will save these changes The decision table editor highlights the conditions that lead to the currently selected cell That makes navigat ing large tables much easier You can turn this feature on off in the View context menu or with the corresponding Highlight Condition Path button in the toolbar bonus_card BONUS CARD GOLD BONUS CARD SILVER weekDay currentDate bonus_points Figure 3 8 Decision table with selected conditions 3 8 1 Decision Table Editor Palette The decision table editor has a palette from which the user can select new decision table elements to be inserted into the decision table The palette also contains tools for zooming and selecting mulitple cells of the decision ta ble The palette can be collapsed and expanded by clicking on the small black arr
308. previously located in the customerScoring rule The customerScoring rule now calls the two new rules scoring1 and Scoring2 These two also need the cus tomer data to perform their task Now you could either define an input data element customer on both new rules and pass on the customer data from the customerScoring rule to the two sub rules or you could simply remove the customer input data element from rule customerScoring and define it on the rule package that contains all three rules In that case the customer input data element is automatically shared among all three rules The following elements can be defined in every package Flow Rules Flow rules are the central and most important concept of Visual Rules They define the behavior of the rule system Flow rules make decisions perform calculations or trigger actions Decision Tables Decision tables are another representation of rules in a tabular form They are useful for rules that make many decisions based on only few inputs 3 Flow Rule Templates Flow rule templates are blueprints for newly created flow rules They are especially useful when you create a lot of similar flow rules amp Data Rules need data to perform their tasks Therefore a rule package may also contain definitions about data which is shared by all rules in this package or any of the sub packages Data is divided into input data output data internal data and constant data D Actions Rules can trigger act
309. ption you must specify the filename to which the output should be written to here Overwrite existing Check this option if you want every output to overwrite the existing file When this option File is not checked the output is appeneded Console When you select this option the output is written to the console instead of a file The corresponding Fire Action tab is shown when an invocation of the action is selected in the rule editor You can specify the output text here Bosch Software Innovations GmbH 250 270 Chapter 5 Reference dE Pa w oO k L Properties O ie eer ae eS e P Fire Action 1 Fire Action _ Description Fire Action Output Gad Notes Output expression Hello World Figure 5 64 Fire Output message Action tab O oio o Fire Acten Enter the name of the action that you want to fire Code Assist Ctrl Space is available Output expression Enter the expression you want to output 5 6 7 4 Log message Action Tab This tab is shown when a Log message action is selected in the Rule Explorer or in the data ruler of the rule edi tor In it you can specify which category the log messages belong to Also Description Action jog_action Type Log message IK Nokes Category Log rule name and rule element ID Figure 5 65 Log message Action tab O owo zenme Action Enter the name of the action Enter the type of the
310. r file 2 Change the Group ld Artifact Id and Version fields in the Project Information section 3 Click on the Save button l in the toolbar Alternatively you can press Ctrl S Related Concepts e Section 3 1 Rule Project 25 Bosch Software Innovations GmbH 89 270 Chapter 4 Tasks Related Tasks Section 4 1 3 Defining Rule Project Dependencies 90 4 1 3 Defining Rule Project Dependencies 1 Open the rule project editor by double clicking the ruleproject vr file 2 The Required Dependencies section lists all the dependencies of the rule project Use the button to add a new dependency and the button to remove a dependency Rule Project Movie Ticket Pricing c Project Information Dependencies between projects and artifacts are expressed via Group Id Artifact Id and Version Specify these identifiers For this project here Other projects can then reference this project using the Group Id Artifact Id and Version Group id movie ticket pricing Artifact Id Movie Ticket Pricing Version 1 0 Required Dependencies Dependency Details Specify all other projects or artifacts required by this project ppecify the identifiers of the selected dependency ia visualrules runtime 4 5 0 SN4PSHOT Group Id When you add a dependency the Select Libraries dialog lets you select rule projects and libraries from your workspace Select a rule project or library and cl
311. race which lists the rules and rule elements that are currently being executed The current position of execution is rep resented by the top most element The view toolbar contains buttons to control the debugger Ki Debug 7 gt e e m3 EE Pricing Test yrbest visual Rules Test EZ de visualrules rulerunner RuuleRunner at ocalboest GG E g main W ssignments 13 H bon gt Condition 6 SZ Decision 4 Bae Condition 10 H d Decision 7 78 Pricing wi Bes dar asss en a d 1 gt WI Figure 5 36 Debug view Bosch Software Innovations GmbH 227 270 Chapter 5 Reference Clie Resumes rule execution when it was halted Rule execution will continue until it either hits another breakpoint or finishes L Disconnects the debugger This button is only available during a remote debug session when it is connected to a remote Java VM a Steps to the next rule element This also enters Flow Rule Calls and Deci sion Table Calls PR Steps over the remainder of the branch and then halts Flow Rule Calls and Decision Table Calls are not entered Related Tasks e Section 4 13 Debugging Rules 175 Related References e Section 5 1 3 Debug Perspective 199 5 5 9 Variables View The Variables view is used during debug sessions When execution halts at a breakpoint it shows the current da ta elements an
312. reated under the rule in which it was created and is shown in the Rule Context palette Rule Context b en fat G Input Output Data F ie Internal Data a 27 ES Constant Data sbb it i Actions e Sa w general_seating coupon discount granted G special_seating student_discount_granted weekend_surcharge_added B services H E Rule Tests ss t It is also displayed in the Rule Explorer in the Actions folder under the rule In order to create a new action for a rule a rule package or a rule model in the Rule Explorer you have two op tions Option 1 1 Select the rule rule package or rule model in the Rule Explorer where you want to define a new action 2 Right click the element and select New Element gt Action in the contextual menu that appears 3 A dialog appears for you to give the new action a name 4 Click on OK to create the action It appears in the folder Actions in the Rule Explorer Option 2 1 Select the rule rule package or rule model in the Rule Explorer where you want to define a new action 2 Inthe Properties view activate the Actions tab 3 Click on the button to add an action Bosch Software Innovations GmbH 154 270 Chapter 4 Tasks The new action is shown in the Rule Explorer in the Actions folder E O Movie Ticket Pricing D 6 Input Output Data Constant Data ER Actions aD td coupon_discount_granted e special_seating 9 student_disco
313. red customers In order for this to work the preferredCustomers element must be a collection list or set i e it must have the multiple setting acti vated Example 3 1 ADD and CLEAR assignments a of Add customer to the list of preferred customers preferredlustomers ADD customer The CLEAR operation does not have a right side so it simply reads a Clear the list of preferred customers preferredCustomers CLEAR Collections can be defined to contain unique elements only i e every element can appear only once within that collection Here are the exact semantics for the ADD and REMOVE operations depending on the unique setting of the collection used on the left side Table 3 2 ADD and REMOVE assignment semantics Unique setting of the collec tion ADD element REMOVE element unique false The element is added to the end of The element is removed from the the collection collection This happens even if the element If the element appears multiple already appeared somewhere with times within the collection only the in the collection first occurance of it will be removed If the element does not appear with in the collection nothing happens unique true The element is added to the end of The element is removed from the the collection unless the collection collection already contains the element If the collection does not contain the If the collection already contained element nothing happens the elem
314. ree of rule packages with the rule model being the root This tree is also called the package hierarchy Organizing your rule model into packages also allows you to effectively manage dependencies within your model This is because rules from one package cannot call rules from another package unless it is a sub package How ever it works when a package explicitely defines another package for reuse So rule packages also represent the level of granularity for reuse within Visual Rules Every package can contain data definitions actions data types and so on Every such definition is automatically shared among all the rules within that package or in any of its sub packages This allows to make things commonly accessible simply by putting them at the right level within the package hierarchy The rule model itself is the root of the package hierarchy Any definitions that are made on the rule model level top level are globally visible and usable by every rule in the model For example let s assume there is a rule customerScoring with an input data element customer The input data ele ment customer is defined on the rule itself so only the rule customerScoring can access the customer data Maybe Bosch Software Innovations GmbH 26 270 Chapter 3 Concepts that rule customerScoring has become too complex and you would like to split it into smaller rules So you create new rules scoring1 and Scoring2 that both represent parts of the logic
315. rence E Properties 2 3 ra Problems ZS Tasks E console 45 Navigator E g auditorium_no Data Element Description Names Type Integer CIMutpe poles Input Output In zi Required Advanced Mame Default Value Description LS auditorium_no Integer 0 Number of auditorium Figure 5 56 Data Element tab for Input Output data 7 Problems 4 Tasks El Console 5 Navigator HRS B internal Data Element Description Name Type Any Mt WEE C Static Advanced Mame Default Value Description C 3 internal Any Figure 5 57 Data Element tab for Internal data Oo O e OO Name The name of the selected element This The name of the selected element This only appears when one element is selected The name of the selected element This only appears when one element is selected when one element is selected This allows changing the type of all selected elements The name of the type is displayed if all selected elements are of the same type otherwise the field is empty Controls if all selected data elements hold a single or multiple values This is only avail able for Attributes Input Output Internal and Constant Data Input Output Shows wether the selected elements are used for input for output or for both This is only available for Input Output Data Controls if all selected data elements are required This is only available for Input Output Data Controls if all
316. rest of the data doesn t have to be looked at Return Exception The Return Exception element can be used whenever the rule has detected an exceptional situation where it cannot execute any further e g if necessary data is missing or validations have failed In this case a message describing the exception is generated with the Return Exception element and execution continues where ex ceptions are handled Handle Exception The Handle Exception element is used to react to exceptional situations It defines the alternative rule ele ments that are executed when normal rule execution triggered a Return Exception element or if some techni cal error has occured The color of each rule element does have a specific meaning and helps you to understand the rule logic e The color yellow is used for rule elements in which decisions are made e The color blue is used for rule elements that do computations or fire actions i e they change data e The color green is used for rule elements that influence the order of rule execution For example repeats and call rule elements are green e The color red is used for rule elements that have to do with exceptions or errors Every rule element has a box next to it that displays a description and or the contents of the element There are two icons and on the toolbar that let you toggle the display of the descriptions and contents respectively Descriptions for every rule element ar
317. ription ee tt ci Test For discount granted If the test failed and the actual result differs from the expected result there is a red marker and the expected result field is marked red Test Cases Input Output GN D DS a X see Bri irzxae F te Exe AC 2 oi Input Data Value Output Data Expected Result Actual Result ESP Description Gi Car_Type Any luxury Ge Price Any 180 108 Pr ES Premium _Customer Any true Rental_Days An 2 EE Test For discount granted E SE d 2 3 7 Task 7 Show Statistics of Tests During rule execution Visual Rules can collect statistical and tracing information for later use This is especially useful during testing and gives the user additional insight into the workings of the rules An important part of the statistical information is the execution counters for each rule element These indicate how often each rule element was executed The rule editor can display these counters next to each rule element During test execution statistics are generated by default 1 Select a test case in the rule test editor 2 Switch from the test editor to the rule editor 3 Show the statistics in the rule editor by selecting the Hide Show Statistics dt button in the toolbar The icon will change 1 to indicate statistics are shown SEET Show Hide Statistics 4 The statistics are shown for the test case that you selected in the rule test editor Bosch Software Inn
318. rn Exception 42 e Section 3 5 11 Handle Exception 43 Related Tasks e Section 4 7 Working with Data Types 150 Related References e Section 5 6 8 1 Data Types Tab 256 3 14 7 Collection A data element can be a collection which means that it can hold multiple values of the same type other terms you may be familiar with for this kind of data element are list or array A data element is a collection when the Mul tiple property is set There are three different kinds of collections available List Set and Collection List A List contains multiple elements in a fixed order As a consequence you can access the elements of a list us ing an index e g customer 3 for the third element of the list customer Lists can be empty i e they don t contain any elements Lists can contain the same element multiple times Duplicates are not eliminated automatically as is the case with sets Lists are useful if the order of the elements is important Two lists are equal if they contain the same elements in the same order Bosch Software Innovations GmbH 76 270 Chapter 3 Concepts Default Value allMyCustomers Customer List Set A Set is a collection of multiple elements that automatically eliminates duplicates If an element is added to a set that is already contained in the set nothing happens This is very useful if duplicates are undesired The most important advantage of a set is the much hi
319. rom a CSV file comma separated values The Read CSV file action type is only available for rule models that have activated the Visu al Rules 3 x compatibility function actions This can be done on the Extensions tab in the Properties of the rule model Related Concepts e Section 3 16 Action 79 Related References e Section 5 6 7 3 Output message Action Tabs 250 e Section 5 6 7 4 Log message Action Tab 251 e Section 5 6 7 5 Send e mail Action Tabs 252 e Section 5 6 7 6 Write CSV File Action Tabs 253 3 18 Function Functions are used within expressions There are many pre defined functions available in Visual Rules that do computations formatting and conversion of data and many things more When you are editing an expression you can press Ctrl Space to show the content assist which lists all available functions Adds a number of days to the current date fix abs Integer value Integer A s fi addDays Timestamp timestamp Integer day Timestamp Parameters i i date Date to which days should be added fix addDays Date date Integer days Date days 4mount of days to be added to the date fie addHourstTime time Integer hours Tik fi addHours Timestamp timestamp Integer hour Timestamp Examples Date addDays today 10 fi addMillis Time time Integer seconds Time The property Date is equal to the current date 10 days fe addMinutes Time time Integer minutes
320. ror and pro vides the location of this rule You navigate to the problem location by double click on an entry in the Problems view Perspectives The perspectives define the initial set and layout of Visual Rules views Each perspective pro vides a set of functionality and defines what appears in certain menus and toolbars Visual Rules offers different perspectives for different tasks The Rule Modeling perspective is used for rule modeling tasks The Rule Integration perspective is meant for developers who in tegrate rules into an application connect rules with existing object models or extend Visual Rules with additional functions or actions 2 1 2 Modeling Rules Visual Rules provides an advanced collaboration platform between business analysts and IT The business analysts model and maintain the business rules on their own They use the expressive and easy to use graphical user interface of Visual Rules It is possible to draft the rules in a first step using just the graphical el ements and descriptions This is very powerful for specifying the requirements and discussing what will be realized in the business rules model In a second step the business analysts finalize the rules and insert expressions into the existing rule elements Vi sual Rules supports this with the intuitive use of the rule editor For example inplace editing capabilities eliminate the need to ever leave the visual environment The rules first approac
321. rsion and the selected version Revision Revision Time Author E Today H 1 13 37 10 08 11 53 AM E 3100s 11 52 AM H This Month 3 6 08 5 16 PM Sf6 08 5 15 PM Sf6 08 5 02 PM Sf6 08 4 37 PM SHANA 43 gt BM Enter search term Compare With Each Other To compare two rules with each other do the following 1 Select the two rules you want to compare with each other Bosch Software Innovations GmbH 181 270 Chapter 4 Tasks 2 Right click and select Compare With gt Each Other from the context menu 3 The Compare view opens and the changes between both rules are displayed pa Compare Discount Movie Night v1 ule Discounk true ES tind i i aa ae eater satan ad Raa O AA A EE E coc Sc Ba eae eg A NEE e te SS Structural differences E fe 6 changels overall SH S Attribute name in Flow Rule Discounts has changed From Discounts to Discount Movie Might Mg Rule Variation Discounte has been removed Sr Description has been removed ES Rule Variation Discounts has been added Ea Description has been added be Era Constant Data tovie_night_discount has been added ch e Rule Compare QA A a O E E ool JL F Movie Ticket Pricing Movie Ticket Pricing Discount Movie Might vrrule oS Movie Ticket Pricing Movie Ticket Pricing Discounts yrrule E BR Discount Movie Night E 2 Discounts a g Constant Data 78 Discounts Ea movie night discount 8 Discounts Structure Dat
322. ructure Define decision table structure ee oe ee ae z TRUE Ing omg ee 12 To specify a column row as a condition column row click on the respective header 13 To change the comparison operators in a decision column row click on in the respective header and select an operator from the drop down menu 14 To specify a column as an assignment action exception column right click in the respective cell and select the kind of column Further adjustments can be carried out once the table has been imported 15 Press Finish to create the new decision table The decision table editor will automatically show the new deci sion table Related Concepts e Section 3 7 Decision Table 48 e Section 3 3 Rule Package 26 e Section 3 2 Rule Model 25 Related References e Section 5 2 3 New Rule Wizard 201 e Section 5 5 2 Project Explorer View 223 4 4 18 Converting a Decision Table into a Flow Rule You can convert a decision table into a flow rule 1 Inthe Rule Explorer right click on the decision table This will open a context menu Bosch Software Innovations GmbH 135 270 Chapter 4 Tasks 2 Select Convert to Flow Rule 3 The decision table is replaced by a corresponding flow rule Related Concepts e Section 3 7 Decision Table 48 Related References e Section 5 5 2 Project Explorer View 223 4 5 Working with State Flows The following s
323. ructured value you can use the isa operator This will return true if the value is of the specified data type or any sub type thereof otherwise false person isA Customer The asa operator can be used to tell Visual Rules that it should consider a value to be of the given sub type This is useful in order to access attributes that are defined on the sub type only For example a data element of type Person may actually contain a value of a sub type In this case it is a customer In order to access the attribute customeria which only a customer has but not a Person you need to first use the asa Operator to change the type to customer and then access the attribute with the dot operator like this person asA Customer customerId The isa operator in Visual Rules is equivalent to the instanceof operator in Java Also the asa oper ator in Visual Rules is equivalent to a cast in Java Related Concepts e Section 3 14 3 Structure 74 e Section 3 14 4 Super Types 75 3 12 20 Operator Precedence The following table shows all operators available in Visual Rules Operators with a higher priority are evaluated before operators with a lower one Operators with the same priority are evaluated from left to right in the expression Parentheses have the highest priority and can be used to enforce the exact order for evaluating an expression Bosch Software Innovations GmbH 66 270 Chapter 3 Concepts S D SE E
324. rule as an image to the clipboard do the following 1 Open the rule to be exported in the rule editor 2 Right click anywhere in the rule Select Export Image gt To Clipboard from the context menu 3 The image is now in the clipboard and can be pasted in other applications To export a rule as an image to a file do the following Bosch Software Innovations GmbH 124 270 Chapter 4 Tasks 1 Open the rule to be exported in the rule editor 2 Right click anywhere in the rule Select Export Image gt To File from the context menu A file selection box appears 3 Specify the directory name and extension either png bmp OF jpg of the image file 4 Press Save to export the image The exported image shows the rule exactly as displayed in the rule editor So you can e g collapse unimportant branches before you export the image 4 4 Working with Decision Tables The following sections include detailed descriptions for working with decision tables and the decision table editor 4 4 1 Opening the Decision Table Editor inthe Rule Explorer double click on a decision table to open the decision table editor Alternatively you can right click on the decision table and select Open gt Rule Explorer 3 m Slip lL Movie Ticket Pricing 2 77 Movie Ticket Pricing ia Input Output Data D ee Constant Data EN Actions H To Data Types Bonus Foints t Discounts Neu Element F EJ
325. rule in rule editor lt Back Next gt Finish 4 Select the rule model and rule package where the new decision table should be located You can click on the corresponding Browse buttons to select the rule model and rule package from a list 5 Enter a name for the new decision table 6 Click on Next gt to get a list of all the upcoming changes that the extraction will cause You can also uncheck only some of the changes that you don t want to make while leaving others checked Click on Cancel if you don t want to make the changes 7 Press Finish to create the new decision table Unless you deactivated the corresponding checkbox the deci sion table editor will automatically show the new decision table Related Concepts e Section 3 4 Flow Rule 29 e Section 3 3 Rule Package 26 e Section 3 2 Rule Model 25 e Section 3 4 1 Flow Rule Template 30 Related References e Section 5 2 3 New Rule Wizard 201 e Section 5 5 2 Project Explorer View 223 4 3 7 Adding New Flow Rule Elements 1 Select a rule element in the palette by clicking on it Bosch Software Innovations GmbH 108 270 Chapter 4 Tasks 2 Now move the mouse over an existing element in the flow rule A black arrow will appear to show you where the new element will be added This can be either before after above or below an existing rule element Ac cordingly the black arrow will point to the left t
326. s tomers according to revenue The rankAsc OF rankDesc functions take an already sorted list and insert a new ele ment at the right position according to a given sort expression The functions also make sure that the list does not exceed a given size The ranking functions are usually used within an Assignment element after a Repeat element like in the follow ing example The assignment in the example would be positioned after a Repeat element that would go over the complete customer base let s assume a million customers and assign each one to the currentCustomer data ele ment The bestcustomers list would then always contain the 10 best customers according to revenue found so far Example 3 18 Ranking functions Determine 10 best customers Assignment within a Repeat going over all customers bestCustomers rankDesc bestCustomers revenue currentCustomer 10 The advantage of the ranking functions over a sort function is that it can work with elements that are available one by one while the sort function would require to have all customers available when it is called All customers would have to be loaded to the computer memory in order to perform the sort which is not practical in many situations 3 12 16 Map Operators Visual Rules supports Map data elements Maps contain multiple values that are not simply identified by their in dex but by another value called a key Values and keys can be of any data type includi
327. s GmbH 188 270 Chapter 4 Tasks 2 Enter a description of your problem or feature request Try to include as many details as possible When you are done press Next gt P Visual Rules Support Request Welcome Welcome to the Visual Rules support request wizard Please use this wizard to help us improve the quality of our product by sending a support request to our support department Please describe your request or problem situation e g error message unexpected behavior Feature request When Erving to execute a best the rule does not run even though no errors are shown in the problems view It was Working Fine before I moved the rule Discounts to the package internal E Mail support yvisual rules de 3 Select the projects you d like to include in the support request When submitting bug reports you should in clude the projects that are affected whenever this is possible After you have selected the projects press Next gt gt Visual Rules Support Request Projects IF vou wish you can send one or multiple projects concerning your problem along with your support request This will help us to Find a solution to your problem more quickly Please select the projects to send along with your request E Movie Ticket Pricing E Mail supporti visual rules de 4 You will receive an overview over the information that will be sent If you want detailed information about one of the items in the list click on
328. s JOT Integration is already installed so an update wil be performed instead visual Rules Model Access is already installed so an update wil be performed instead Visual Rules Testing is already installed so an update vill be performed instead 4 For the new version of Visual Rules the Licenses must be reviewed For this reason you have to accept the terms of the license agreements Read the license agreements carefully and select accept the terms in the license agreements if you consent to the agreements Click on Finish Bosch Software Innovations GmbH 192 270 Chapter 4 Tasks Install Review Licenses Licenses must be reviewed before the software can be installed This includes licenses for software required to complete the install License bext ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT January 23 2004 Items with licenses Nama Version 1 Eotee BIRT Report Designer ML 2 3 0 200806102 22 7w4311917213 UR Edipse AML Editors and Tools 3 0 2 v2009091 2064 1 7F2ENK Cw US Visual Rules 3 Legacy Libraries Q Visual Rules Jrd Party Libs K visual Rules Ant Tasks E visual Rules Compare Merge E Visual Rules Core Base Gk Vieual Rules Core Expression G visual Rules Core Resource Ui visual Rules Core UT Wine visual Rules Database Connectivity Q Visual Rules Decision Table GP visual Rules Documentation Up visual Rules Execution Gp Visual Rules Flow Rule k visual Rules Generator
329. s are external to Visual Rules so this element allows Vi sual Rules to reuse functionality available elsewhere The Call Service element specifies the name of the service to be called This name is displayed next to the ele ment like this Call the DWH report service DWHRatingReport The values for any required input of the service are also specified within the Call Service element This way rules can forward data to the service In the same way any results coming out of the service can be assigned to data el ements of the calling rule This is also specified within the Call Service element In other words the Call Service el ement calls an external service and handles all the data flowing to and from that service Input data is specified on the Call Service Input tab in the Properties Accordingly the use of any output data is specified on the Call Service Output tab Related Concepts e Section 3 19 Service 81 e Section 3 20 Service Type 82 Related Tasks e Section 4 3 17 Editing a Call Service Element 117 Related References e Section 5 6 2 7 Call Service 236 3 5 7 Done amp Return The Done amp Return element stops any further execution of the rule This is often useful when the rule has decided that any further processing is unnecessary e g if some required preconditions are not met Execution then imme diately continues where the ru
330. s is only available when the currently selected attribute is a collection list or set 2 nase Moves the currently selected attribute up one position within the list Moves the currently selected attribute down one position within the list This column shows the attributes of the selected datatype You can edit cells in this col umn by double clicking them if the cell contains an attribute of the selected element If one of the attributes is another complex datatype like a structure exception or enumer ation and you want to edit the attributes of that datatype please do so in the respective properties tab of that datatype Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available The type of the data element You can edit cells in this column by double clicking them This column shows whether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 C
331. s properly define both input and output data As such they much more resemble rules which also de fine input and output data One way to think of services is as external rules Bosch Software Innovations GmbH 81 270 Chapter 3 Concepts Related Concepts e Section 3 5 6 Call Service 40 e Section 3 20 Service Type 82 3 20 Service Type Every service has a service type The service type is a technical definition that tells Visual Rules how a specific service call is to be executed and what technical parameters are required to do that Visual Rules can be extended with custom service types See the Java Integration Guide for more information Related Concepts e Section 3 19 Service 81 3 21 Auto Creation The Auto Creation dialog pops up whenever Visual Rules wants to automatically create new rule model elements For example if the user enters an expression and refers to data elements that don t exist the Auto Creation dialog asks the user if these data elements should be automatically created If you enter the expression customer age gt 18 and there is no data element customer defined yet then Auto Cre ation will suggest to create an internal data element customer and a structure named customer with an attribute age Automatic Element Creation Automatic Element Creation Visual Rules can assist you in creating new model elements Configure Data Element E Movie Ticket Pricing E 78 Pri
332. s that the decision table element cannot be added at this location 3 When you see a black arrow click again and the element will be moved 4 4 17 Importing an Excel Sheet as a Decision Table You can import an Excel sheet as a decision table 1 Select File gt Import in the menu Bosch Software Innovations GmbH 133 270 Chapter 4 Tasks 2 The Import wizard appears Select Choose import source Select an import source i gt General Im LG CVS E E Plug in Development H E Run Debug gt Team GE Visual Rules Ce gt XML Back Next gt Finish canel Open the folder Visual Rules Select Excel Sheet As Decision Table Click on Next gt m p e pP The dialog Import Excel Sheet as Decision Table appears gt Import Excel Sheet as Decision Table Import Settings E Specify an Excel file o Excel settings Decision table settings Rule package default Browse 7 Specify the relevant Excel file and sheet 8 Select the rule model and rule package where the new decision table should be located You can click on the corresponding Browse buttons to select the rule model and rule package from a list Bosch Software Innovations GmbH 134 270 Chapter 4 Tasks 9 Enter a name for the new decision table 10 Click on Next gt 11 The dialog shows the Excel sheet as a Decision Table in its preliminary form Import Excel Sheet as Decision Table Table St
333. s view lists all currently existing breakpoints Related Concepts e Section 3 23 1 Debugger 87 e Section 3 6 Flow Rule Editor 45 e Section 3 8 Decision Table Editor 50 Related Tasks e Section 4 13 1 Setting Breakpoints 175 Related References e Section 5 5 10 Breakpoints View 229 Bosch Software Innovations GmbH 88 270 Chapter 4 Tasks Chapter 4 Tasks 4 1 Working with Rule Projects 4 1 1 Creating a new Rule Project 1 Select the menu item File gt New Alternatively you can click on the arrow to the right of this icon Tir on the toolbar 2 Select the Rule Project entry from the list If you are not in a Visual Rules perspective you must select Other then select Rule Project from the list and press Next gt 3 The New Rule Project wizard appears P New Rule Project Rule Project Create a new rule project Project name My Rule Project Use default location Location C Programme Vvisual Rules 4 0 workspace Browse Use default rule model name Rule model name My Rule Project 4 Enter a name for the rule project 5 Press Finish to create the new rule project Related Concepts e Section 3 1 Rule Project 25 Related References e Section 5 2 1 New Rule Project Wizard 200 4 1 2 Setting Rule Project Identifiers Group Id Artifact Id Version 1 Open the rule project editor by double clicking the ruleproject v
334. s with the number for the year followed by a hyphen the number for the month 1 to 12 another hyphen and the day 1 to 28 29 30 31 Please be aware that this format has to be adhered to regardless of the regional settings made for your system Example 3 25 Date values e 2000 1 1 corresponds to January 1 2000 e 2008 12 31 corresponds to December 31 2008 e 20 3 11 corresponds to March 11 in the year 20 The expression currentDate 2007 2 29 Is true if the current date is February 29 2007 3 14 1 5 Time A Time value always starts and ends with a character The actual Time value begins with the hour 0 to 23 fol lowed by a colon the minute 0 to 59 followed by a colon the second 0 to 59 optionally followed by a period and the milliseconds 0 to 999 Please be aware that this format applies regardless of the regional settings made for your system Example 3 26 Time values e 10 25 30 corresponds to 10 hours 25 minutes and 30 seconds e 10 25 30 010 corresponds to 10 hours 25 minutes 30 seconds and 10 milliseconds e 23 00 00 000 corresponds to 23 hours 3 14 1 6 Timestamp A Timestamp is composed of a date and a time value It always starts and ends with a character The actual Timestamp begins with a date value followed by a space and the time value The time value consists of hours minutes and seconds separated by colons followed by a period and a value for nanoseconds with a maximum
335. se are automatically under lined if the protocol e g http resource or file is specified marking them as links Clicking on a link opens the associated application displaying its contents Related Concepts e Section 3 15 Description and Note 78 4 2 22 Undoing Changes All changes to rule models can be undone 1 Activate the Rule Explorer and select the Edit gt Undo menu item Alternatively you can also use the Ctrl Z key combination You can repeat this several times to undo previous changes 2 Ifyou want to redo a change that was undone select the Edit gt Redo menu item Alternatively use the Ctrl Y key combination 4 3 Working with Flow Rules The following sections include detailed descriptions for working with flow rules and the flow rule editor 4 3 1 Opening the Flow Rule Editor e In the Rule Explorer double click on a flow rule to open the flow rule editor Bosch Software Innovations GmbH 103 270 Chapter 4 Tasks Alternatively you can right click on the flow rule and select Open LPS Project Explorer 3 E ES ema ree Movie Ticket Pricing SR Movie Ticket Pricing ER Input Output Data fae Constant Data ER Actions zo Data Types H E Bonus Points Discounts at l Ce F SFCQen New Element oO FE Syete Gab wed pk Sa a Rule Proje ple S GC bin Debug As EE Movie Ticket Pr 9 Delete See Rename Fz Copy Ctrl c
336. sections describe various dialogs within Visual Rules 5 4 1 Open Rule Dialog This dialog lists all the rules from all rule models in your workspace pen Rule Select a rule to open S Validation S Validation Check Constraints 78 Validation PDL S Validation Oa S Validation_Rating_Summary Validation ReadFinancialbataonly S Validation_wWhat_IF Figure 5 21 Open Rule dialog Bosch Software Innovations GmbH 216 270 Chapter 5 Reference onion eso Select a rule to Enter the beginning of the name of the rule you want to open This will filter the list so that open it only shows rules with matching names If nothing is entered the list will show all rules You can use an asterisk to represent any number of characters eg Score Final Will match all rules whose name contains both the words score and Final You can use a question mark to represent exactly one character eg category will match all rules whose name contains the word category preceded by exactly one charac ter Related Concepts e Section 3 4 Flow Rule 29 e Section 3 6 Flow Rule Editor 45 5 4 2 Open Rule Test Dialog This dialog makes it possible to quickly open a rule test or a test suite by it s name After it has been opened the dialog shows all rule tests in the workspace When a rule test is selected the name of the rule being tested in cluding rule model name and packages is displayed at the
337. sual Rules allows you to search for individual data elements actions data types etc This can be helpful for ex ample for finding every occurrence of an input output data element in a rule model 4 14 1 Searching Elements To search elements in rule models use the Search view and do the following 1 Select Search gt Search from the menu Alternatively you can use the Ctrl H key combination 2 Select the Rule Search tab in the dialog that appears Search Rule Search EIP File Search WC Java Search Containing text P any words d any character escape For literals ri Search For Search All occurrences Select Names Rules actions Descriptions Expressions Notes Types Input Output Data Internal Data Data Types Scope Workspace 7 Customize search Cancel 3 Enter the text you want to find in the Containing text field You can also use wildcard characters to increase the number of matches Use as the wildcard for any string or to represent any character To search explicitly for the or characters you have to quote them using the character e g is used to search for an asterisk 4 You can select Case sensitive if you want to search for text with notice of upper and lower cases 5 Inthe Search for box you can select the kinds of elements to search for 6 The options in the Search box determine where the text must be found You can search in Names Descr
338. t It only activates when a data ele ment is selected The section can be pinned open with this little pin button 5 3 4 Rule Test Editor The rule test editor allows you to set the input parameters for a rule execution and verify that the resulting output data is what you expect The editor has two pages that you can switch using the tab bar at the bottom One for configuring the rule execution and one for editing your actual test data The title of the rule editor always shows the name of the rule being tested and its path Bosch Software Innovations GmbH 210 270 Chapter 5 Reference e Pricing Tes de Test for Pricing in Movie Ticket Pricing gt Description v Test Case Description ane n E bonus_card BONUS_CARD S is 1 special seating no weekend BONUS_CARD SILVER False onus card SILVER G coupon Boolean E seat no Integer 100 CG show_date Date 2007 09 21 student Boolean False Price Integer Test Cases Input Output ACEL KA Ap xD l S GQ EE EE E l Q s KE ai 8 o Input Data Value Output Data Expected Result Actual Result CG auditorium_no Integer 1 CG bonus_points Integer 15 15 7 P Auditorium 1 special seating no weekend ER Auditorium 1 general seating no weekend B Auditorium 1 general seating weekend ga Auditorium 3 coupon gP Auditorium 3 student gf Auditorium 3 coupon and student vag uditorium 1 special seating n
339. t 4 SS Palette lt Calculate rental charges E Select Compute base charge per vehicle type Calculate discounts per rental days H Zoom Update records C Add Note Add a note E 3 Describe Branch Add a H description to a whole branch e gt Decide Make a decision a SP Ge Flow Rule Call another Flow rule e Assign Calculate values and E Call Decision Table Call a ZA ki Fire Action Fire an action update data decision table 3 When you see a black arrow click again and the new assignment will be inserted 4 Insert a description for the assignment element to document that the price will be calculated here Bosch Software Innovations GmbH 10 270 Chapter 2 Getting Started gs EU Rent 23 gt A P Palette Select G Zoom CA Add Note Add a note zl Describe Branch 4dd a description to a whole branch Price is 50 per day gt Decide Make a decision E Assign Calculate values and update data Fire Action Fire an action Fa Call Flow Rule Call another Flow rule E Call Decision Table Call a decision table 5 Inthe same way as before insert an assignment for calculating the price of the luxury car group AS EU Rent q 2 Palette ls Select EL Zoom CA Add Note Add a note sl Describe Branch 4dd a description to a whole branch Price is 50 per day Pric
340. t Word document is fully supported with BIRT Versions 2 6 2 and high er Microsoft Word provides the possibility to have a table of contents created for the documen tation Due to the limited page width of Microsoft Word documents it may be necessary to mini mize the width of the images This can for instance be achieved by decreasing the maximum el ement width in the preferences of the Flow Rule Editor 7 Select the Template to use You can choose between two templates for specifying the detail level of the gen erated documentation The first one generates documentation with All packages rules and state flows with detail pages the other one generates documentation with All packages rules and state flows with detail pages without rule images If you have selected the option All packages and rules with detail pages you can select which information should be displayed in the images of rules Here you can display rules with Descriptions Contents Call As signment Details Notes Statistics and Exception Handling For state flows statistics are not provided 8 Press Finish to generate the documentation An index html file will be generated Depending on the size of the rule model this may take several minutes to complete Related Tasks e Section 4 18 2 Viewing the Documentation 185 Bosch Software Innovations GmbH 184 270 Chapter 4 Tasks 4 18 2 Viewing the Documentation In order to view the generated documentati
341. t all elements of a rule model can have a description or notes attached to them e g rules rule elements da ta actions types and many more Every element can have one description and or multiple notes Bosch Software Innovations GmbH 78 270 Chapter 3 Concepts Element descriptions are shown in many places within the Visual Rules user interface to make it easy for the rule author to quickly understand the rule model Thus it is very important that descriptions contain concise information about every element Notes are used to leave editorial comments about elements For example a rule author may attach notes to ele ments of the rule model that are still incomplete so he or she doesn t forget Every note is annotated with the infor mation about who created it and when so notes can also be used for the communication within the team A busi ness analyst may leave notes to explain what he or she would like to see changed and another member of the team picks up these notes to actually do the changes Descriptions and notes of selected elements can be viewed and edited on the corresponding tabs in the Proper ties view Additionally there is an editable description column in many tables displayed on other tabs For exam ple the descriptions for all input output data elements are also visible on the Input Output Data tab E Properties 3 Fu Problems Tasks EI Console T Navigator Se E Input Output Data Input Output Data Ad
342. t and click on the X button Related Concepts e Section 3 14 5 Enumeration 76 Related Tasks e Section 4 7 6 Defining Enumerations 152 Related References e Section 5 6 8 5 Literals Tab 260 4 7 8 Defining Exceptions In order to create a new exception for a rule a rule package or a rule model in the Rule Explorer do the following 1 Select the rule rule package or rule model in the Rule Explorer where you want to define a new exception 2 Right click the element and select New Element gt Exception in the contextual menu that appears 3 Enter the name of the new exception Bosch Software Innovations GmbH 153 270 Chapter 4 Tasks 4 Click on OK to create the exception It appears in the folder Data Types in the Rule Explorer 5 lf you create attributes for the exception these can hold information about the exceptional situation Related Concepts e Section 3 14 6 Exception 76 4 8 Working with Actions The following sections contain step by step procedures how to define actions e Section 3 16 Action 79 e Section 3 5 3 Fire Action 37 e Section 3 17 Action Type 80 4 8 1 Defining Actions To add an action to a rule you can simply use the Rule Context palette in the rule editor 1 Click on the button in the Actions section to add a new action 2 Enter a name for the new action in the dialog that appears 3 Press OK The action is c
343. t and press the Del key 2 The rule element including all its successors are deleted Related Tasks e Section 4 3 23 Deleting a Single Rule Element 120 4 3 23 Deleting a Single Rule Element To remove a single rule element in a flow rule but keep its successors do the following 1 Right click on the rule element and select the Delete This Element Only menu item Alternatively you can se lect the rule element and press Alt Del 2 The rule element is deleted and its successors are attached to the element s predecessor Related Tasks e Section 4 3 22 Deleting a Branch of a Flow Rule 120 e Section 4 3 24 Deleting Multiple Rule Elements 120 4 3 24 Deleting Multiple Rule Elements You can delete several rule elements simultaneously 1 Select multiple elements by holding down the Ctrl key while selecting them with the mouse 2 Then use the right mouse button to select the Delete menu item Alternatively press Del Be aware that this deletes all selected rule elements including their successors Related Tasks Bosch Software Innovations GmbH 120 270 Chapter 4 Tasks e Section 4 3 22 Deleting a Branch of a Flow Rule 120 4 3 25 Adding a Branch Description 1 Select the Describe Branch tool from the palette 2 Click on the rule element which is the root of the branch that you want to describe 3 A box around the branch will appear with the branch description at the top 4 Doub
344. t of the underlying Eclipse platform So it may not only show breakpoints in rules but also breakpoints of other tools e g breakpoints in Java code or else The view is normally shown as part of the Debug perspective o Breakpoints 23 RS x S ew pp D Assignments 13 Movie Ticket Pricing Pricing D Pricing Movie Ticket Pricing Pricing Decision Table Cell 6 Movie Ticket Pricing Bonus Points Figure 5 38 Breakpoints view o IL Deeg OOOO me Removes the selected breakpoints Removes all breakpoints When pressed only supported breakpoints are shown during a debug session When pressed all breakpoints are skipped as if they were disabled Related Tasks e Section 4 13 1 Setting Breakpoints 175 Related References e Section 5 1 3 Debug Perspective 199 5 6 Properties Tabs The following sections describe the tabs available in the Properties view Most tabs are only available when spe cific rule model elements are selected e g a Fire Action tab is only visible when you select a Fire Action element in the rule editor 5 6 1 General The following properties tabs are available for all elements of a rule model 5 6 1 1 Description Tab This tab is used to view and edit the description of the selected element Descriptions can contain hyperlinks to reference external content Bosch Software Innovations GmbH 229 270 Chapter 5 Reference Inputfou
345. t should be called You can call services from the same package or from any package that is defined to be reused Press Ctrl Space for content assist or click on to choose the service from a list of available services 2 The required input data elements of the service are displayed in the Input Data area You have to specify val ues for at least the required inputs Click on to automatically insert data elements as input values when they have matching name and type Only inputs still without a value will be affected 3 The output data elements of the service are displayed in the Output Data area Assign the output values to data elements of the calling flow rule Click on amp to automatically insert data elements with matching names and types to assign the outputs to Only outputs not yet assigned will be affected Bosch Software Innovations GmbH 117 270 Chapter 4 Tasks E Call Service 2 Call Service ER Call Service Get_Movie_Information Motes E 3t mees 3 Input Data Vale e Output Data Assign To ree E movie String GodFather E actors Actor List actors AS fea description String movieDescription GC 3 premiere Date Related Concepts e Section 3 5 6 Call Service 40 e Section 3 19 Service 81 Related Tasks e Section 4 10 1 Using the Code Assist 157 e Section 4 11 9 Copying and pasting values 164 Related References e Section 5 6 2 7 Call
346. t to open an inplace editor Hp d Audit No 1 Special 7 Assign eee Mo 1 Special 7 3 Enter the assignment expression This includes the left side the operation and the right side all in one The operator can be either ADD REMOVE Or cLEAR See Section 3 5 2 Assignments 35 for a description of the different operators of assignments Use Alt Enter to start a new line Audit No 1 Special 7 4 Press Enter to close the editor or click with the mouse outside of the editor In the Properties on the Assignments tab do the following ls Double click me left side of the assignment you want to edit This will open an inplace editor cabarets N a E RE 17 Assignments Expression Type Description score_total Integer Use the total score for further calculation total g Operation e NR A o String String LS I 2 Enter the data element that you want to assign to This can be just the name of a data element but also a more complex expression GR customer address 3 city 3 Press Enter to close the inplace editor or click with the mouse outside of the inplace editor Bosch Software Innovations GmbH 112 270 Chapter 4 Tasks 4 Ifyou want to change the default operation of the assignment double click it and choose the new opera tion from the drop down list 5 Double click the right side of the assignment This will open an inplace editor 6
347. tOutput false true weekend_surcharge_a False You can also use the Compare Results Dialog to compare the expected and actual result This dialog is es pecially useful when comparing large strings since it highlights the spots where the differences are In order to open the Compare Results Dialog select one of the outputs and click on the Compare expected with ac tual result button In this dialog you can also copy the actual result to the expected result lt Addi tionally you can navigate through the individual deviations with the navigation buttons 4 gt 23 amp i and copy these to the expected result zl Com ipare Results Dialog Jae 4 48 2 Gl Expected Result Actual Result i Wisual Rules is an especially intuitive Visual Rules is an especially intuitive and high performance Business Rules and high performance Business Rules Management system BRMS for developing k Management sstem BRMS for developing business rules a3 part of agile software El business rules a3 part of agile software Business logic is modeled graphical ly tested H Eusiness logic is modeled g qraphicaly teste and automatically translated into Java and automatically translated into Java programs programs 4 11 22 Creating and Configuring Statistics 1 Before you start configuring your rule statistics in the test editor make sure that the rule code generator set tings enabled rule statistics Y
348. tate flow you wish to rename and select Rename from the context menu Alternatively press the F2 key A dialog will open where you can enter the new name You must enter a name that is different from any other state flow or rule package on the same level New Name Update references Bosch Software Innovations GmbH 100 270 Chapter 4 Tasks 3 Click on OK to perform the rename Related Concepts e Section 3 9 State Flow 52 4 2 17 Copying a State Flow 1 Copying a state flow is done with drag amp drop Select the state flow you want to copy click on it and hold down the left mouse button 2 Drag the rule to the location you want to copy it to Press and hold the Ctrl key to create a copy 3 Let go of the mouse button to paste the copy If the Ctrl key is not held down when you release the mouse button the state flow is not copied to the new location but moved Related Concepts e Section 3 9 State Flow 52 Related Tasks e Section 4 2 18 Moving a State Flow 101 4 2 18 Moving a State Flow 1 Moving a state flow from one rule package into another rule package is done with drag amp drop Select the state flow you want to move click it and hold down the left mouse button 2 Drag the state flow to the location you want to move it to 3 Let go of the mouse button to move the state flow If you want to create a copy of the state flow press and hold the Ctrl key when you release t
349. tation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited Bosch Software Innovations GmbH 256 270 Chapter 5 Reference Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available Description The description for this row You can edit cells in this column by double clicking them 5 6 8 2 Type Alias Tab This tab is shown when an alias is selected in the Rule Explorer op x e e RR Type Alias Advanced Primitive Type w Gi Figure 5 73 Type Alias tab C Enter the name of the alias Primitive Type Enter the name of the primitive type the alias is for 5 6 8 3 Attributes Tab This tab is shown when an enumeration exception or structure type is selected in the Rule Explorer Attributes Advanced H Attribute Default Yale Type Multiple Implementation Description E CG Appointment amp date _of_appointment Date No description String No Initially all elements are collapsed This button will expand them so that all elements are visible This only has an effect if there is at least one element available Bosch Software Innovations GmbH 257 270 Chapter 5 Reference a E eg Inserts another element to an attribute that is a collection list or set Thi
350. te 2 Inthe Properties view activate the Notes tab 3 Click on the button next to the note you want to delete Related Concepts e Section 3 15 Description and Note 78 Related References e Section 5 6 1 2 Notes Tab 230 4 5 13 Undoing Changes You can undo individual operations by selecting Edit gt Undo Operation from the menu The last operation you carried out is shown in place of Operation Alternatively press the Ctrl Z key combination to undo the last opera tion performed To redo undone operations select Edit gt Redo Operation from the menu You can also use the Ctrl Y key com bination Related References e Section 5 8 Hotkeys 269 4 6 Working with Data The following sections contain step by step procedures for different tasks with data elements Related Concepts e Section 3 13 Data 67 e Section 3 13 2 Input Output Data 69 e Section 3 13 3 Internal Data 69 e Section 3 13 4 Constant Data 70 4 6 1 Defining Input Output Data Elements With respect to a transition rule in a state flow only input data elements can be defined To add an input output data element to a rule you can simply use the Rule Context palette in the flow rule editor 1 Click on the button in the Input Output Data section to add a data element 2 Specify the new element in the dialog that appears Bosch Software Innovations GmbH 140 270 Chap
351. ter 4 Tasks 3 Press Finish In order to add an input output data element to a rule a rule package or a rule model in the Rule Explorer do the following 1 Select the rule rule package or rule model in the Rule Explorer where you want to define input output data 2 Inthe Properties view activate the Input Output Data tab 3 Click on the button to add a data element It is possible to configure input ouput data elements as input data element output data element or as input and output data element 1 Double click the input output data element to open its Properties 2 Configure the type of data element in the column Input Output e Select in out for an input and output data element e Select in for an input data element e Select out for an output data element To configure an input output data element as required do the following 1 Double click the input output data element to open its Properties 2 Configure the data element as required in the Required column Select Yes for required and No for not re quired data element Alternatively you can use the context menu of the Properties view to add an input output data element to a rule that contains the possible operations Show All Values w 3 Sorter E Add Group Remove Related Concepts e Section 3 13 2 Input Output Data 69 4 6 2 Defining Internal Data Elements To add an internal data element to a rule you can simply use the Rule Context pa
352. ter confirmation a new element can be used like any other manually created element Le Rule Explorer emmen EE E EA A A a A E Le Movie Ticket Pricin EE Movie Ticket Pricing ER Input Output Data i pet Constant Data Hg Actions S Discounts GG 8 Pricing ER Internal Data fee weekend surcharge ER Rule Tests 9 If you access an attribute of an undefined data element in an expression the structure can be created too See this example ustomer age gt younger than 18 ei Expression 10 By default a structure customer with the attribute age is created as well as an internal data element customer of type customer It s still possible to change the name of the new type customer to another name like a data structure that already exists Automatic Element Creation Automatic Element Creation Visual Rules can assist you in creating new model elements Configure Data Element E Movie Ticket Pricing E 78 Pricing E K Internal Data customer Customer nO Data Types customer E E Attributes age Integer _ Create ei Don t Create Auto creation also works for actions services flow rules and decision tables Insert the name of the new item in the rule element that calls it and confirm the Automatic Element Creation dialog with Create You can select the kind of elements that you want to be created automatically Window gt Prefer ences gt Visual Rules gt Auto Crea
353. ternal data folder Please be aware that the properties of different element types can vary When moving between item types information may be lost If you move data elements under another rule rule package or model please note that the visibility of this element changes depending on the target location For example If you move it in the package hierarchy up the date element will be visible for all rules under the new location If you move it in the package hierarchy down maybe under another rule the data element will maybe not be available for rules in which you already used it In this case new error markers will ap pear at the rule elements in which you use the moved data element Related Concepts e Section 3 13 Data 67 Bosch Software Innovations GmbH 146 270 Chapter 4 Tasks 4 6 11 Sorting Data Elements Manually Data elements are per default displayed in alphabetical order in the Rule Explorer Project Explorer rule editor palette and rule test editor You can individually turn off the automatic sorting 2 and manually determine the or der of data elements The following steps use input output data elements as an example but can be applied to other elements as well including attributes of structures 1 Inthe Rule Explorer or Project Explorer select the rule rule package or rule model whose data elements you want to sort 2 Inthe Properties view go to the Input Output Data tab or any other
354. the appearance as well as the capabilities of the flow rule editor via the View H dropdown toolbar button w S Descriptions w Contents w C Motes w El Tooltips vw L Empty Descriptions Content w CallfAssignment Details w Hover Palette Alternatively you can also right click in the flow rule editor and select the according entries from the View context menu The following table shows the individual options Bosch Software Innovations GmbH 105 270 Chapter 4 Tasks Table 4 1 Individual options for configuring the appearance and capabilities of the flow rule editor ze mn J Tooltips Show hide tooltips for rule elements Empty Descriptions Content Show hide empty descriptions or content of rule ele ments 3 Call Assignment Details Show hide details for call and assignment elements F Hover Palette Enable disable hover palette You can also modify the maximum height and width of rule elements This can be done via the increase and de crease buttons in the toolbar These settings are also available in the Preferences Visual Rules gt Flow Rule Editor If your rule elements are rather small already don t contain large descriptions they may be far away from the maximum width and height settings and you may need to click the red decrease buttons several times in order to see an effect 4 3 5 Extracting a branch of a Flow Rule as a new Flow Rule You can extract a branch of a flow r
355. the condition is false If the con dition is false right from the beginning the Repeat is not executed at all The condition should be formulated with care in order to prevent situations where the condition is always true In that case the rule would remain in an endless loop Repeat 14 EEE Repeat Description Repeat foreach of multiple elements while a condition holds with counter Condition Repeat with counter This kind of Repeat uses a counter that starts with a given start value Start and is incremented each time by a given step value Step until it reaches or passes the given end value End The current value of the counter is stored in the data element specified in the Counter field Repeat 14 Repeat Description Repeat foreach of multiple elements while a condition holds with counter Counter count 8 I 8 Related Tasks Bosch Software Innovations GmbH 41 270 Chapter 3 Concepts e Section 4 3 13 Editing a Repeat Element 115 Related Reference e Section 5 6 2 8 Repeat Tab 237 3 5 9 End Repeat The End Repeat element is used in cases when the rule has decided that it can end an ongoing Repeat prema turely e g when the Repeat was used to search data and the matching data was found so the rest of the data doesn t have to be looked at The End Repeat element must be placed somewhere within the branch attached to the Repeat element It w
356. the file contains input data that does not fit to the rule it will still be visible in the test case but error markers will have been created for it 4 11 8 Entering Test Data On the Input section of the test editor you can now enter your data for every single input defined for the rule For this double click on the value field for the data element you want to edit Movie Ticket Pricing Input Outpu BB a x ER e 0 Input Data Value utp E auditorium no Integer 1 amp E coupon Boolean False GG seat_no Integer 201 Ge show date Date 2007 09 2354 E student Boolean false a Related Tasks e Section 4 11 9 Copying and pasting values 164 4 11 9 Copying and pasting values In many places in the user interface values of data elements displayed in cells can be copied and pasted to cells of corresponding type The copied value can have a complex structure consisting of many attribute and list values Bosch Software Innovations GmbH 164 270 Chapter 4 Tasks Because all values are copied with a single click this can significantly reduce the amount of work especially for editing test data In order to copy a value from one cell to another perform the following steps 1 Select the cell containing the value to copy 2 Press ctri c or select the Copy Value command from the context menu E ES customer Customer E address Adress zip String city String name String W Delete
357. the new rule model has the same name as the rule project 2 2 2 Task 2 Create a New Flow Rule 1 Right click on the rule model included in the new rule project EK Tutorial First Rule Ge Soak Tutorial First Rule 2 Select New Element gt Flow Rule from the context menu 3 The New Flow Rule wizard appears gt New Flow Rule How Rule Create a new Flow rule Rule model Tutorial First Rule Tutorial First Rule vrmodel nie pat T Flow rule name EU Rent 4 Enter the Flow rule name ev Rent 5 Press Finish to create the new rule The new flow rule will open automatically in the flow rule editor Bosch Software Innovations GmbH 7 270 Chapter 2 Getting Started 2 2 3 Task 3 Draft Your First Flow Rule In this task you will draft the rule logic The graphical elements representing the logic will be created and descrip tions will be added to them For drafting the rules in the first step switch off the display of the rule element contents so that just the descrip tions are shown In order to do this open the drop down of the View H toolbar button then deselect Hide Show Contents A a ol ee ow D Descriptions EF Contents w L Notes w E Tooltips vw C Empty Descriptions Content F Hover Palette Now just the descriptions of the rule elements are shown 2 2 3 1 Describing the Rule Insert a description for your flow rule by double clicking on the description field to e
358. tically insert data elements with matching names and types to assign the outputs to Only outputs not yet assigned will be affected SCH En E Properties 63 m SE EE E a Fe Call How Rule 5 i Call Flow Rule Description Call Flow Rule Customer Rating om Motes z l Advanced Input Data Value Output Data Assign To E cuskomerId Integer 5 fea customerRating Integer customerRating Related Concepts e Section 3 5 4 Call Flow Rule 38 e Section 3 4 Flow Rule 29 Related Tasks e Section 4 10 1 Using the Code Assist 157 e Section 4 11 9 Copying and pasting values 164 Related References e Section 5 6 2 5 Call Flow Rule 234 4 3 16 Editing a Call Decision Table Element In order to edit a Call Decision element open its Properties and select the Call Decision Table tab and do the fol lowing 1 Select in the field Call Decision Table the decision table that should be called You can call decision tables from the same package or from any package that is defined to be reused Press Ctrl Space for content assist or click on to choose the decision table from a list of available decision tables 2 The required input data elements of the called decision table are displayed in the Input Data area You have to specify values for at least the required inputs Bosch Software Innovations GmbH 116 270 Chapter 4
359. tion Related Concepts e Section 3 21 Auto Creation 82 Related References e Section 5 4 3 Auto Creation Dialog 218 e Section 5 7 3 Auto Creation Preferences 264 4 11 Testing Rules The following sections contain step by step procedures for different tasks you may want to perform with rule tests like the creation of a rule test or the adding of test data Related Concepts Bosch Software Innovations GmbH 160 270 Chapter 4 Tasks e Section 3 22 Rule Testing 82 4 11 1 Creating a Rule Test 1 The fastest way to create a test for a flow rule or a decision table is to use the Rule Context palette By click ing the in the Rule Tests section the following dialog appears New Rule Test Rule Test Create a new rule kest Rule Rule Project 1 Resource 1 Package Flow Rule 1 yvrrule Test mame SOOT d Alternatively you can use also right click on a rule and select New Element gt Rule Test to create a new rule test 2 After specifying a name for the new rule test click on Finish 3 Now the test editor appears and you are ready to add new test cases 8 Pricing es Discounts H Pricing Test et Test for Pricing in Movie Ticket Pricing E B g gt Description Test Cases Input Output d GN A At 3 x Dae te 2x ae O uR Si Ort Input Data Output Data Expected Result Actual Result gt Test Case Description E auditorium_no
360. tion 3 13 Data 67 4 6 10 Moving Data Elements If you would like to move a data elements in the Rule Explorer you have two options Option 1 To move the element via drag amp drop do the following 1 Use the left mouse button to click once on the element to be moved 2 Keep the mouse button held down and move the mouse to the target 3 Now let go of the mouse button The element is moved into the target BS Option 2 To move the element using the keyboard do the following If the item can t be moved to a specific location this is indicated by the icon 1 Right mouse click on the element to be moved and select Cut from the contextual menu that appears Alterna tively you can select the data element and use the Ctrl X key combination 2 Right mouse click on the target you want to move the element into and select Paste from the contextual menu that appears Alternatively you can also select the target and use the Ctrl V key combination 3 The cut element is pasted When moving you can also copy and paste multiple elements at the same time To do this simply select all the da ta elements you want Keep the Ctrl key held down to select multiple data elements Then carry out the procedure above When moving data elements you can also switch between different data element types It is thus possible for ex ample to make a internal data from a input output data by moving the input output data element into the in
361. tion 5 6 8 6 Super Types Tab 260 Bosch Software Innovations GmbH 75 270 Chapter 3 Concepts 3 14 5 Enumeration An enumeration is a user defined data type that explicitely lists all possible values it can have These possible val ues are called literals Example 3 29 Enumeration color color E CES Literals Zo BLUE E GREEN Ba RED Zo YELLOW An enumeration color defines the possible values literals BLUE GREEN RED and veLLow A data element of type Color can thus only have one of these values The value is referred to by specifying the enumeration name fol lowed by a dot and the literal name e g color BLUE Thus a data element color of type color can be assigned the color blue like this color Color BLUE Related Tasks e Section 4 7 Working with Data Types 150 Related References e Section 5 6 8 5 Literals Tab 260 3 14 6 Exception An exception is a user defined data type Exceptions are used for Visual Rules exception handling capabilities particularly the Return Exception and Handle Exception rule elements As such it should be considered a rather technical concept and its use possibly be restricted to more technical rules An exception is a special kind of structure Its attributes are used to hold information about the exceptional situa tion that occurred during rule execution Related Concepts e Section 3 14 3 Structure 74 e Section 3 5 10 Retu
362. tion and Configuration with settings for the rule execution The rule test editor shows the test description at the top On the left side there is a list of all test cases and on the right side there are two sections that display the input and output data for each test case Rule Test Test Rule Test Definition of Editor Description Case Test Data Definition of Reference Data fal First Rule EU Rent EU parit lea erteet Visual Roles Model IL Rule i Result Trst Ciara EKI O Hi b Test Case Deesoipbon gz i b Get Test Data Test Configuration L e D Oo F Rule Configuration Test for Rule Execution Bosch Software Innovations GmbH 18 270 Chapter 2 Getting Started This section provides step by step instructions for executing and testing a rule For this tutorial you need to have the flow rule modeled in tutorial 1 This will be the rule you test here This tutorial continues exactly at the point where tutorial 1 stopped When you finished this tutorial you will have defined test data and expected results for a rule executed the rule and understood how to analyze the results In this tutorial you perform the following tasks e Create a rule test e Define input data for the test case e Define expected results for the test case e Specify a second test
363. tions Bosch Software Innovations GmbH 230 270 Chapter 5 Reference reed E f Decision 1 Decision Overview Decision Details EE 7 Description Condition Descrinti i Shoda lt gt Day of week weekDay show_ date Note weekend in 6 7 Allow multiple matches not just the First one Figure 5 41 Decision Overview tab eon eso se Adds another condition Removes the currently selected condition including all rule elements that may be at tached to it Description This column shows the description of the decision You can edit cells in this column by double clicking them Condition This column shows the condition under which this condition branch is executed The first row shows the condition prefix You can edit cells in this column by double clicking them om Sen Allow multiple When unchecked only the branch of the first condition which evaluates to true is execut matches not just ed the first one When checked the decision will evaluate all conditions and execute the branches of all conditions which evaluate to true Related References e Section 5 6 2 2 Decision Details Tab 231 5 6 2 2 Decision Details Tab This tab is shown when a decision is selected in the rule editor It shows a list of all the different conditions with the condition prefix in the first line To the right
364. to Code Assist Ctrl Space is available Enter an expression that specifies the collection of elements whose elements will be as signed to the data element specified above Every time the Repeat executes the next data element is assigned to the data element specified in the Assign each element to field If the number of data elements is zero the Repeat is not executed at all Code As sist Ctrl Space is available Repeat _ Description Repeat foreach of multiple elements while a condition holds with counter Notes Condition PandledCustomers lt 1000 Figure 5 49 Repeat tab condition C Condition Enter an expression for the condition Execution repeats as long as the specified condi tion is true and ends when the condition is false If the condition is false right from the be ginning the Repeat is not executed at all Code Assist Ctrl Space is available Bosch Software Innovations GmbH 238 270 Chapter 5 Reference Description Repeat for each of multiple elements C while a condition holds with counter Motes Counter iT Figure 5 50 Repeat tab counter es Counter Enter an expression that specifies a data element for the counter The current value of the counter will be stored in the data element specified here The counter starts with a given start value Start and is incremented each time by a given step value Step until it reaches or passes the given
365. tpukt Data i Internal Data he Pricing rule determines the price for a movie ticket on the basis of parameters entered The Following simple rules are taken EE nto account when doing so Actions The movie theater has three auditoriums of different sizes and different distributions of general and special seating The base price For a movie is dependent on the size of the movie auditorium and seating location general or special seating Se A weekend surcharge is calculated For the two large movie auditoriums on weekends Description The small movie auditorium has a constant admission price and no difference between general and special seating Notes o At the end sub rules a flow rule and a decision table are called to calculate discounts and bonus points gained Advanced Figure 5 39 Description tab 5 6 1 2 Notes Tab This tab is used to view and edit the notes attached to the currently selected element Notes can contain hyper links to reference external content Every note is listed along with the information who created it and when temaba om i Advanced Adds another note Removes the corresponding note 5 6 2 Rule Elements The following properties tabs are available when rule elements in the rule editor are selected 5 6 2 1 Decision Overview Tab This tab is shown when a decision is selected in the rule editor It shows the descriptions and expressions for the decision and for all its condi
366. tware Updates menu entry to update the current version of Visual Rules Bosch Software Innovations GmbH 193 270 Chapter 4 Tasks Hel Welcome F Help Contents TP Search Dynamic Help key Assist Ckrl ShiFt L Tips and Tricks Cheat Sheets visual Rules License Management H Visual Rules Support Request Software Updates About visual Rules Modeler 2 Select from Installed Software the preference page by clicking on Automatic Update at the bottom for configuring an automatic notification for updates Otherwise continue with clicking on Update Software Updates and Add ons Installed Software ayailable Software Mame Wot Apache Commons Codec Feature Wht Apache Derby Core Feature i Data Tools Platform Connectivity Wh Data Tools Platform Connectivity Documenta Wh Data Tools Platform Enablement li Data Tools Platform Enablement For Apache l Data Tools Platform Enablement For HSOLDB li Data Tools Platform Enablement For IBM l Data Tools Platform Enablement For JOBC li Data Tools Platform Enablement For Microsoft ct Data Tools Platform Enablement For MOL l Data Tools Platform Enablement For ODA De li Data Tools Platform Enablement For ODA Ru l Data Tools Platform Enablement For Oracle Wit Data Tools Platform Enablement For Postgre Wik Data Tools Platform Enablement For SAF Ma l Data Tools Platform Enablement For Sybase li Data Tools
367. tween projects and artifacts are expressed via Group Id Artifact Id and Version Specify these identifiers For this project here Other projects can then reference this project using the Group Id Artifact Id and Version Group ld movie tickek pricing Artifact Id Movie Ticket Pricing Version 1 0 Required Dependencies Dependency Details Specify all other projects or artifacts required by this project ppecify the identifiers of the selected dependency 0 visualules runtime 4 5 0 SN4PSHOT Group Id Figure 5 18 Rule Project Editor Rule Project Description Editor element eo Opens the Dialog Select Dependency to add a dependency to the current rule project s Removes the selected dependency from the rule project Related Concepts e Section 3 1 Rule Project 25 Related Tasks e Section 4 1 2 Setting Rule Project Identifiers Group Id Artifact Id Version 89 Bosch Software Innovations GmbH 214 270 Chapter 5 Reference e Section 4 1 3 Defining Rule Project Dependencies 90 Related References e Section 5 4 7 Select Dependency Dialog 221 5 3 7 Dependency Diagram Editor The Dependency Diagram Editor is used to analyze dependencies within a rule project These can be the follow ing kinds of dependencies e Rule Package reuses e Rule calls e Enclosure of elements e Testing and Test calls les Dependency maiii Incoming Incoming tall O Outgoing Outgo
368. uestion mark gt to represent exactly one character e g category will match all tests whose name starts with the word category preceded by exactly one character The same dialog is used for finding test suites Switching between finding test suites and finding tests is done by clicking the test suite icon or the rule test icon in the dialog s action bar Open Test Select tests PO My E e BonusPoints Test Movie Ticket Pricing Bonus Points gt Bonuspunkte Test g gt Convert Fahrenheit to Celsius Test gt Customer Scoring Test rd DisplayCustomerData Test Evaluate Path Test bah Service Evaluate Path e InitializeDatabase Test e InsertOrders Test g gt Preisberechnung Test rd Pricing Test 8 ixPath Service Evaluate Path 4 11 4 Copying a Test You can copy a test from one rule into another If so the latter will be subject to the copy 1 Copying atest is done with drag amp drop Select the test you want to copy click on it and hold down the left mouse button 2 Drag the test to the rule you want to be tested Press and hold the Ctrl key to create a copy 3 Let go of the mouse button to paste the copy If the Ctrl key is not held down when you release the mouse button the test is not copied to the new rule but moved Related Concepts e Section 3 22 1 Rule Test 83 Related Tasks e Section 4 11 5 Moving a Test from one Rule to another 163 Bosch Software Innovatio
369. ule as a new flow rule Instead of executing the respective branch the original flow rule will call the newly created flow rule such that the overall behavior remains unchanged This way you can split a large flow rule into pieces The new flow rule is automatically added all necessary elements like data elements actions etc Only if the new flow rule is placed in a different rule project the file ruleproject vr might need to be adapted 1 Right click on the first element of the branch A context menu will appear 2 Select the Extract Branch as New Flow Rule entry from the context menu 3 The Extract Flow Rule wizard appears Bosch Software Innovations GmbH 106 270 Chapter 4 Tasks Extract flow rule Extract flow rule Extracts selected Flow rule branch as new Flow rule Rule model Rule Project Rule Model vrmodel isunen LO ek Show new rule in rule editor lt Back Next gt Finish 4 Select the rule model and rule package where the new flow rule should be located You can click on the corre sponding Browse buttons to select the rule model and rule package from a list 5 Enter a name for the new flow rule 6 Click on Next gt to get a list of all the upcoming changes that the extraction will cause You can also uncheck only some of the changes that you don t want to make while leaving others checked Click on Cancel if you don t want to make the changes 7 Press Finish to create the new flow ru
370. ule or rule package in the rule package selected above Use a template Check this to create the new flow rule from a template Enter the template name use code assist Ctrl Space or click Browse to list the available templates 5 2 4 New State Flow Wizard Use this wizard to create a new state flow in an existing rule model or rule package New State Flow V State How Creates a mew skate Flow Rule model ShateFlow OrderProcess Rule package Package State flow name State Flow 1 Figure 5 7 New State Flow wizard Bosch Software Innovations GmbH 202 270 Chapter 5 Reference C Rule model Enter the rule model you want the state flow to be added to Click Browse to list all avail able rule models Rule package Enter the path of the rule package within that rule model you want the state flow to be added to Click Browse to list all available rule packages If this is left empty the state flow will be created in the top level rule package the rule model itself State flow name The name of the new state flow to be created This must be different from any other state flow or rule package in the rule package selected above 5 2 5 New Service Wizard Use this wizard to create a new service in an existing rule model New Service New Service Create a new Service Be VI Servicetyp Standard Description Standard Service Type Figure 5 8 New Service wizard Service name The name
371. unt_oranted G weekend surcharge added It is also displayed in the Rule Context of all rules in which it is available Related Concepts e Section 3 16 Action 79 e Section 3 5 3 Fire Action 37 e Section 3 17 Action Type 80 Related Tasks e Section 4 8 2 Specify an Action Type for an Action 155 e Section 4 3 12 Editing a Fire Action Element 114 4 8 2 Specify an Action Type for an Action In order to specify an action type for an action do the following 1 Select an action in the Rule Context or in the Rule Explorer 2 Open the Properties by double clicking it and navigate to the Action Settings tab 3 An action is per default created with Standard action type If you want to use another action type use the button of the Type field and choose an action type from the list Select Actiontype ell E Action type He T Log message T Output message T Send e mail Standard G Write Ca File 4 The view of the Action Settings tab will change its view depending on the choosen action type 5 Insert the action type specific settings for the action Related Concepts e Section 3 16 Action 79 e Section 3 5 3 Fire Action 37 e Section 3 17 Action Type 80 Related Tasks e Section 4 3 12 Editing a Fire Action Element 114 e Section 4 8 1 Defining Actions 154 Bosch Software Innovations GmbH 155 270 Chapter 4 Tas
372. unts vrrule statement 8 Movie Ticket Pricing Movie Ticke The operator is not defined For the types Integer String Discounts vrrule statement 4 Movie Ticket Pricing Movie Ticke Figure 5 31 Problems view The Problems view is not specific to Visual Rules but part of the Eclipse platform underlying Visual Rules You can find more information in the Workbench User Guide part of the documentation for the Eclipse platform 5 5 4 Outline View The Outline view displays a compact representation of the rule being edited A blue box is drawn around the cur rently visible part of the rule You can use the mouse to move this box around The rule editor will scroll its viewport accordingly Figure 5 32 Outline view Related Concepts e Section 3 6 Flow Rule Editor 45 Related Tasks e Section 4 3 3 Navigating in the Flow Rule Editor 104 5 5 5 Search View The Search view displays search results and is automatically opened whenever the user performs a search Dou ble click on an entry to navigate to the location where the search found that match Bosch Software Innovations GmbH 225 270 Chapter 5 Reference fens oo xe DEY Ey ee o Te Movie Sia Pricing CR ws Discounts s eg 1 off Sp price SS price coupon_discount oe 7 2 off at Pricing re Audit Wo 1 General 5 fll Audit Mo 1 Special 7 Ee Weekend surcharge Ml Audit No 2 Special 6 SF audit No 2 Genera
373. upon the result deliver the result as true OF false age gt 10 age lt 65 age 18 name lt gt Peter Anton lt Beatrice 10 lt 12 true Checks for equality or inequality lt gt can be done with any data type Relative comparisons like less than lt greater than gt less or equal than lt or greater or equal than gt can be done with Float Integer String Date Time and Timestamp values Visual Rules uses simple lexicographical ordering for strings 3 12 5 Logical Operators AND OR NOT The anp operator corresponds to a logical AND operator It compares two Boolean values and returns true if both Boolean values are true Bosch Software Innovations GmbH 57 270 Chapter 3 Concepts AND true true AND false false AND true false AND false false 10 AND age lt 18 The or operator corresponds to a logical OR operator It compares two Boolean values If at least one of these Boolean values is true the OR operator returns true true true false true true true false false OR age gt 65 The not operator reverses a logical value NOT true false NOT false true age gt 18 AND NOT age gt 65 3 12 6 BETWEEN Operator The Between operator is used to determine if a value belongs to an interval BETWEEN BETWEEN BETWEEN BETWEEN Interval limits are put in square brackets A closed interval brackets turned inside indicat
374. urned Figure 5 10 Rule Editor palette This is the default tool Use this to select move and copy rule elements descriptions contents and notes Double click on rule elements descriptions contents or notes to edit them This is the zoom tool Click to zoom in Press Shift and click to Zoom out Draw a rectan gle to zoom the enclosed area Click on a rule element to add another note to this element Describe Branch Click on a rule element to add a description to the branch rooted at that element This does not work for the start element and for conditions within a decision element Decide Insert a new Decision element or a new condition within an existing decision element Bosch Software Innovations GmbH 205 270 Chapter 5 Reference Insert a new Assignment element or a new assignment within an existing assignment ele ment Set Transition Tar Set a target state for a transition rule get This element is available only for transition rules in state flows Insert a new Fire Action element Call Flow Rule Insert a new Call Flow Rule element Handle Exception Click on a rule element to add a Handle Exception element to the branch rooted at that element This does not work for the start element and for conditions within a decision ele ment Call Decision Table Insert a new Call Decision Table element Call Service Insert a new Call Service element 5 3 1 2 Rule Context Palette The rule context pa
375. us if the first collection contains an element 7 times and the second collections contains this element 3 times then the result will contain that element 4 times Example 3 11 Difference of collections collectionl collection2 stringList someString The intersect operator is used to determine the intersection of two collections The result is a set that contains on ly those elements that are in both collections Example 3 12 Intersection of two sets setl INTERSECT set2 intersection setl INTERSECT set2 INTERSECT set3 Related Concepts e Section 3 14 7 Collection 76 3 12 15 Collection Functions There are special functions for collections available that can be used to easily sort search convert or filter the ele ments of collections The first and second parameters of these functions are delimited by a colon instead of a com ma The second parameter is a special expression because it is evaluated for each element of the collection and provides the values for sorting filtering or else Within these expressions it is possible to use the word tuts to re fer to the element from the collection currently evaluated However the word ruts can be left out when accessing attributes unless it is needed to resolve ambiguity The following table lists all collection functions which are illustrated by examples further below Bosch Software Innovations GmbH 61 270 Chapter 3 Concepts Table 3 3 Collection
376. uting the rule with some input da ta inspecting the results the rule has produced and by verifying that these results correspond with the expected results One such execution is called a test case A rule test can consist of any number of test cases And there can be multiple tests for the same rule too Rule tests are defined edited and executed with the rule test editor The flow rule and decision table editors list the tests of a rule on their Rule Context palettes Related Concepts e Section 3 22 2 Rule Test Editor 83 e Section 3 6 Flow Rule Editor 45 e Section 3 8 Decision Table Editor 50 e Section 3 22 4 Test Suite 86 3 22 2 Rule Test Editor The rule test editor is used to define and edit rule tests It consists of two tabs named Test Cases and Configuration The first tab shows the test description and on the left side there is a list of all the test cases On the right side there are two sections that display the input and output data for each test case The output data section also contains a column where expected results can be entered Pricing Test 2 S 5 eh Test for Pricing in Movie Ticket Pricing E DR EN Il E gt Description Test Cases Input Output LCE Es EIERE si eQ zz sam Input Data G ss CECR v Test Case Description E audtorium no Integer E bonus_card BONUS_CARD Sangeet 1 special seating no weekend onus card SILVER
377. vanced H Name InpukiGutput Required Default value Type Multiple Implementation Description 1 J E 8 CustomerRating E customerld in YES Integer No fa customerRating out No Integer No cht ay customers in Tes Customer List Yes The rule editor displays descriptions right next to every rule element Notes are displayed to the right of the rule and connected to the corresponding rule element with a line Related Reference e Section 5 6 1 1 Description Tab 229 e Section 5 6 1 2 Notes Tab 230 e Section 3 3 Rule Package 26 3 16 Action Actions represent the consequences of rules When a rule is executed it can fire actions as a consequence to de cisions or computations The Fire Action rule element is used to do this Actions can be defined on the rule level so only that rule can fire that action But actions can also be defined on the rule package or rule model level In that case they are shared by all rules in that package or rule model re spectively Actions are identified by their names Accordingly the Fire Action rule element specifies an action name to indicate which action should be fired The value of the action is set to true whenever this happens Within expressions it is possible to refer to that boolean value simply by using the action name A rule calling another rule using the Call Flow Rule or Call Decision Table elements can look at the values of all the actions
378. vidual rule ele Rule Elements ments Overwrite existing Check to automatically overwrite existing documentation files in the target directory Oth documentation erwise you will get a warning message Open generated Check to automatically open the documentation once generation is finished documentation 5 3 Editors The following sections describe the editors for rules state flows tests projects and dependencies between these 5 3 1 Flow Rule Editor The flow rule editor is used to view and edit flow rules 5 3 1 1 Flow Rule Editor Palette The flow rule editor palette contains all available rule elements that can be added to the rule Additionally it con tains tools for selection zoom notes and branch descriptions K Select G Zoom CA Add Note 4dd a note Fa Describe Branch Add a description to a whole branch gt Decide Make a decision Assign Calculate values and update data S Set Transition Target Set a Target State ki Fire Action Fire an action Fa Call Flow Rule Call another Flow rule Call Decision Table Call a decision table E4 Call Service Call a service Zei Done amp Return Immediately return to the calling rule Repeat Repeat the following part of the Flow 45 End Repeat Immediately exit a Repeat ES Return Exception Create an exception message and continue where exceptions are handled E Handle Exception Specify what to do When an exception message is ret
379. vie wrpackag eh Ge RE separa age De eth in ha ots een Bee fama SE G Structural differences E b 3 changes overall ae 3 changes in Rule Package Movie Night ba t Attribute name in Rule Package Movie Night has changed From Movie Might to Long Movie z Ba Input Output Data movie length has been added BS Input Output Data student has been added Z a eae ai pol E gt Movie Ticket Pricing Movie Ticket Pricing Long Movie vrpackage Movie Ticket Pricing Movie Ticket Pricing Movie Night vrpackage E E Long Movie E SR Movie Might ae InputfOutouk Data ER Input fOutout Data i E auditorium no Integer i E auditorium no Integer coupon Boolean h coupon Boolean E e seat_no Integer seat np Integer i show date Any Se show _date Any G student Boolean student Boolean 8 Discount Movie Might CS student Boolean 8 Discount Long Movie 4 16 2 Comparing Rules There are two possibilities to compare rule models or rule packages Compare With History In order to compare a rule with its history do the following 1 Select the rule you want to compare with its history 2 Right click and select Compare With gt History from the context menu 3 A History view opens that shows the changes along with the date and time of change 4 Double click on an entry in the history 5 The Compare view opens showing the differences between your current ve
380. view Pr PY em Insert the exception specific Return Exception settings In order to specify in which cases the exception should occur or not do the following e Double click on a cell in the exception column or press the Space key This will toggle between a small cross x and a dash The exception will be returned for those cells that contain a cross BETWEEN 1 200 SeneralException SeneralException GeneralException So Is J Ja je CE j J Ji Je eee o EE EE eee eee eee Related Concepts e Section 3 7 4 Exception Column 50 Related Tasks e Section 4 4 14 Adding a new Exception Column 132 e Section 4 4 16 Rearranging Assignment Action Exception Columns 133 4 4 16 Rearranging Assignment Action Exception Columns In order to change the order of assignment action and exception columns do the following 1 Select the column header of the column that should be moved and drag it 2 Now move the mouse over an existing decision table element header A black arrow will appear to show you where the moved element will be inserted This can be either after an existing decision or beside an assign ment action or exception Accordingly the black arrow will point to the left or to the right Move the mouse un til the arrow points into the direction you want BETWEEN 1 200 adonna piore pi bonus pints seating special_seating special_seating S A stop icon indicate
381. ving Changes in Rule Models Whenever a rule model or a part of a rule model is changed these changes need to be saved at some point The Rule Explorer indicates unsaved changes by an asterisk in front of the changed element and all the elements higher up in the rule package hierarchy ER Movie Ticket Pricing Fer Input Output Data Es Constant Data ER Actions oe S Discounts Figure 4 1 Unsaved changes in a rule model 1 Select an element with unsaved changes in the Rule Explorer The Save button El in the toolbar will acti vate Click on the Save button in the toolbar Alternatively you can press Ctrl S or use the File gt Save menu item 3 The changes will be saved and the asterisk s will disappear Visual Rules always saves all changes made in the selected element and in any element further down in the package hierarchy So if you save a rule package it will also save all changes made in sub packages or rules contained therein So in order to save all changes in a rule model simply se lect the rule model and save If you want to save all changes in all rule models you can press Ctrl Shift S or use the File gt Save All menu item Related References e Section 5 5 2 Project Explorer View 223 4 2 4 Creating a new Rule Package 1 Right click on a rule model or on a rule package in the Rule Explorer where you want to create the new rule package A context menu will appear 2 Select th
382. vision by zero the customer rating is set to a default of 1 Calculate customer rating If something goes wrong set the rating to a default of 1 Every exception is handled by only one Handle Exception element the most recent one Once an exception is handled execution continues normally after the branch with the Handle Exception element The Handle Exception element can specify a data element to hold the exception that occurred This way the Han de Exception branch can inspect the exception and its attributes This is especially useful if you want to do differ ent things depending e g on the exception type If this field remains empty all exceptions are catched but a fur ther estimation evaluation is not possible If a data element is specified only those exceptions are handled that match the type of that data element i e they must be of the same type or any subtype Exceptions of other types will remain unhandled by this Handle Excep tion element It is possible to have a Return Exception element as part of the exception handling on the red background This again will generate an exception message that can be handled by another Handle Exception element Related Concepts e Section 3 14 6 Exception 76 Related Tasks e Section 4 3 19 Editing a Handle Exception Element 119 Bosch Software Innovations GmbH 43 270 Chapter 3 Concepts Related Reference e Section 5 6 2 10 Handle Exception T
383. w gt to get a list of all the upcoming changes that the rename will cause You can also uncheck only some of the changes that you don t want to make while leaving others checked Click on Cancel if you don t want to make the changes Click on OK to perform the rename Related Concepts Section 3 3 Rule Package 26 Related References Section 5 5 2 Project Explorer View 223 Bosch Software Innovations GmbH 96 270 Chapter 4 Tasks 4 2 7 Moving a Rule Package 1 Moving a rule package from one rule model or rule package into another rule model or rule package is done with drag amp drop Select the rule package you want to move click it and hold down the left mouse button 2 Drag the rule package to the location you want to move it to 3 Let go of the mouse button to move the rule package and its contents If you want to create a copy of the rule package press and hold the Ctrl key when you release the mouse button Moving a rule package will also move the corresponding files and folders on the file system from one folder into another Depending on the version control system you are using this may require addi tional steps when the updated rule model is delivered to the version control system There are also known restrictions with some version control systems e g Subversion that al low folders to be moved just once between checkins In that case it may be helpful to commit the changes immediately
384. which no expected re sult was specified 28 Pricing gt Pricing Test 52 28 Discounts Test for Pricing in Movie Ticket Pricing gt Description Test Cases Input Ne Output Co X Hise a E e y eege ee a Xaa Q Lei A 1 oi Input Data Yalue Output Data Expected Result Actual Result P Test Case Description Gi auditorium_no Integer 1 g price Integer 5 3 coupon Boolean False Gei LG seat no Integer 201 A ES show_date Date 2007 31 09 x Gi student Boolean true Bosch Software Innovations GmbH 168 270 Chapter 4 Tasks 3 Please make sure you also check the other outputs actions internal data for failures The view can be switched with the buttons at the top of the Output section 4 In case you want to update your expected result with the latest actual results you can use the inplace editing or the copy buttons on the top panel of the Output section ki Pricing Fr Pricing Test 3 E Discounts Test for Pricing in Movie Ticket pricing S E gt Description Test Cases Input Output r4 Gg Pee E ae Q Hs Ke 3 1 1 Input Data Yalue Action Expected Result Actual Result Sak Case Description ES auditorium_no Integer 1 t coupon_discount_granl false false d n coupon Boolean False eo general_seating False False E seat no Integer 201 ES show_date Date 2007 31 09 D I special_seating false false D I student_discount_gran true true E student Boolean true Tes
385. x Input Data value E Car_Type Any compact E Premium Customer Any true GG Rental_Days Any 3 2 3 3 Task 3 Define Expected Results for the Test Case It is easy to calculate what should be the result of the rule execution for the entered test data For compact cars the price is 50 per day and the car was rented three days The price must be 150 For compact car types there is no discount granted and the price stays 150 It is possible to insert the expected result and Visual Rules tests if the result of the rule execution is the same as you expect 1 In the Output area the price is listed Insert the expected result of 150 in the corresponding column Output OLLA FIFRE IEE Cotea Data Expected Result Actual Result a Price Any 150 Bosch Software Innovations GmbH 20 270 Chapter 2 Getting Started The price is not the only result that is expected from the rule execution The rule also fires an action that should be true if a discount was granted on the price But for the first test case there should be no discount granted and the action should have the value faise To see the results for actions you have to switch the view of output data elements to actions Click on the actions button in the toolbar of the Output area Output ata Expected Result Actual Result ony 150 3 Now the actions are shown as output Insert false as the expected result for the action Discount Granted Output eae zy dae
386. y Description This column shows the description of the assignment You can edit cells in this column by double clicking them 5 6 2 4 Fire Action Tab This tab is shown when a Fire Action element is selected in the rule editor Here you specify what action should be fired and optionally configure any input parameters the action may require Properties 4 E EE EE j a pre Action 30 Fire Action _ Description Fire Action special seating Motes Action Parameters Description Figure 5 44 Fire Action tab Oom O e oO m Enter the name of the action that should be fired here Code Assist Ctrl Space is avail able 5 6 2 5 Call Flow Rule This tab is shown when a Call Flow Rule element is selected in the rule editor Here you specify the rule to be called and any necessary input data Additionally you specify which data elements the output of the rule should be assigned to E Call How Rule call Flow Rule Description Call Flow Rule Customer Rating Goa Notes F 28 Advanced Input Data Value Output Data Assign To GG customerld Integer 5 fea customerRating Integer customerRating Description Enter the name of the flow rule that you want to call here Press Ctrl Space for content assist or click on to select the rule from a list of available rules Bosch Software Innovations GmbH 234 270 Chapter 5 Reference on itn Op
387. y double clicking them them E column shows wether the data element is static You can edit cells in this column by double clicking them This column shows wether the data element holds a single or multiple values of this type You can edit cells in this column by double clicking them Bosch Software Innovations GmbH 246 270 Chapter 5 Reference Implementation In this column you can specify the collection implementation to be used for a data ele ment that will have multiple entries You can edit a cell by double clicking on it The be havior of the collection depends on the implementation type you select which can be ei ther of the following three types available List Set or Map refer to Section 3 14 7 Col lection 76 for details on collection behaviors If selecting an implementation the Multi ple column value will automatically be set to Yes if it hasn t been already Note There is a fourth implementation called Collection that can only appear after importing e g a Jav aBean It can neither be set nor edited Default Value The default value which will be used when you access the data element when no other value has been set You can edit cells in this column by double clicking them Code As sist Ctrl Space is available The description for this row You can edit cells in this column by double clicking them Related References e Section 3 14 7 Collection 76 e Section 5 6 6 2
388. yed in the usual Properties view Related Concepts e Section 3 6 Flow Rule Editor 45 5 7 3 Auto Creation Preferences This preferences page contains settings for the auto generation of rule elements Preferences type filter text Auto Creation General E Ant Data Management Help W Install Update Java Types H Model validation H Plug in Development Report Design Rules H Run Debug H Team Services El Visual Rules Suto Creation Content Assist Dependency Management Flow Rule Editor Syntax Highlighting Test Execution User Settings Restore Defaults Apply Select the elements to create automatically Oal Mone Custom Data Elements Actions Figure 5 81 Auto Creation preferences mm rem Enable this to let Visual Rules automatically create any elements you are referring to that do not exist yet Men Enable this so Visual Rules will never automatically create any elements Enable this so you can specifically choose what elements should be auto created If you select Custom you can make the decision on the auto creation policy based on the element that would be auto created es Data Elements Select the policy for auto creation of data elements Select the policy for auto creation of types Bosch Software Innovations GmbH 264 270 Chapter 5 Reference Enable this so Visual Rules will ask you every time when an element of the specific ele ment type
389. you can define the values that will be written to each column C Properties 23 z0 Fire Action 3 Fire Action Description Fire Action WriteCustomerT Oo ew ES Motes Column name Expression customerId customer id customerhamne customer name customer age customer age Figure 5 70 Fire Write CSV File Action tab SC re Action Enter the name of the action that you want to fire Code Assist Ctrl Space is available Column name This column shows the column names Cells in the column are read only If you want to change the column name please do it on the Action Settings tab This is the expression you are assigning to the specific column You can edit cells in this column by double clicking them 5 6 7 7 Read CSV File Action Tabs This action type is only available when the Visual Rules 3 x compatibility functions actions have been activated for a rule model See the Extensions tab of the rule model for this setting Bosch Software Innovations GmbH 254 270 Chapter 5 Reference The Read CSV file action does not have any settings All settings are done on the Fire Action tab which is shown when an invocation of the action is selected in the rule editor Properties 23 a Fire Action 36 Fire Action Description Fire Action ReadCS Lg zs Data source ID File nana Cifdatafeustomer esv e CV EE Character set windows 1252 Ww Use header line as column names Fi
390. you have successfully upgraded your rule models to a newer version it is not possible to undo this operation 1 You can also trigger a rule model upgrade manually using the Project gt Upgrade Rule Projects menu en try ioe Run Window Help Build Working Set Clean vw Build Automatically Upgrade Rule Projects Properties 2 Select the rule models you want to upgrade and click on OK It is recommended to upgrade all your rule mod els If any dependencies between models and or projects exist then it is required to upgrade these models and or projects all at once Otherwise the dependency information will not be preserved and models and projects possibly no longer work Rule Project Upgrade Select the rule models and projects you want to upgrade The rule models and projects below will be upgraded to your version of Visual Rules Modeler 2 L lz Movie Ticket Pricing Elf Movie Ticket Pricing meta model version 103 ve iMovie Ticket Pricing Movie Ticket Pricing Bonus Points BonusPaoints Test vrbest imeta model version 10 iMovie Ticket Pricing Movie Ticket Pricing Bonus Points vrtable meta model version 10 S Movie Ticket Pricing Movie Ticket Pricing Discounts vrrule meta model version 10 ve iMovie Ticket Pricing Movie Ticket Pricing Pricing Pricing Test vrtest meta model version 10 e Movie Ticket Pricing Movie Ticket Pricing Pricing vrrule meta model version 10 H ES

Download Pdf Manuals

image

Related Search

Related Contents

企画書をダウンロード  Chief PAC390 mounting kit    取扱説明書  Sunday 4pm - Technical Information Probably one  McIntosh MC205 Stereo Amplifier User Manual  サウンドアダプター 日産汎用[ナビ付車] NSX-03A  EFNEP Annual Update/5-Year Plan  Billion Electric Company BIPAC-5100W User's Manual  ATCA-7365-CE Installation and Use  

Copyright © All rights reserved.
Failed to retrieve file