Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

This is the second part of the "BRM integration with BPM" blog. The first part is available BRM integration in BPM (Java Class). The sample process shown in this blog would be exactly the same as in the part 1 except that this time the XML shema will be used.

 

Prerequites:

 

a) Read through/Completed the "BRM integration with BPM" (Java class).

 

As usual, this is not going to be a step-by-step guide.  

 

1) Create a new Rules Composer DC project and a XSD that contains the complex data type which consisting of a name, age and comment element.

   

    a) Create a new Rules Composer DC project, called "rule_age". 

   

     b) Right click on the "wsdl" -> "New" -> "Other" -> "XML" -> "XML Schema" -> name it to "nameage.xsd" -> "Finish".

 

    c) Enter the content as of the Figure 1 to the "nameage.xsd".

 

Figure 1: XSD data type in the "nameage.xsd".

 

 

2) Add the XSD created into the "Alias" so that it can be used in the RuleSet.

 

   a) Double click on the "Aliases" -> "XSD Alias" tab -> "Add XSD Elements" -> choose the available "nameAge" Global Elements. 

 

 Figure 2: Added XSD alias.

 

3) Create the RuleSet and define the rules.

 

    a) Right click on the "Rule Modeling" -> "New RuleSet" -> enter "NameAgeRules".

 

    b) Right click on the newly created "NameAgeRules" -> "New Rule" -> enter "OldRule". Repeat the same for "YoungRule".

 

    c) Enter the condition for "OldRule" and "YoungRule" as in the Figure 3 and Figure 4.

 

Figure 3: "OldRule" condition.

 

Figure 4: "YoungRule" condition.

 

4) Create an XML from the "nameage.xsd" XML Schema. This XML format will be used by the Web Dynpro UI as an passing parameter to invoke the RuleSet.

 

    a) Right click on the "wsdl" -> "New" -> "Other" -> "XML" -> "XML" -> name it to "nameage.xml" -> "Create XML from XML Schema file" -> "Select file from workbench" -> choose "nameage.xsd" -> "Next" -> "Finish".

 

   b) Build and deploy the "rule_age" DC.

 

 

Figure 5: "nameage.xml" generated from the "name.xsd"

 

5) Web Dynpro UI will invoke the ruleset using the XML.

    a) Create or reuse the Web Dynpro DC "wd_ui_mna" as in the part 1 of this blog (2a).

 

    b) To invoke the above defined rules in the rules engine, add the following codes in m_FillMyNameAge method in C_FillMyNameAge's component controller (C_FillMyNameAge.java).  

 

Figure 6: m_FillMyNameAge method in C_FillMyNameAge.java.

 

     c) Create a class "XMLHelper.java" needed in the step 5 b). Import the necessary classes. As you may observed in the ConstructXML method, the content of the xmlString format is exactly same as the generated "nameage.xml" in the 4 a). This xml string will be passed as input to invoke the rule egine. GetComment method will retrieve the "comment" element in the returned XML result.

  

Figure 7: XMLHelper class.

  

      d) Add the 3 methods below in the EngineInvoker.java (created in the part 1 of the blog).

 

Figure 8: InvokeRuleset method in the EngineInvoker.java.

Figure 9: processPayLoad method in the EngineInvoker.java.

Figure 10: processReturnPayLoad method in the EngineInvoker.java.

 

 

 

e) Build and deploy the "wd_ui_mna" DC.

 

 

 

It is pretty simple to invoke XSD ruleset. The posibble challenging part is to figure out the xmlString (XML format) that is needed invoke the ruleset, as explained in 5 c).

4 Comments