Create InterPlay exits

InterPlay exits are custom pieces of Java code used to perform application specific features.

Exits are mainly used to implement InterPlay functions (see InterPlay functions):

  • Check the values entered in the GUI.
  • Provide valid values for a certain field.
  • Modify the graphical properties of a certain field.
  • Check the values that you want to use in a mass update action.
  • Execute algorithms at save time to check that the changes on a collection/object/element are valid.
  • Initialize the newly created business entities (collections, objects, elements) with specific values. The user can create a new business entity by authoring, duplication.
  • Modify the business properties of Objects or elements when copying or moving them.
  • Modify the business properties of Collections or Objects at import time.

You can implement additional exits that:

  • Redefine the datasource connection parameters.
  • Transform the data format at import and export time.
  • Enable the status modification or perform an action when a status is modified to a target value.

You can also call rules from exits using the public API.

Exits must be:

  • Implemented in Java.
  • Integrated in the InterPlay Web Application archive.
  • Registered as spring beans.

Create exits

To add a new exit:

  1. Create a class that implements one of the Java interfaces located in the com.axway.interplay.spi.exit package.
  2. Navigate to the <InterPlayInstall> or <DesignerInstall> directories.
  3. Add the compiled Java class to the war/WEB-INF/classes directory.
  4. Register the exit via one of the following:

Registering in a specific directory

Add your exit in the war/ WEB_INF/classes/exits directory or in a sub-directory that you create.

The classes that you have created must be:

  • Included in the exits package or in a sub-package.
  • Annotated with a name that will be used in InterPlay to reference this exit.
    Example:
    package exits;
    @Service("identifierService")
    public class CheckUniqueValues implements ControlFunction
    {
    where identifierService is the name of the ControlFunction exit that will be referenced in the Functions calls.

Registering in any directory

  1. Add the exit to any sub-directory of the war/ WEB_INF/classes directory.
  2. Register the exit:
  • Either as a bean XML element in the war/ WEB_INF/classes/ interplayPublicContext.xml file:

<bean id="identifierService " class="subdir.CheckUniqueValues"/>

  • Or by adding a new component scan element in the interplayPublicContext.xml file
    <context:component-scan base-package="myCustomExits" />, provided that the new exits are all marked with the @Service tag and also that the .class files that correspond to them were placed inside war/WEB-INF/classes/myCustomExits folder.

Related Links