Java Code Examples for org.camunda.bpm.application.ProcessApplicationInterface#execute()

The following examples show how to use org.camunda.bpm.application.ProcessApplicationInterface#execute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePostDeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException, StartException {
  Class<?> paClass = getPaClass(postDeployDescription);
  final Method postDeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PostDeploy.class);

  if(postDeployMethod != null) {
    try {
      processApplication.execute(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          postDeployMethod.invoke(processApplication.getRawObject(), getInjections(postDeployMethod));
          return null;
        }
      });
    }catch(Exception e) {
      throw new StartException("Exception while invoking the @PostDeploy method ", e);
    }
  }

}
 
Example 2
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePreUndeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException {
  if(preUndeployDescription != null) {
    Class<?> paClass = getPaClass(preUndeployDescription);
    final Method preUndeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PreUndeploy.class);

    if(preUndeployMethod != null) {
      try {
        processApplication.execute(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            preUndeployMethod.invoke(processApplication.getRawObject(), getInjections(preUndeployMethod));
            return null;
          }
        });
      } catch(Exception e) {
        throw new RuntimeException("Exception while invoking the @PreUndeploy method ", e);
      }
    }
  }

}
 
Example 3
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePostDeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException, StartException {
  Class<?> paClass = getPaClass(postDeployDescription);
  final Method postDeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PostDeploy.class);

  if(postDeployMethod != null) {
    try {
      processApplication.execute(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          postDeployMethod.invoke(processApplication.getRawObject(), getInjections(postDeployMethod));
          return null;
        }
      });
    }catch(Exception e) {
      throw new StartException("Exception while invoking the @PostDeploy method ", e);
    }
  }

}
 
Example 4
Source File: ProcessApplicationStartService.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void invokePreUndeploy(final ProcessApplicationInterface processApplication) throws ClassNotFoundException {
  if(preUndeployDescription != null) {
    Class<?> paClass = getPaClass(preUndeployDescription);
    final Method preUndeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PreUndeploy.class);

    if(preUndeployMethod != null) {
      try {
        processApplication.execute(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            preUndeployMethod.invoke(processApplication.getRawObject(), getInjections(preUndeployMethod));
            return null;
          }
        });
      } catch(Exception e) {
        throw new RuntimeException("Exception while invoking the @PreUndeploy method ", e);
      }
    }
  }

}