@Target(value=METHOD) @Retention(value=RUNTIME) public @interface PostDeploy
Annotation that can be placed on a method of a ProcessApplication
class.
The method will be invoked after the process application has been successfully deployed, meaning that
ProcessEngines
, all process
engines have been successfully started and can be looked up.LIMITATION: the annotation must be placed on a method of the same class carrying the
@ProcessApplication
annotation. Methods of superclasses are not detected.
NOTE: A process application class must only define a single @PostDeploy
Method.
NOTE: if the @PostDeploy method throws an exception, the deployment of the process application will be rolled back, all process engine deployments will be removed and all process engines defined by this application will be stopped.
@ProcessApplication("My Process Application") public class MyProcessApplication extends ServletProcessApplication { @PostDeploy public void startProcess(ProcessEngine processEngine) { processEngine.getRuntimeService() .startProcessInstanceByKey("invoiceProcess"); } }
A method annotated with @PostDeploy
may additionally take the following set of
parameters, in any oder:
ProcessApplicationInfo
: the ProcessApplicationInfo
object for this process application is injectedProcessEngine
the default process engine is injectedList<ProcessEngine>
all process engines to which this process application has performed deployments are
injected.PreUndeploy
Copyright © 2019. All rights reserved.