Populating the bundle attribute

Before you can set up the value types to populate the required fields on the Child Requests, you need to populate the Bundle attribute on the Parent Request.

To populate the Bundle field with the bundle from the Service Item field:
  1. In Process Designer, open the process that you are using to handle Bundle Requests.
  2. From the Toolbox, add an Automatic Action Instance.
    The Select Action dialog appears. We need to create a new action we can use to populate the Bundle field.
  3. Click New.
    The Create New Action dialog appears.
  4. In the Title field, type Populate Bundle Attribute.
    This is the name of the action that will appear in the Actions list at runtime.
  5. Set the Allow Association With Window value to True, then click OK.
    This will make the Request window available to use for this action.

We are going to populate the Bundle field on the Request window. This is not usually needed on the Request window, so you might need to add it temporarily using Window Manager. To access Window Manager for the Request window, right-click the new Populate Bundle Attribute automatic action, then click Modify Action Window.
You can remove the Bundle field from the Request window when you have completed this procedure.

  1. Double-click the new Populate Bundle Attribute automatic action.
    The Request window appears.
  2. Right-click the Bundle field, then click Calculation.
    The Edit Formula for Bundle dialog appears.
  3. In the Editor box, enter the following calculation, then click OK:
    import System
    static def GetAttributeValue(Request):
    	Value = null
    	if Request._ConfigItemRequested != null:
    		if Request._ConfigItemRequested.Class.Name == "Bundle":
    			Value = Request._ConfigItemRequested
    return Value

Lines 3 and 4 of this calculation are indented once; line 5 is indented twice; line 6 is indented three times; and the final line is not indented.

This calculation sets the value of the Bundle field to the value selected in the Service Item field on the Request window, if the Service Item selected is a bundle.

This calculation works by setting the value of the Bundle field to null (empty). Then, if the value of the ConfigItemRequested field on the Request is not null, it checks to see if the Name of the Class for the ConfigItemRequested field is set to Bundle. If it is, this means that the ConfigItemRequested is a bundle (the ConfigItemRequested is stored in the Service Item field on the Request window).
If the calculation determines that the ConfigItemRequested selected is a bundle, then the calculation sets the value of the Bundle field to be the value selected in the Service Item field on the Request window.