Show TOC

Procedure documentationImporting a Schema Locate this document in the navigation structure

 

You can import a schema or a WSDL file into the rules composer DC. When you import a WSDL file that has a schema, the rules composer DC extracts the schema and allows you to write rules using that schema.

Procedure

  1. In the Project Explorer view, expand the rules composer DC node, and the src node.

  2. In the context menu of the wsdl node, choose   Import.  

  3. In the wizard that appears, expand the Web Services node and choose XSD or wsdl. Choose Next.

  4. In the screen that appears, choose Browse and specify the folder in your workspace where the schema file has to be placed and choose Remote Location / File System. Choose Next.

  5. In the screen that appears, choose Browse and choose the schema file in your system. Choose Finish.

Alternative Procedure

Copy and Paste the schema file

  1. Copy the schema file from your file system.

  2. In the Project Explorer view, expand the rules composer DC node, the SRC node and in the context menu of the wsdl node, choose Paste. .

Create a new schema file

  1. In the Project Explorer view, expand the rules composer DC node and the SRC node.

  2. In the context menu of the wsdl node, choose   New   File.  

  3. In the screen that appears, enter the name of schema file along with the file extension in the File Name filed. Choose Finish.

  4. Double-click the new schema file and enter the content.

Note Note

You should be able to view all the added schema files when you expand the wsdl node in the Project Explorer view.

End of the note.
Adding the XSD Elements to the Rules Composer DC

A schema file can contain multiple elements, you can add the required XSD elements to the rules composer DC.

  1. In the Project Explorer view, expand the rules composer DC node, the Rules Modeling node and double-click the Project Resources node.

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

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

  4. In the Add XSD Element dialog box that appears, expand the namespace node and choose the root element.

    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 rules composer DC node, choose   Build Project.  

    End of the note.
  5. Choose one of the two radio buttons that allow you specify how you want to generate XPath aliases:

    • Create all default XPath aliases for the selected element

    • Choose the Create XPaths button in the Aliases editor and create required XPaths

  6. Choose Click here to set alias generation preferences (Optional)

  7. In the screen that appears, you can select the checkbox in the Alias Generation section if you want to use namespace prefixes for aliases

    Note Note

    Namespace prefixes are used to distinguish elements with same name. For example, if there are two 'purchaseorder' elements with same name, you can distinguish them using prefixes.

    End of the note.
  8. You can select the desired checkboxes in the Edit visibility setting for advanced aliases section. (Optional)

    Note Note

    • You can select checkboxes for the following methods to be visible:

      • addChildElement

      • getXMLElement

      • size

      The methods listed above are generated for complex type elements which have atleast one child element or attribute. If the maxOccurs parameter corresponding to that child element has a value is greater than 1(the default value is 1), one alias is generated for each of the child elements. The return type of these methods is IRulesXMLDataObject.

      Example Example

      If purchaseOrder/items has an element called item, whose maxOccurs parameter is greater than 1, the aliases generated are:

      • purchaseOrder/items.addChildElement(item)

      • purchaseOrder/items.size(item)

      • purchaseOrder/items.getXMLElement

      End of the example.
    End of the note.
  9. You can enter the limit in the XPath Recursion Limit field. (Optional)

  10. Choose Finish and save the changes.

Note Note

If you choose to generate only specific XPath aliases:

  • In the Aliases editor, choose the Create XPath button

  • In the Create XPath Aliases dialog box, expand the root element and press Ctrl and choose the elements for which XPath aliases need to be generated

  • Choose OK.

You should see the XPath aliases in the Alias Name table.

End of the note.