Home Applications workshop-pex

workshop-pex

Community Project
This project is maintained by its author and is not officially supported by InterSystems. For technical support, please contact the project developer.
5
1 reviews
0
Awards
497
Views
0
IPM installs
1
Add to bundle
Details
Releases (1)
Reviews (1)
Issues
Articles (1)
Workshop: InterSystems IRIS Interoperability + PEX using Java

What's new in this version

Initial Release

Workshop: PEX

This repository contains the materials and some examples you can use to learn the basic concepts of PEX (Production EXtension) in IRIS Interoperability. Also this repository has been tested with the following OSs:

  • Windows

You can find more in-depth information in https://learning.intersystems.com.

New to IRIS Interoperability framework? Have a look at IRIS Interoperability Intro Workshop.

What do you need to install?

Setup

Build the image we will use during the workshop:

$ git clone https://github.com/intersystems-ib/workshop-pex
$ cd workshop-pex
$ docker compose build

Examples

(a). FirstDemo interoperability Production

  • Run the container we will use in the workshop:
docker compose up
  • Then copy the InterSystems Java libraries from the iris container, so VS Code can resolve the PEX classes when you edit the Java code. In a VS Code Terminal type:
docker cp iris:/usr/irissys/dev/java/lib/1.8/. java/lib

This copies the whole folder content, so it works regardless of the jar versions shipped with your IRIS image. The jars are git-ignored and https://github.com/intersystems-ib/workshop-pex/blob/master/.vscode/settings.json already adds java/lib/*.jar to the Java classpath (requires the Extension Pack for Java).

  • Open the Management Portal.
  • Login using the default superuser/ SYS account.
  • Click on Workshop.PEX.FirstDemo.Production to access the sample interoperability production we will use. You can access also through Interoperability > User > Configure > Production.

(b). Test MessageRouter + FirstOperation

  • Click on FirstOperation Business Operation.
  • Examine the Settings tab, pay attention to: Class Name and Remote Business Operation section. What is the Java Gateway server that is being used?
  • Click on MessageRouter Business Process.
  • In the Actions tab, click on Test. In the Request Type choose Ens.StringRequest and enter some text in the StringValue field. Send the test message.
  • Inspect the resulting Visual Trace.
  • Notice the message that receives each component and their contents.
  • Message Router transforms a Ens.StringRequest to a EnsLib.PEX.Message. You can see the data transform here Workshop.PEX.FirstDemo.DT.StringRequest2PEX.
  • FirstOperation is a very simple Business Operation that is implemented on Java. We will go through it in the next section.

(c). Understanding FirstOperation and Java Gateway

  • In VS Code, open https://github.com/intersystems-ib/workshop-pex/blob/master/java/src/workshop/pex/FirstOperation.java. This is the actual FirstOperation implementation.
  • Have a look at the methods and properties. Can you find where is handling the incoming FirstMessage request?
  • Go through https://github.com/intersystems-ib/workshop-pex/blob/master/iris/Dockerfile. This Dockerfile is responsible for:
    1. Compiling Java source code & building JAR files (FirstDemo.jar).
    2. Registering an External Language Server PEXJavaServer in IRIS, which starts and manages the Java Gateway process
    3. Loading the ObjectScript classes and setting the production to auto-start.
  • Notice that a dedicated jgw is no longer needed: the Java Gateway is handled by IRIS through an External Language Server (ELS). The IRIS image already includes a JDK 11 and the InterSystems Java libraries (/usr/irissys/dev/java/lib/1.8/, e.g. intersystems-utils-<version>.jar, which contains the PEX classes), so no builder stage is needed to build the image. The local copy in java/lib is only used by VS Code for editing.
  • Inspect https://github.com/intersystems-ib/workshop-pex/blob/master/docker-compose.yml and notice the only container we are using. In this scenario the gateway hostname is the same as IRIS’s hostname.

(d). Adding a Business Service and Business Process

(e). Make some changes

Explore more complex scenarios

Have a look at those great examples on using PEX with InterSystems IRIS:

Last checked by moderator
25 Aug, 2026,
Made with
Version
1.0.024 Feb, 2021
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
First published
24 Feb, 2021
Last edited
24 Feb, 2021