Enforcing the scope of private variables when using the executeServiceByName JavaScript API

When you use the executeServiceByName JavaScript API, you can provide a map with input variables. If an input variable name is identical to the name of a private variable of the called service, the API overwrites the value of the private variable. To preserve the application data of the called service, you can enforce the scope of the private variables by configuring a property in the 100Custom.xml file.

About this task

You can add a configurable property in the 100Custom.xml file with its value set to true to display an exception if the executeServiceByName JavaScript API tries to overwrite a private or output variable of the called service. An administrator can use this information to handle the problem. When the exception occurs, the service engine writes the following message to the SystemOut.log file:
VariableDoesNotExistException: CWTBG0543E: The variable variableName does not exist.

Procedure

  1. Stop the server for Process Server or Process Center.
  2. Locate and open the 100Custom.xml configuration file in a text editor.
  3. Add the following code to the file:
    <server>
        <service-engine>            
            <enforce-private-variable-scope>true</enforce-private-variable-scope>
        </service-engine>
    </server>
  4. Save your changes to the 100Custom.xml file.
  5. Start the server for Process Server or Process Center.