Use Case of Designing a Service to Select Laptop

This appendix contains the following topics:

Use Case of Designing a Service to Select Laptop

The Laptop Selection example uses a grid service item dictionary and a data retrieval rule to demonstrate automatic retrieval of service item data when a field is chosen from a drop-down menu in a grid. The data retrieval rule also includes a Lookup Condition where a data instance is excluded from selection.

This example walks you through the steps.


    Step 1   Create New Service Item Group and Service Item, in Service Item Manager > Design Service Items. For detailed procedure or creating group and service item, see Creating a Service Item Group and Creating Service Items.
    1. After the new service item is created and as it appears in the Service Item panel on the left under the Group, click Add on the bottom of the page to add the attributes to the Laptops Service Item, as shown below. Each attribute, or row, is a service item instance. The Display Name for each instance will become a column header for the grid.
    2. Click Save after adding all attributes
    Step 2   Create New Dictionary Group and Grid Dictionary in the Dictionaries component of the Service Designer module. For detailed procedure, see Creating a Dictionary Group and Creating a Dictionary.
    1. While creating new dictionary, in the Service Item field of the Add New Internal Dictionary section, enter Laptops to search for the Laptops service item you created, then click Laptops from the popup window that appears, as shown below.
    2. In the resultant Dictionary window, enter Laptops for the Dictionary Name and Default Caption fields. The Default Caption will display as the title for the grid. Choose the dictionary group you just created from the Group Name drop-down menu. In the Use and “Show in Grid” columns, check only the five instances of the Laptops service item you created. By checking Use and “Show in Grid”, the instances will appear as columns in the grid. The Name field is already checked by default and cannot be changed.
    3. Click Save Dictionary.
    Step 3   Create New Form Group and Form.
    1. Click the Active Forms Components component of the Service Designer module, and choose New > Form Group. The new form group appears in the Active Form Components tree to the left.
    2. Choose New > Active Form Component > and enter the required details for the new form and save form.
    Step 4   Add Grid Dictionary to Form and Edit Display Properties.
    1. Click Add Dictionaries and in the Search field, enter Laptops to search for the Laptops dictionary you created. For the resultant Laptop dictionary, check the Name and “Display as Grid” columns. Checking “Display as Grid” makes the fields of the Laptops dictionary that were checked to “Show in Grid” display as columns in the grid.
    2. Click Add to add the Laptops dictionary to the form. The Form Content tab of the Laptop Selection form appears with the Laptops dictionary checked for “Display as Grid”. Note that it is dimmed here and cannot be changed. The only way to change it would be to remove it, and then add it again without checking “Display as Grid”.
    3. Click the Display Properties tab for the Laptop Selection form.
    4. Check Enable automatic retrieval of service item instance data, as shown below. This option is disabled by default. This option enables the ability to automatically retrieve and pre fill data about an existing service item instance. For this example, leave the Grid Options to their default selections and values. In particular, you want the user to have Edit access control to be able to add grid rows.
    5. Below the Laptops dictionary in the left pane, click the Name field to see its HTML Representation window. In the Input Type field, choose “select (single)” from the drop-down menu. An Input Type of “Select Single” renders the Name field as a drop-down menu from which the user can choose only a single value. Also, change the Columns value to 32 to make the Name column width smaller.
    Step 5   Create New Data Retrieval Rule. Click the Active Form Rules tab for the Laptop Selection form.
    1. ChooseNew Rule > New Data Retrieval Rule
    2. In the wizard, do the following:
        • Set the Rule Type set to Distributing Rule and leave the Query Type set to Database Table Lookup.
        • Check Form Load as the triggering event, as shown below.
        • Choose Service Items from the Datasource drop-down menu, and Laptops from the Table Name drop-down menu.
        • To create a Lookup Condition where data instances of “HP” in the Brand_Name field are excluded from selection, choose Brand_Name from the Table Column Name drop-down menu and “is not equal to” in the Operator drop-down menu, and enter HP in the Literal Value field (enabling its radio button), as shown below. Click OK.
        • Map the Name column of the Laptops service item to the Name field of the Laptops dictionary, choose them from the three drop-down menus and then click OK.
      Note    The “*” next to Laptops indicates that Laptops is a grid dictionary.
    Step 6   Create New Service Group. Use the Custom component of the Integrations module.
    1. Click New Custom Integration. Enter a Name and Description for the service group and click Add.

      The new group appears in the Services tree to the left in the Services component of Service Designer module.

    Step 7   Create New Service. Use the Services component of the Service Designer module.
    1. Choose New > New Service. In the Name field of the resultant New Service window, enter Laptop Upgrade for this example. Enter “Upgrade one or more laptops.” for the description. Choose the service group you just created, Dave Service Group, from the Service Group drop-down menu.
    2. Click Add This Service. The General Tab of the Laptop Upgrade service appears.
    Step 8   Add Form to Service and View Service in My Services.
    1. Click the Form tab of the Laptop Upgrade service that appeared after adding service in step 6 d.
    2. Click Add Forms in the bottom left of the window. The Add Form popup window appears.
    3. In the Search field, enter Laptop Selection to search for the Laptop Selection form you previously created.
    4. Check the Laptop Selection form and then click Add.
    5. The Laptop Selection form is added to the Laptop Upgrade service.
    6. Choose the My Services module of Service Catalog.
    7. Enter Laptop Upgrade in the “Search for Services containing:” field and then click Search. The Laptop Upgrade service appears.
    8. Click Order to see the grid you created.

      The grid appears with the header of “Laptops” taken from the Default Name of the dictionary. The column header names are taken from the HTML Representation Label field of the dictionary fields.

      The Name field appears as a drop-down menu from which you can only choose a single value because you chose “select (single)” as the Input Type for the Name field. Click in the first row of the Name column and choose a name from the drop-down menu—the rest of the fields are automatically filled in. This happens because you checked “Enable automatic retrieval of service item instance data” for the form dictionary and mapped the Name column of the Laptops service item to the Name field of the Laptops dictionary.