TIBCO Java Event Source
TIBCO Java event source activity gives you the flexibility to write custom process starters. In following post we will create a simple project where we use the event source plugin.
The java source code and the tibco project can be found here.
Do a maven clean install on the java project a jar file is created that should be imported as alias library to the tibco project.
The java project consist of the class “ProcessStarter” which extends the tibco process starter.
/** * * @param processName sampleInputParam * @throws Exception exception */ public void initProcess(final String processName) throws Exception { this.processName = processName; init(); } @Override public void init() throws Exception { LOGGER.info("[ProcessStarter] Initializing " + processName + " Proces Starter"); //Some init code LOGGER.info("[ProcessStarter] Successfully Initialized Proces Starter"); }
/** * * @param processName sampleInputParam * @throws Exception exception */ public void initProcess(final String processName) throws Exception { this.processName = processName; init(); } @Override public void init() throws Exception { LOGGER.info("[ProcessStarter] Initializing " + processName + " Proces Starter"); //Some init code LOGGER.info("[ProcessStarter] Successfully Initialized Proces Starter"); }
Following is how its called from tibco
The out put from event source is a java object we convert it to a string using the java method activity the code is
public String getMessageBodyAsString(final Object message) { final MessageDataType messageDataType = (MessageDataType) message; return messageDataType.toString(); }
and tibco activity configuration is
When you run the process it is executed 10 times and a string plus the thread index string is the output.