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
- In the navigator, click .
- In the Workflows list, select the resource you want to work withNote: A resource must already have been added in order to select it from this list.
- In the Displays panel, click .
- Click the Workflow Editor tab.
- 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.
- Drag and drop a Call Method into the subprocess and double-click it, or double-click an existing Call Method activity.
- On the activity configuration panel, click Configure Method. The Configure Method dialog box appears, displaying a list of the available call method service providers.
- Double-click IDirectorySearch to display the list of available call methods.
- Click Search, and then do one of the following:
Click... To configure... Finish basic search results. Next advanced search results using classification restrictions, and then click Finish. The input parameters appear in the activity configuration panel. - In the Name Filter field, from the drop-down arrow:
Click... To... Bind bind the property to the output of a previous activity. Expression insert an expression. - In the Starting Resource field:
Click... To select a... Bind node 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 button select a resource to search from the Universal Browser. - 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.
- Search a resource with a similar Display Name.
- To return single search results:
- Insert an Index activity after the Call Method activity.
- In the Collection field, from the drop-down arrow, select Bind. The Select Variable dialog box appears.
- From the current Call Method, select the Output Parameter's ReturnValue, and then click OK.
- 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.
- Click Save.
- Run the workflow, or, on the Test/Debug tab, test the workflow to ensure that your input parameters are configured correctly.