JavaProcessStarter Abstract Class
The JavaProcessStarter abstract class defines the interface of your Java Process Starter with the ActiveMatrix BusinessWorks process engine. You must define an implementation for the following methods:
-
init()
— this method is called when the process engine starts up. This method should initialize any resource connections. You could also specify a Java Global Instance on the Advanced tab that initializes resource connections. Java Global Instances are also loaded and initalized during process engine start up. You can callthis.getJavaGlobalInstance()
to obtain the Java Global Instance resource in your process starter code. -
onStart()
— this method is called by the process engine to activate the process starter. This method should activate any event notifier or resource observer code. The notifier or observer code can then call theonEvent()
method to start a process instance. -
onStop()
— this method is called by the process engine to deactivate the process starter. This method should deactivate any event notifier or resource observer code. -
onShutdown()
— this method is called by the process engine when the engine shuts down. This method should release any resources and resource connections and perform any required clean up operations.
The following methods are already implemented and can be used in your code:
-
onEvent(Object object)
— this method is called when a listener or resource observer catches a new event. The input to this method is a Java object containing the event data. -
getGlobalInstance()
— this method returns an object reference to the Java Global Resource specified on the Advanced tab of the process starter. This is useful if you want to place initialization code or other shared information in a Java Global Resource instead of in theinit()
method of this class. -
onError()
— this method throws the exception specified in the input parameter. Use this method to propagate an error to the ActiveMatrix BusinessWorks process instance when a listener or resource observer fails to generate an event.