Fixing the BRMS rule generation issue
[policy/engine.git] / POLICY-SDK-APP / src / test / resources / com.Config_BRMS_Raw_TestBRMSRawPolicy.1.txt
1 package com.sample
2 import com.sample.DroolsTest.Message;
3 // Declare the Parameters here.
4 declare PapParams
5     samPoll : int
6     value : String
7 end
8 // This Rule will be generated by the UI.
9 rule "Create parameters structure"
10     salience 1000  
11     when
12     then
13         Params params = new Params();
14         params.setSamPoll(76);
15         params.setValue("Bobby");
16         insertLogical(params);
17 end
18 // Start using the parameters as below in Rules.
19 rule "Rule 1: Check parameter structure access from when/then"
20     when
21         $param: Params()
22         Params($param.samPoll > 50)
23     then
24         System.out.println("Firing rule 1");
25         System.out.println($param);
26 end
27 rule "Rule 2: Check parameter value access from when/then"
28     when
29         $param: Params()
30         Params($param.samPoll > 50)
31     then
32         System.out.println("Firing rule 2");
33         System.out.println($param.getValue());
34         System.out.println($param.getSamPoll());
35 end