EBI External Notifications API Windows Example with 3 Arguments (property values)
The below examples uses the baseline EXTOL set-up of EXTOL's SendEbiItmNotif.java program.
We customized SendEbiItmNotif.java to allow for users to enter 3 arguments (properties) to be passed to an EXTOL Event.
Shipped EXTOL Items
Create EBI Objects for Testing api.notification event
Create api.notification event
Since our updated program SendEbiItmNotif.java is passing 3 property values to the api.notification event, we will set up the event to accept the 3 properties:
Create api.notification BPS
After we create the api.notification event, we will set-up a BPS called: notificationAPI. Once created, we will tie the BPS to the event.
Updated EbiNotificationAPI.bat
Below is a customized EbiNotificationAPI.bat script. The bold items are to be replaced.
Note: For testing purpuses we unarchived the development artifacts of EBI_Notifications_2.x.zip into the the directory: C:\EBI26\APINotify\
On the line that begins with java we pass in "EXTOL" "BUSINESS" "INTEGRATOR" . These are the 3 values we expect to see in the EXTOL Business Process script, as script parameters.
@ECHO OFF SET JAVA_HOME=C:\EBI26\jre\bin SET CD=C:\EBI26\APINotify\ebi_notification SET CLASSPATH=.;%CD%;%CD%\conf;%CD%\lib;%CD%\lib\EBI.jar;%CD%\lib\jbossall-client.jar;%CD%\lib\jboss-j2ee.jar;%CD%\lib\log4j.jar;%CD%\lib\dom4j.jar SET PATH=%JAVA_HOME%;%CD% ECHO Running Java Class java SendEbiItmNotif "notification.api" "EXTOL" "BUSINESS" "INTEGRATOR" 100 "Triggered Event" ECHO Successfully ran Java Class
Update jndi.properties
Update the bold item if .bat does not reside on same machine as EBI Server.
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=jnp://localhost:1099
Modified SendEbiItmNotif.java
Below is the modified version of SendEbiItmNotif.java. In our modified example we added the ability to pass 3 property values. These values will be passed to the event api.notification
Compile SendEbiItmNotif.java
C:\EBI26\APINotify\ebi_notification>javac -classpath .;C:\EBI26\APINotify\ebi_notification\lib\EBI.jar SendEbiItmNotif.java
Testing Modified SendEbiItmNotif.java
Once the .bat file is set-up, the java source has been compiled, and the .jndi file reviewed we can execute EbiNotificationAPI.bat
When we run the .bat file from a DOS command, we should see the following:
DOS Command Window
C:\EBI26\APINotify\ebi_notification>EbiNotificationAPI.batRunning Java Class
Arguments:
0) notification.api
1) EXTOL
2) Business
3) Integrator
4) 100
5) Triggered Event
formattedTypeLength (prior to trimming): 16
formattedTypeLength (after to trimming): 16
...constructing the SendEbiItemNotif object...
log4j:WARN No appenders could be found for logger (org.jboss.mq.referenceable.Sp
yConnectionFactoryObjectFactory).
log4j:WARN Please initialize the log4j system properly.
...decorating the notification with the item key value, notification message, an
d sequence number...
...sending the Notification object to EBI...
...sent successfully...
Successfully ran Java Class
EBI Auditor Window
Below we see the 3 property values originally from EbiNotificationAPI.bat
As we can see, the values from the .bat file (and DOS Window) of "EXTOL" "BUSINESS" "INTEGRATOR" are present as script parameters.
By: Sean Hoppe on