Create an inbound file integration

PolicyCenter uses inbound file integration to read information from files that an external system creates. This integration can be either a message reply plugin or a startable plugin.

The base configuration of PolicyCenter provides implementations for the message reply plugin and the startable plugin for inbound file integration. You can use these plugins as a template for your own plugin. PolicyCenter also provides implementations for the message reply handler plugin and the startable handler plugin for inbound file integration. You can use these plugins as a template for your own handler plugin. You provide the handler class that implements your business logic.

Procedure

  1. In the Project window, navigate to configuration > config > integration, and open the file inbound-integration-config.xml.
  2. Configure the thread pools.
    You can use a thread pool element in the base configuration as a template.
  3. In the list of integrations, create one <integration> element of type <file-integration>.
    You can use a <file-integration> element in the base configuration as a template.
  4. Set configuration parameter subelements, ensuring that the order of subelements is correct.
    The inbound-integration-config.xsd file specifies the correct sequence of the subelements.
  5. Create the inbound file integration plugin.
    1. In Studio, in the Plugins registry, add a new .gwp file.
    2. Studio prompts for a plugin name and plugin interface. For the plugin name, use a name that represents the purpose of this specific inbound integration. For the Interface field, enter one of the following values.
      • For a message reply plugin, type InboundIntegrationMessageReply.
      • For a startable plugin for non-messaging use, type InboundIntegrationStartablePlugin.
    3. Click the plus (+) symbol to add a plugin implementation and choose Add Java plugin.
    4. In the Java class field, enter one of the following plugin types.
      • For a message reply plugin, type com.guidewire.pl.integration.inbound.file.DefaultFileInboundIntegrationMessageReply.
      • For a startable plugin for non-messaging use, type com.guidewire.pl.integration.inbound.file.DefaultFileInboundIntegrationPlugin.
    5. Add a plugin parameter with the key integrationservice. For the value, type the unique name for your integration that you used in inbound-integration-config.xml for this integration.
  6. Write your own inbound integration handler plugin implementation.
    • For a message reply plugin, your handler code must implement the plugin interface gw.plugin.integration.inbound.InboundIntegrationMessageReplyHandler.
    • For a startable plugin for non-messaging use, your handler code must implement the plugin interface gw.plugin.integration.inbound.InboundIntegrationHandlerPlugin.
    Both interfaces have one method called process, which has a single argument of type Object. The method has no return value. The file integration calls that method to process one message. Downcast this Object to String or java.nio.file.Path before using it.
  7. Create the inbound file integration handler plugin to register your handler plugin implementation class.
    1. In Studio, in the Plugins registry, add a new .gwp file.
    2. Set the interface name to the handler interface that you implemented.
      The Name field must match the <pluginhandler> subelement in the inbound-integration-config.xml file for this integration.
    3. Click the plus (+) symbol to add a plugin implementation and choose the type of class that you implemented.
    4. In the class name field, type or navigate to the class that you implemented.
  8. Start the server in Guidewire Studio and test your new inbound integration by placing one or more files in the incoming directory.
    If inbound file integration does not succeed, review your antivirus settings on this server. Some antivirus applications interfere with file notifications that normal inbound file integration requires.

What to do next

See also