Managing Compound Elements

These topics provide an overview of compound data types and discuss how to:

  • Add compound elements.

  • Define complex primitive data types.

  • Define documents as compound element data types.

  • Define PeopleSoft records as a compound element data types.

A compound data type can be a complex primitive data type, another document, or a PeopleSoft record.

When you add a compound data type to the document tree, the Add Compound Child or Add Compound Peer page appears, depending on whether you are adding a child or peer element. The Add Compound Child page and the Add Compound Peer page are identical and have the same object name, IB_LOGICALCOMP_SEC.

Image: Add Compound Child page

This example illustrates the fields and controls on the Add Compound Child page. You can find definitions for the fields and controls later on this page.

Add Compound Child page

To add compound elements (child or peer) to documents:

  1. Access the Document Builder - Documents page (PeopleTools > Documents > Document Builder).

  2. On the document tree, click the element to which to add a compound child or compound peer element.

  3. On the action toolbar, do one of the following:

    • Click theAdd Compound Child button to add a compound child element.

    • Click the Add Compound Peer button to add a compound peer element.

      The Add Compound Child page or Add Compound Peer page appears.

  4. In the Name field, enter a name for the compound element.

  5. Select the type of compound element to create. The options are:

This section discusses how to:

  • Define properties for complex primitive elements.

  • Define attributes element properties.

  • Add additional attribute elements to complex primitive data types.

Defining Properties for Complex Primitive Elements

After you create and name a complex primitive data type, two elements appear in the document tree on the Document Builder - Documents page. One element is for the complex primitive and the other is for the first of one or more element attributes.

Image: Document Builder – Document page

The following example shows a newly created complex primitive element (and attribute) element appearing in the document tree. TransactionID is a complex primitive element off of the root element.

Document Builder - Document page

The complex primitive element is denoted by a complex primitive icon to the left of the element name. In addition, it is highlighted. The attribute is denoted by the primitive icon to the left of the name.

In the example, the complex primitive element is highlighted, and the properties appear on the right side of the page. They are:

Field or Control

Definition

Element Name

The name of the element as defined on the Add Compound Child or Add Compound Peer page.

This value is read-only.

Required

Select the check box to make the element a required element.

Sequence

The system assigns this read-only field. The sequence number is used for indexing with the PeopleCode API for documents.

Type

This field displays the element type.

Defining Attribute Element Properties

Properties you define for an attribute element appear when you select an element in the document tree.

Image: Document Builder – Document page

The following example shows the attribute element TransactionID selected in the tree.

Document Builder - Document page

When you select an attribute element, the properties you can define for it appear on the right side of the page.

To specify attribute element properties:

  1. In the document tree, select an attribute element.

    The attribute element properties appear on the right side of the page.

  2. In the Element Name field, enter the name of the element as you want it to appear in the generated XML.

    If you change this name, the complex primitive element and attribute element name changes to the value you enter.

  3. Select the Required box to make the attribute a required element.

  4. From the Type drop-down list box, select an element type.

    Primitive element types are described elsewhere in this topic.

    See Defining Primitive Element Properties.

  5. Click the Save button.

Adding Additional Attribute Elements to Complex Primitive Data Types

You can add the following element types as attribute elements to complex primitive data types:

  • Primitive child.

  • Primitive peer.

  • Compound peer.

  • Collection peer.

You add these elements to complex primitives as you would any other element, first using the action toolbar on the Document Builder - Documents page to add the element to the document tree, and then defining the element properties.

See Managing Primitive Elements, Managing Compound Elements, Managing Collection Elements.

After you create and name a document as the data type for a compound element, you specify the document package, document name, and document version on the Add Compound Child or Add Compound Peer page (IB_LOGICALCOMP_SEC).

When you specify a document as the compound element data type, you can select to use a reference of the document or a copy of the document. Using a reference of the document means that if the document defined as the compound element type is modified, then the changes will be rolled into that document. Using a copy of the document means that the document you define as the compound element type will remain the same, even if the original document is modified in the future.

Image: Add Compound Child page

This example shows specifying the document to add as a compound element data type.

Add Compound Child page

After you enter the document details, click the Search button to select the document to add as a compound element.

Image: Add Compound Child page

The following example shows the search results from the parameters entered in the previous example.

Add Compound Child page

Note: To select from all documents in the database, do not enter any document information and click the Search button.

After you search for and select a document, the Document Builder - Documents page appears, and the document appears as a compound element in the document tree.

Image: Document Builder – Document page

The following example shows the BillTo document added as a compound element to the DEMO_PURCH_ORDER document:

Document Builder - Document page

After you create a document as a compound element data type, the document element information appears on the right side of the page. A Go to Child Document link also appears. When you click the Go to Child Document link, the document definition for the compound element appears in a new window.

To define a document as a compound element data type:

  1. Create and name a document as a data type for a compound element.

    See Adding Compound Elements.

  2. In the Type drop-down list box, select an option:

    • By Reference. (Default.)

      Use a reference of the document.

    • Copy.

      Use a copy of the document.

  3. Specify the document:

    1. In the Package field, enter the document package name or click the Lookup button to search for one.

    2. In the Document field, enter the document name or click the Lookup button to search for one.

    3. In the Version field, enter the document name or click the Lookup button to search for one.

    4. Click the Search button.

      The search results appear in the Document List grid.

    5. Select a document from the list.

      The Document Builder - Documents page appears, and the document you specified appears in the document tree.

  4. Click the Save button.

After you name a compound element and choose to create a PeopleSoft record data type, you must search for and select the record. As with other compound data types, you use the Add Compound Child or Add Compound Peer page (IB_LOGICALCOMP_SEC), depending on whether you are creating a compound child or compound peer element.

Image: Add Compound Child page

The following example shows the Add Compound Child page when searching for a PeopleSoft record to add as a compound child.

Add Compound Child page

After you enter search criteria, the results appear in the Records grid. When you select a record from the grid, the Select Fields to Insert into New Document page (IB_LOGICALFLD_SEC) appears. Use the page to select the fields to include in the document. The fields become primitive elements in the document, and the record fields properties, such as data type and length, become the default primitive element properties in the document.

Image: Select Fields to Insert into a New Document page

This example shows the available fields from the ITEMS record that you can insert and use in ORDER_ITEMS compound element.

Search Fields to Insert into new Document page

When you save the information, the record and its fields become a compound document element. In the previous example, you see that the system reads the package name and version from the document definition and supplies the document name in the Document field.

After you provide the document name and click the OK button, the new compound document element that you created from a PeopleSoft record appears in the document tree on the Document Builder - Document page.

Image: Document Builder – Document page

The following example shows the compound element, ORDER_ITEMS, appearing in the document tree.

Document Builder - Document page

The previous example shows that the system converted the PeopleSoft ITEMS record and its fields into a document called ORDER_ITEMS, and that the document is a compound child element of the DEMO_PURCH_ORDER document.

Click the Go to Child Document link in the properties section of the page to view and modify the ORDER_ITEMS document definition.

To define a PeopleSoft record as a compound element:

  1. Access the Document Builder–Document page (PeopleTools > Documents > Document Builder).

  2. On the document tree, select the element to which to add the compound element and on the Action Toolbar, click the Add Compound Child or Add Compound Peer button as appropriate.

    The Add Compound Child or Add Compound Peer page appears, depending on the toolbar button selected.

  3. Select the PeopleSoft record.

    1. Click the Record radio button.

    2. In the Record field, enter the record name or use the Lookup button to search for one and click the Search button.

      A Records list appears.

    3. From the Records list, click the record name to use.

      The Select Fields to Insert into new Document page appears.

  4. Select the fields to insert into the new document.

    1. In the New Document Keys section, enter the document package, name and version for the new document.

    2. In the Fields to Use section, use the Select box to select or deselect the fields to include in the new document.

    3. In the Alias column, enter field alias names to use.

  5. Click the OK button.