You need business terms or a data model to write rules. You create an XML schema for the purpose.
In the Project Explorer view, expand the src node and in the context menu of the wsdl node, choose
.In the wizard that appears, expand the XML node and choose XML Schema. Choose Next.
In the screen that appears, enter CreditCard.xsd in the File Name field. Choose Finish.
In the Project Explorer view, you should see the CreditCard.xsd when you expand the wsdl node.
In the CreditCard.xsd window that appears choose the Source tab at the bottom.
In the tab page that appears delete all existing content and copy the following in the Source tab page:
Syntax
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/CreditCard" xmlns:tns="http://www.example.org/CreditCard" elementFormDefault="qualified">
<complexType name="ApplicantType">
<sequence>
<element name="ApplicantName" type="string"></element>
<element name="ApplicantAge" type="int"></element>
<element name="AnnualIncome" type="double"></element>
<element name="TotalAssets" type="double"></element>
<element name="CardType" type="string"></element>
<element name="CreditHistory" type="string"></element>
<element name="Eligibility" type="string"></element>
</sequence>
</complexType>
<element name="CreditCard" type="tns:ApplicantType"></element>
</schema>
Press Ctrl+Shift+F.
Save the changes.
In the Project Explorer view, expand the Rules Modeling node and double-click the Project Resources node.
In the Project Resources editor that appears, choose the Aliases tab.
In the Aliases editor that appears, choose the Add button and in the menu that appears, choose the XSD Element.
In the dialog box that appears, expand the http://www.example.org/CreditCard node and choose CreditCard.
Note
If you are not able to view the XSD elements, you need to build project.
In the SAP NetWeaver Developer Studio, choose
or
In the Project Explorer view, in the context menu of the creditcard_rules node, choose
Choose Finish.
In the Alias Name table select all the XML schema element checkboxes.
Save the changes.
In the Alias Name table, click each of the aliases. The aliases become editable. Enter an alternative name for the alias.
Alias Name |
Rename as |
---|---|
CreditCard/AnnualIncome |
Annual Income of Applicant |
CreditCard/AnnualIncome = {double} |
Set Annual Income of Applicant = {double} |
CreditCard/ApplicantAge |
Applicant Age |
CreditCard/ApplicantAge = {int} |
Set Applicant Age = {int} |
CreditCard/ApplicantName |
Applicant Name |
CreditCard/ApplicantName = {String} |
Set Applicant Name = {String} |
CreditCard/CardType |
CardType |
CreditCard/CardType = {String} |
Set Card Type = {String} |
CreditCard/CreditHistory |
Credit History of Applicant |
CreditCard/CreditHistory = {String} |
Set Credit History of Applicant = {String} |
CreditCard/Eligibility |
Applicant Eligibility |
CreditCard/Eligibility = {String} |
Set Applicant Eligibility = {String} |
CreditCard/TotalAssets |
Total Assets of Applicant |
CreditCard/TotalAssets = {double} |
Set Total Assets of Applicant = {double} |