Complementing Find Element Usages, Replace Element Usages supports eSpaces refactoring by replacing all the usages found for an element with another element. In this way you can, for example, replace at any time, an entity usage by an entity reference usage if you choose to maintain it in a different eSpace.

How to use the Replace Element Usages:

  1. Right-click on the element in the eSpace tree or on the Content Canvas, and select the Find Usages... option. The Element Usages tab is displayed.

  1. Press the Replace All Usages With... button. The Replace <element> usages with window is displayed.

  1. Select the element to replace the one you've selected in step 1., in all its usages (queries, screen actions, screens, etc.) and press the OK button.

The Replace Element Usages window Show picture  lists all the eSpace elements of the same type of the element that is being replaced. Be aware that although actions can be classified differently (see the Action Flow Toolbox), as long as they can be invoked in an execute action, they are "interchangeable" in this replacement.

When you press OK in this window, Service Studio checks some conditions for the replacement. However, these are only informative and do not stop you from doing the replace operation:

Suppose you're replacing the Entity Intervinient by the Entity Client:

Suppose you're replacing Action ValidateIntervinient by the Action ValidateClient:

If these conditions are satisfied, the element usages are replaced by the new element with no further delay.

If one of these conditions is not satisfied, a contextual warning, like the following, is displayed:

You can decide whether or not to proceed with the replacement. You should avoid replacing elements whose attributes or parameters are not the same or that have different data types, in order to avoid verification errors.

After a Replace all Element usages operation is complete, the information of the replaces usages is displayed (at the bottom left corner of the tab).

The original element continues to exist in your eSpace, only its former usages were replaced by the new element usages.

See Also

Find Element Usages