DMN Boundary Events Link Events Collections Mgr. Marian Macik Senior Software Quality Engineer April 2023 1 ▸ Video tutorials ▸ DMN demo ▸ Boundary Error Events ▸ Link ▸ Collection parameters AGENDA 2 ▸ jBPM Work Items and Timers ・ https://www.youtube.com/watch?v=tpVSWYcaICk ▸ Interprocess communication ・ https://www.youtube.com/watch?v=ixjxPlUq3Bs ▸ Slides from videos available in study materials VIDEO TUTORIALS 3 ▸ In a new project, design the following process: DMN DEMO The Process 4 ▸ Create this type using Data Object asset. ▸ Add field age of type Integer to it. DMN DEMO Data Object Person 5 ▸ Create 3 process variables: ・ price of type Integer ・ approved of type Boolean ・ person of type Person DMN DEMO Process variables 6 ▸ Create a DMN asset. ▸ Add 2 DMN Input Data nodes: ・ price of type number ・ age of type number ▸ Add mortgageApproved DMN Decision node of type boolean and click on a small edit icon near the node. ▸ Click on Select expression and choose Decision Table. Configure it like on the picture. ▸ Save your DMN. DMN DEMO DMN model 7 ▸ Open properties of Mortgage Approval Business Rule Task in your process definition. ▸ Select DMN as Rule Language. ▸ Fill in the namespace, it can be found when clicking on DMN canvas and then on Diagram properties. ▸ Decision Name is mortgageApproved. ▸ DMN Model Name is the name of your DMN file (without .dmn extension). ▸ Configure data assignments: ・ Inputs: ・ price of type Integer from source price. ・ age of type Integer from source #{person.age}. ・ Outputs: ・ mortgageApproved of type Boolean with target approved. DMN DEMO Mortgage Approval Business Rule Task 8 ▸ Configure the gateways as on the picture: DMN DEMO Gateways 9 approved is true approved is true default default ▸ approved is true can be set on sequence flow (“arrow”) itself ▸ default is set on the gateways DMN DEMO Manager Approval Human Task 10 ▸ Configure data assignments: ・ Inputs: ・ price of type Integer from source price. ・ person of type Person from source person. ・ Outputs: ・ approved of type Boolean with target approved. ▸ Assign the task to the actor wbadmin. DMN DEMO Run the Process 11 ▸ Congratulations! You can now run your process and verify that it works. ▸ If you have spare time, you can try to fine-tune the forms: ・ Process form shouldn’t have approved field visible. ・ price and age should be required fields. ・ Manager Approval task has price and person as an input (data assignment) which means they will be available for manager to review when completing the task. These two fields are read-only automatically as they are set just as inputs. The only output is the approved variable which means this is the only field a manager can write to. DMN DEMO Test Scenario 12 ▸ If you want, you can try creating Test Scenario asset. ・ Add Asset of type Test Scenario. ・ Select Source type of DMN. ・ Choose your DMN asset. ▸ Fill your test data and expected results. ▸ Run your test scenario using the play button. BOUNDARY ERROR EVENTS 13 ▸ Handling of business exceptions explicitly by the process definition ▸ Requires HandleResponseErrors parameter set to true on the REST Service Task ▸ Participants and Results as java.util.ArrayList ▸ Actor of Submit Vote task is #{participant} ▸ Multi-instance subprocess ”For each participant” ▸ Link events - set link id, works like signals POLL EXAMPLE - LINK EVENT AND COLLECTIONS linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 15 Thank you!