Get Entities by ID
Use the Get Entities by ID action to retrieve details of entities based on a list of object identifiers. You can obtain Windchill object identifiers from the Windchill trigger or any other Windchill action that provides the object ID in its output schema.
Complete the following steps to use the Get Entities by ID action in your workflow:
1. Drag the
Get Entities by ID action under
Windchill to the canvas, place the pointer on the action, and then click
or double-click the action. The Get Entities by ID window opens.
2. Edit the Label, if needed. By default, the label name is the same as the action name.
If you previously added a connector type, select the appropriate Connector Type, and under Connector Name, select the connector.
4. Click TEST to validate the connector.
5. Click
MAP CONNECTOR to execute the action using a connector that is different from the one that you are using to populate the input fields. In the
Runtime Connector field, provide a valid Windchill connector name. For more information about
MAP CONNECTOR, see
Using Map Connector.
6. In the Entity Type list, select the appropriate entity type.
7. In the List of Identifiers field, specify a comma-separated list of object IDs in the Windchill OID format such as OR:Type:ID where, Type is the internal name of the Windchill entity type.
For example, OR:wt.part.WTPart:646192, OR:wt.part.WTPart:601234
You can map the list of identifiers from the previous action.
8. Use the options in the Query Type list to filter the output based on the object properties that you want in the output.
Depending on the entity return type, a query has the following parameters:
◦ Single object—Select Properties, Add Related Items
◦ Collection of objects—Filters, Select Properties, Add Related Items, Limit, Skip
Form-Based Query a. (Available only for collection of objects) Under the Filter group, do the following: a. In the Join By list, select a logical operator to join the filter clauses. The default value is and. b. Under Filter Clauses, click Add to add a filter: ▪ Property—Select a property. ▪ Matching Condition—Select a condition. The condition depends on the type of the property selected such as String, Boolean, and so on. ▪ Value—Enter a property value. Click Add to add multiple filters. Click to delete any filter that you added. If you add the same properties and select AND in the Join By list, the attributes are joined by the OR operator. b. Under Select Properties, click Add, and in the Property list, select the property for which you want to retrieve values. Click Add to add multiple properties. Click to delete any property that you added. By default, values for ‘key’ properties are retrieved in the output. c. Under Add Related Items, click Add, and in the Related Item list, select the related item for which you want to retrieve values. Click Add to add multiple related items. Click to delete any related item that you added. Any property marked as NavigationProperty is categorized as a Related Item. d. (Available only for collection of objects) In the Limit field, enter a value to limit the output to a specified number of entities. e. (Available only for collection of objects) In the Skip field, enter the number of resources that you want to skip. |
Discrete Query a. (Available only for collection of objects) In the Filters field, specify OData filter criteria in the propertyName operator 'value' [and | or | not]... format. For example, number eq '0000222341' or name eq 'PTC' or startswith(name, 'PTC') b. In the Select Properties field, specify an OData select expression to provide a comma-separated list of property names. By default, values for ‘key’ properties are retrieved in the output. c. In the Add Related Items field, specify an OData select expression to provide a comma-separated list of related items. Any property marked as NavigationProperty is categorized as a Related Item. d. (Available only for collection of objects) In the Limit field, enter the number of search results that you want to retrieve. e. (Available only for collection of objects) In the Skip field, enter the number of top search results that you want to skip from the result. |
Raw Query In the Query field, specify an OData query expression. For example: $select=name,number&$expand=context&$top=2&$skip=1&$orderby=name asc&$filter=name eq 'PTC' By default, values for ‘key’ properties are retrieved in the output. Any property marked as NavigationProperty is categorized as a Related Item. Depending on the entity return type, you can provide filters, limit, and skip parameters in the query expression. |
9. Click Show Additional Fields to see additional fields.
◦ In Get OData Annotations, select true to include OData Annotations in the output. The default value is false.
10. Click Done.
Output schema
The output schema for the Get Entities by ID action is a dynamic schema. It returns an array of objects with properties of the selected entity type and an identifier list of all the entity types that are queried.
If you selected Form-Based Query to specify query parameters, the output schema provides details of the selected properties only.
For Discrete Query or Raw Query, the output schema contains all properties of the returned object; however it provides values of the selected properties only.
The following image shows the default output schema:
If you select Entity Type as CADDocuments, then the output schema is as shown in the following figure:
If you select Entity Type as CADDocuments and set the Property to AuthoringApplication, then the output schema is as shown in the following figure:
If you select Entity Type as CADDocuments and set the Property to AuthoringApplication and Related Items to Versions, then the output schema is as shown in the following figure: