Convert a resource's display name to a Directory Resource

You can convert a resource's String data type display name to a Directory Resource data type using the IDirectorySearch Search call method.

Before you begin

Note: Activities can be inserted at both the workflow and subprocess levels.

Procedure

  1. In the navigator, click Workflow > Workflows.
  2. In the Workflows list, select the resource you want to work with
    Note: A resource must already have been added in order to select it from this list.
  3. In the Displays panel, click Workflow Management > Workflow Editor.
  4. Click the Workflow Editor tab.
  5. Drag and drop a Local Subprocess into the workflow and double-click it, or double-click an existing subprocess.
    Note: If required, configure the workflow.
  6. Drag and drop a Call Method into the subprocess and double-click it, or double-click an existing Call Method activity.
  7. On the activity configuration panel, click Configure Method.
    The Configure Method dialog box appears, displaying a list of the available call method service providers.
  8. Double-click IDirectorySearch to display the list of available call methods.
  9. Click Search, and then do one of the following:
    Click...To configure...
    Finishbasic search results.
    Nextadvanced search results using classification restrictions, and then click Finish.
    The input parameters appear in the activity configuration panel.
  10. In the Name Filter field, from the drop-down arrow:
    Click...To...
    Bindbind the property to the output of a previous activity.
    Expressioninsert an expression.
  11. In the Starting Resource field:
    Click...To select a...
    Bindnode whose children and descendants you want to search.
    Tip: Use the bind path that is as close to the starting resource as possible. For example, if you want to find a Directory Resource for a production segment, select the Production Segments folder in the Production model. The closer the folder is to the actual resource, the better the search performance.
    Ellipsis buttonselect a resource to search from the Universal Browser.
  12. To return multiple search results:
    • Search a resource with a similar Display Name.
      Note: You can return partial matches. For example, if you want to find a resource named MyEquipment and you search for My, all resources with My in the display name will be returned, including MyEquipment.
    • To find the exact Display Name, insert a For Each Activity or a While loop to iterate through the results.
  13. To return single search results:
    1. Insert an Index activity after the Call Method activity.
    2. In the Collection field, from the drop-down arrow, select Bind. The Select Variable dialog box appears.
    3. From the current Call Method, select the Output Parameter's ReturnValue, and then click OK.
    4. In the Index field, enter 0 to return the first item in the collection. You can now access the Directory Resource through the result of the Index activity.
  14. Click Save.
  15. Run the workflow, or, on the Test/Debug tab, test the workflow to ensure that your input parameters are configured correctly.