Refactoring a REST Service or Reference

You can change the configuration of your REST service even after it is created in TIBCO Business Studio for BusinessWorks.

The steps to update a service configuration depends on whether the service was created from an imported Swagger file or whether the service was created ground up in TIBCO Business Studio for BusinessWorks.

Updating a service created from an imported Swagger file

You can use a Swagger file to either create a service by implementing the contract in it or you can use it to call a service that implements the Swagger file. If the Swagger file you used to create your service or reference gets updated by its provider, you may need to update your implementation of that file in order to get the changes.

The icon to the left of the Swagger file in the Project Explorer in the TIBCO Business Studio for BusinessWorks displays an indication that the file has been modified in its original location and the local copy of the file is not in synchronization with it source. You can compare the differences between the two and update your local copy if need be. To do so, follow these steps:

Procedure

  1. Right-click the Swagger file under Service Descriptors in the Project Explorer.
  2. Select Remote Interface.
    Check for Differences checks for differences between the imported copy and its original.

    Compare Differences first checks for differences between the imported copy of the Swagger file and its original. If there is a difference, the file will appear in the Synchronize tab and if you double click it there it displays the two files side by side with the differences highlighted.

    Update Local Copy updates the copy of the file in your workspace to match the source. It also regenerates the schema. It updates it in both the service and reference.

    Note: Nothing changes for processes that have already been created.

Updating a service that was created ground up in TIBCO Business Studio for BusinessWorks

As you change your implementation of the service or reference, TIBCO Business Studio for BusinessWorks automatically generates the Swagger file to match your changes.