Package org.cristalise.kernel.process
Class UserCodeVerticle
java.lang.Object
io.vertx.core.AbstractVerticle
org.cristalise.kernel.process.UserCodeVerticle
- All Implemented Interfaces:
io.vertx.core.Verticle
public class UserCodeVerticle
extends io.vertx.core.AbstractVerticle
Provides a very basic automatic execution of Scripts associated with the Jobs (Activities).
It listens to the proxyMessage channel for cluster storage updates of Jobs of the UseCode Agent.
The processing of ProxyMessages assumes that a single message contains Jobs of the same Item.
Execution is based on the Default StateMachine, and it implements the following sequence:
1. assessStartConditions() 2. start() 3. complete() 4. in case of error/exception during complete() execute error transition (e.g. Suspend for default StateMachine)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefines the value (value:"USERCODE_IGNORE") to to be used in CRISTAL Property to ignore the Jobs of that Transition eg: UserCode.StateMachine.resumeTransition = USERCODE_IGNOREFields inherited from class io.vertx.core.AbstractVerticle
context, vertx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanassessStartConditions(Job job) Override this method to implement application specific evaluation of start condition.voidMethod called to handle the Complete transition.protected voidvoidrunUserCodeLogic(Job job, Job errorJob) Override this method to implement application specific (business) logic Default implementation - the agent execute any scripts, query or both definedvoidvoidMethod called to handle the Start transition.Methods inherited from class io.vertx.core.AbstractVerticle
config, deploymentID, getVertx, init, processArgs, start, stop, stop
-
Field Details
-
USERCODE_IGNORE
Defines the value (value:"USERCODE_IGNORE") to to be used in CRISTAL Property to ignore the Jobs of that Transition eg: UserCode.StateMachine.resumeTransition = USERCODE_IGNORE- See Also:
-
-
Constructor Details
-
UserCodeVerticle
Constructor set up the user code
-
-
Method Details
-
start
- Specified by:
startin interfaceio.vertx.core.Verticle- Overrides:
startin classio.vertx.core.AbstractVerticle- Throws:
Exception
-
process
- Parameters:
thisJob-errorJob-
-
start
Method called to handle the Start transition. Override this method to implement application specific action for Jobs of Start Transition.- Parameters:
thisJob- the actual Job to be executed.- Throws:
CriseVertxException
-
complete
Method called to handle the Complete transition. Override this method to implement application specific action for Jobs of Complete Transition.- Parameters:
thisJob- the actual Job to be executed.erroJob- the error Job to be executed in case of error- Throws:
Exception
-
assessStartConditions
Override this method to implement application specific evaluation of start condition. Default implementation - returns always true, i.e. there were no start conditions.- Parameters:
job- the actual Job to be executed.- Returns:
- true, if the start condition were met
-
runUserCodeLogic
Override this method to implement application specific (business) logic Default implementation - the agent execute any scripts, query or both defined- Parameters:
job- the actual Job to be executed.errorJob- Job to be executed in case of an error- Throws:
CriseVertxException
-