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.
-
- On that server, host a Web server such as Microsoft IIS or Apache that can respond to HTTP requests for the SOAP service.
- 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.
- 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.
- Acquire a Java-to-COM bridge toolkit, such as NewJawin (available from SourceForge). Many similar tools are available from commercial and open sources.
- Using the toolkit, generate Java stubs from the DLL file.
- Using Eclipse or a similar Java IDE, compile the Java stubs, and create a Jar file.
-
Deploy the JAR file into the
Pega Platform
/lib
directory. -
Extract the JAR file contents into the
Pega Platform
/class
directory. - Stop and restart the application server.
- Use the Connector and Metadata wizard to create Connect Java rules ( Rule-Connect-Java rule types) from the CLASS files.
- Call the Java methods in an activity, using the Connect-Java method.
- 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.
Technical category