19 September 2016

1. Goals

The goal of this tutorial is to understand File Update Operation of Configurable RESTful Web Services.

This operation can be used for checking in file(s) to an object in ENOVIA. In this tutorial the use case is to set up an integration that performs this operation.

1.1. Configuration File Structure

During this tutorial, we are going to create the following kind of configuration file structure.

file checkin
Figure 1. Configuration File Structure

2. Use Case Flow

In brief, the flow in this tutorial is the following:

  1. Client sends a HTTP request containing necessary information.

  2. Web service corresponding to the request is located.

  3. The IdLocator is executed. The IdLocator is responsible for locating the object that client is interested in. This is done by using parameters associated in the request.

  4. The Operation is executed. The operation is the actual job to perform. For example, check in files to an object.

  5. The response is sent back to the client.

3. Configuration for Check-in

On the TIF server we need to create a XML configuration file for the web service that allows to check in files into an object.

${TIF_ROOT}/modules/enovia/cfg/restservice/File_Checkin.xml
<Rest>
    <DisplayName>File Check-in</DisplayName> (1)
    <ServiceName>filecheckin</ServiceName> (2)
    <IdLocator type="tnr">
        <AllowWildcards>true</AllowWildcards>
    </IdLocator> (3)
    <Update type="file" (4)
            format="generic" (5)
            existStrategy="newversion" (6)
            useCDM="true" /> (7)
</Rest>
1 User friendly name of the service that is visible in Admin UI.
2 Unique name of the service that is used by clients to access the service.
3 Defines how to find the object the client is interested in. In this tutorial we are going to use TNR IdLocator that uses type, name and revision to identify the object.
4 This web service provides an update operation of type file.
5 File is in "generic" format.
6 Exist strategy is "newversion" meaning that a new version is created if file already exist.
7 Common Document Model or CDM must be enabled as we use "newversion" exist strategy.

4. Testing Check-in

In this example "Postman" tool (available as a Chrome plugin) is used for testing.

We use PUT method and pass TNR ("CAD Drawing", A-0000100", "A") as query parameters for the id locator.

Two files "Example1.docx" and "Example2.txt" are added to the body of the request.

file checkin postman 1
Figure 2. Check-in of Files

The response status "200/OK" indicates the files were checked in successfully.