Configuring REST Services

The Process Engine REST Service servlet reads configuration settings from a configuration file. This file assigns the Content Engine URI, the connection point needed for the REST Service servlet to establish a session with the Process Engine, and defines the handler classes for the REST resources. When deployed in Workplace XT, the Content Engine URI from the WcmApiConfig.properties for Workplace XT is used (install_location\FileNet\WebClient\WorkplaceXT\WEB-INF\WcmApiConfig.properties).

If the Process Engine REST Service servlet is deployed as a standalone Web application, the standalone attribute needs to be set to true, and the Content Engine URI must be set to a valid value.

You can make changes to this configuration file (in the deployed directory). However, modifying the file will require that the Web application containing the REST Service servlet (defaults to IBM FileNet Workplace XT) will need to be restarted, since the REST Service servlet reads the configuration only upon initialization.

REST Services Configuration File

The REST Services configuration file is installed in the following location:

    install_location\FileNet\WebClient\WorkplaceXT\WEB-INF\P8BPMRESTConfig.xml

Configuration File Schema

The XML schema for the configuration file is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.ibm.com/p8/bpm/v1/rest/config/schema" targetNamespace="http://www.ibm.com/p8/bpm/v1/rest/config/schema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="P8BPMREST">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="version.path">
                    <xs:complexType>
                        <xs:attribute name="value" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="filenet.pe.bootstrap.ceuri">
                    <xs:complexType>
                        <xs:attribute name="value" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="connection.point">
                    <xs:complexType>
                        <xs:attribute name="value" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="resource.handler" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="path" type="xs:string" use="required"/>
                        <xs:attribute name="className" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="standalone" type="xs:boolean" default="false" use="optional"/>
        </xs:complexType>
    </xs:element>
</xs:schema>

Example Configuration File

The following is an example of a working configuration file:

<perest:P8BPMREST xmlns:perest="http://www.ibm.com/p8/bpm/v1/rest/config/schema" perest:standalone="false">
    <perest:version.path value="/p8/bpm/v1"/>
    <perest:filenet.pe.bootstrap.ceuri value="iiop://cm-peru:2809/FileNet/Engine"/>
    <perest:connection.point value="RESTCP"/>



    <perest:resource.handler path="workclasses" className="filenet.pe.rest.handlers.WorkClasses"/> 
    <perest:resource.handler path="workclasses/{workclassName}" className="filenet.pe.rest.handlers.AWorkClass"/> 
    <perest:resource.handler path="rosters/{rosterName}/wc/{workclassName}/wob/{wobID}" className="filenet.pe.rest.handlers.WorkClassLauncher"/> 
    <perest:resource.handler path="appspaces/{appspace}/myroles" className="filenet.pe.rest.handlers.Roles"/> 
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}" className="filenet.pe.rest.handlers.Role"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/attributes" className="filenet.pe.rest.handlers.RoleAttributes"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}" className="filenet.pe.rest.handlers.WorkBasket"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}/filters" className="filenet.pe.rest.handlers.WorkBasketFilters"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}/filters/{filterName}/attributes" className="filenet.pe.rest.handlers.WorkBasketFilterAttributes"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}/columns" className="filenet.pe.rest.handlers.WorkBasketColumns"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}/attributes" className="filenet.pe.rest.handlers.WorkBasketAttributes"/>
    <perest:resource.handler path="appspaces/{appspace}/roles/{roleName}/{queueName}/workbaskets/{workBasketName}/queueelements" className="filenet.pe.rest.handlers.QueueElements"/>
    <perest:resource.handler path="queues/{queueName}/stepelements/{wobID}" className="filenet.pe.rest.handlers.StepElement"/>
</perest:P8BPMREST>