Tool-defined Resource Operations

Unlike static resource operations such as UPDATE or DELETE, tool-defined resource operations can be dynamically returned by a tool. There are only two reasons for using a tool-defined resource operation instead of a static one:

Examples

  • A tool Check OutFile either updates an element if it already exists in the application's development stage (UPDATE) or copies a file into the application's development stage (INSERT).
  • The tool Compile Program creates several build output files (multiple INSERT resource operations).
Configuring a tool-defined resource operation in the model requires the following:
  • The Resource Processing attribute of the tool descriptor must be set to TOOL-DEFINED.
  • Properties returned by the resource operation must be modeled as output parameters of the type ToolDefinedResourceOperation for tools defined according to the old tool interface (before Enterprise Developer 5.0) or as "Resource Operation Value" for tools defined according to the new tool interface.

The resource operations to be processed by AWM are returned by the tool at run time by using specific syntax:

      operation(REFRESH,SELECT): properties 
    

See the following table for more information:

Keyword Description
operation * The resource operation to be executed.
Valid values:
  • INSERT-ELEMENT
  • INSERT-CHILD
  • REMOVE-ELEMENT
  • UPDATE-ELEMENT

The values are equivalent to the static resource operations INSERT, INSERT-CHILD, REMOVE, and UPDATE.

REFRESH [O] Determines whether to execute the "Get All Properties" action of the element. This action is executed directly after the tool that returned this resource operation.
SELECT [O] Selects the element in the view where the action was executed. Only relevant if the properties of the resource operation contain a valid element ID (combination of ID definition properties). See ID Definition for more information.
properties Depending on the resource operation, the following rules apply to tool output parameters:
  • INSERT-ELEMENT and INSERT-CHILD

    Requires all key properties of the element that should be created and the match name property. If the returned ID exists, an UPDATE is performed instead. Additional regular properties are added to the inserted or updated element.

  • REMOVE-ELEMENT

    Depending on whether key properties and the match name property are returned by the resource operation, either the identified element or the selected one is removed.

  • UPDATE-ELEMENT

    Only updates properties returned by the resource operation. Key properties and match name update a specific element. Without key properties, the selected element is updated.

Returned resource operation properties must be modeled as output parameters of the type ToolDefinedResourceOperation.

Example

UPDATE-ELEMENT: SCLM,DEV1,SOURCE,TESTRP1, 2014/03/21 09:16:28

This resource operation updates the changed date and time of an SCLM element with the ID SCLM_DEV1_SOURCE_TESTRP1 .