Show TOC

Procedure documentationCreating the XML Schema Locate this document in the navigation structure

 

You need business terms or a data model to write rules. You create an XML schema for the purpose.

Procedure

  1. In the Project Explorer view, expand the src node and in the context menu of the wsdl node, choose   New   Other  .

  2. In the wizard that appears, expand the XML node and choose XML Schema. Choose Next.

  3. 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.

  4. In the CreditCard.xsd window that appears choose the Source tab at the bottom.

  5. In the tab page that appears delete all existing content and copy the following in the Source tab page:

    Syntax Syntax

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/CreditCard" xmlns:tns="http://www.example.org/CreditCard" elementFormDefault="qualified">
    3. <complexType name="ApplicantType">
    4. <sequence>
    5. <element name="ApplicantName" type="string"></element>
    6. <element name="ApplicantAge" type="int"></element>
    7. <element name="AnnualIncome" type="double"></element>
    8. <element name="TotalAssets" type="double"></element>
    9. <element name="CardType" type="string"></element>
    10. <element name="CreditHistory" type="string"></element>
    11. <element name="Eligibility" type="string"></element>
    12. </sequence>
    13. </complexType>
    14. <element name="CreditCard" type="tns:ApplicantType"></element>
    15. </schema>
    End of the code.
  6. Press Ctrl+Shift+F.

  7. Save the changes.

Adding the XSD Elements to the Rules Composer DC
  1. In the Project Explorer view, expand the Rules Modeling node and double-click the Project Resources node.

  2. In the Project Resources editor that appears, choose the Aliases tab.

  3. In the Aliases editor that appears, choose the Add button and in the menu that appears, choose the XSD Element.

  4. In the dialog box that appears, expand the http://www.example.org/CreditCard node and choose CreditCard.

    Note Note

    If you are not able to view the XSD elements, you need to build project.

    • In the SAP NetWeaver Developer Studio, choose   Project   Build Automatically.  

      or

      In the Project Explorer view, in the context menu of the creditcard_rules node, choose   Build Project.  

    End of the note.
  5. Choose Finish.

  6. In the Alias Name table select all the XML schema element checkboxes.

  7. Save the changes.

Renaming the XSD Aliases
  1. 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}