How You Filter Connectable Items

The target item class for a connector might contain thousands of items, which could strongly affect performance when loading the connector's set of connectable items at runtime. You can define a filtered set of connectable items for a connector to reduce that performance effect.

Define the Set of Connectable Items

To define a set of connectable items for a connector:

  1. On the Structure tab of the Edit Configurator Model page, select a connector.

  2. In the Details region of the connector, select the Connectable Items tab.

    • The items in this table comprise a subset of the full set of items associated to the connector's target item class. At runtime, these items will be the only ones connectable to your model.

    • If you don't add any items to this table, then at runtime the full set of items associated with the connector's target item class will be considered connectable items.

  3. Click Select and Add. In the Select and Add: Connectable Items dialog box, search for items associated to the connector's target item class. You can search on the Name, Description, or Item Status of the items.

  4. Select the items to add, then click Apply to continue adding as many items as needed without closing the dialog, or click OK to close the dialog and add the selected items.

  5. Save the model.

Select the Connectable Items at Runtime

You can use an extension rule to select the connectable items that you defined. Here's a simple example of one way that you can automatically select connectable items.

  1. Define a connector with these values:

    • The Name is MyConnector.

    • The target item class of your choice.

    • The Minimum Connections and Minimum Quantities are 1 or more.

    • The Maximum Connections and Maximum Quantities are equal to or greater than the number of items selected on the Connectable Items tab of your connector.

  2. Define an extension rule with these settings:

    • The Base Node is set to the root node of the model.

    • This event binding:

      Field

      Value

      Event

      postConfigInit

      Event Scope

      Global

      Class

      ScriptClass

      Method

      run()

    • The following rule text, substituting the name of the first item in your set of connectable items for FIRST_ITEM_NAME. The rule loops through the set of connectable items, beginning with the first one:

      Copyimport oracle.apps.scm.configurator.runtime.core.IConnectorNodeType;
      
      def baseNode = cxEvent.baseNode;
      def connPort = baseNode.getChildByName("MyConnector"); // The name of your connector.
      def instance = connPort.getInstances().get(0);
      def inst;
      
      for (Object type : instance.definitionLeafTypes)
      {
      // Add all the items in the set of connectable items, starting with the first one.
          if(type.id == "FIRST_ITEM_NAME") { // The name of the first item in your connectable set. 
             instance.setType((IConnectorNodeType)type);
             instance.quantity = 1;
          } else {
             inst = connPort.addInstance();
             inst.setType((IConnectorNodeType)type);
             inst.quantity = 1;
          }
      }
      
  3. Optionally, create a user interface that includes one of the running summary templates.

  4. Save and Compile the model.

  5. Click Test Model. If you added the running summary, select the user interface you created that includes it.

  6. When the Test Model user interface appears, the items in your set of connectable items are automatically selected by the extension rule when the new configuration is initialized. The items in your set of connectable items appear in:

    • The running summary, if you included that template in a UI that you created.

    • The Review page, if you click Finish and Review. All connected items appear there by default, regardless of whether you added a running summary.