If you are a developer that are migrating from TIBCO BW 5 to TIBCO BW 6 and you have been working a bit with the new tools, you are probably aware that you don’t have a onStartup or onShutdown starter process like you have on your TIBCO BW 5 Designer. So, is it posible to have a process that execute when the application is starting or have we lost a useful feature? No, don’t worry my friend. You keep your same features but you have to do it using a different approach, but you are going to have the same functionality. Do you want to see it? Ok, let’s go for it!
To do that, we need to go first to our Module descriptor and on the overview panel you are going to find a “Activator Process” field like you can see here:
Using this button with the engine icon we can create an Activator Process, if we do that, we are going to have something like this:
And there we have a Process Activator with two operations. One for the onStartup procedure and the other for the onShutdown procedure. So here it’s all the things you are used to. You have to implement the operations. In this case, we are only adding a Log Activity to test the right behavior. So, the final process looks like this:
And now, if we run the process, we get the following stdout logs:
So, as you can see we are executing the onStartup process right before the application is started. That’s the main different between this approach and to use a normal BusinessWorks process with a Timer (once invocation) starter. The onStartup executes before the application is started and the Timer executes after the application is Started. The same thing happens with the onShutdown.
As usual, you can fing the source code from this sample in our GitHub repo: Download!