How to call a Windows DLL library

The Pega Platform includes Service COM rules, which allow a Windows-based application to request services from a Pega Platform application. However, some applications need the complementary capability — calling a Windows application or DLL.

Use either of two procedures to call from your application a routine within a Windows Dynamic Linked Library (DLL) file. Java developer skills are required.

SOAP approach

This approach works even when your Pega Platform server is hosted by a non-Windows platform, such as Sun Solaris. However, use of a SOAP service and HTTP may introduce processing overhead and delays.

  1. On a Windows (server) platform, use Microsoft's SOAP Toolkit (or similar facilities in the .NET Framework toolkit) to wrap the DLL so that it is callable as a SOAP service.
  2. On that server, host a Web server such as Microsoft IIS or Apache that can respond to HTTP requests for the SOAP service.
  3. On the Pega Platform server, use the WSDL file describing the SOAP services with the Connector and Metadata wizard to create Connect SOAP rules for the DLL routines.
  4. Add an Integrator shape to a flow rule (or update other processing in your application) to call the Connect SOAP rule, which in turn calls the DLL function.

Bridge approach

This approach is useful only when your Pega Platform server is — and always will be — hosted on a Windows platform.

This implementation approach depends on third-party facilities that are not licensed, endorsed, or distributed by Pegasystems Inc.

  1. Acquire a Java-to-COM bridge toolkit, such as NewJawin (available from SourceForge). Many similar tools are available from commercial and open sources.
  2. Using the toolkit, generate Java stubs from the DLL file.
  3. Using Eclipse or a similar Java IDE, compile the Java stubs, and create a Jar file.
  4. Deploy the JAR file into the Pega Platform /lib directory.
  5. Extract the JAR file contents into the Pega Platform /class directory.
  6. Stop and restart the application server.
  7. Use the Connector and Metadata wizard to create Connect Java rules ( Rule-Connect-Java rule types) from the CLASS files.
  8. Call the Java methods in an activity, using the Connect-Java method.
  9. Incorporate the activity into a flow rule or into other processing in your application.

In simple cases, you can skip steps 8 and 9 and call the Java methods directly from a Java step in an activity.