cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Engine Integration with Spring MVC

suoza
Champ in-the-making
Champ in-the-making
Hi,
I want to design a workflow base web application and the UI will be designed using spring mvc frame work and activiti engine as a backed.

I have few doubts.
1. Will the activiti process engine start from the spring context file or we should start it using a controller with load on start up process.
2. how will be the process get deployed ? Do we need to invoke the rest api for deployment of the bar or process xml files. If yes can you please share the rest api method which will be used.
3. If a custom form is used for a user task how will the form fields be mapped to process variables and how will it interact with the activiti tables at run time.


Please suggest.

Thanks in advance.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
2. how will be the process get deployed ? Do we need to invoke the rest api for deployment of the bar or process xml files. If yes can you please share the rest api method which will be used.
http://www.activiti.org/userguide/#N12F2D
in spring config you can use auto deployment too.

3. If a custom form is used for a user task how will the form fields be mapped to process variables and how will it interact with the activiti tables at run time.

http://www.activiti.org/userguide/#forms

martin_grofcik
Confirmed Champ
Confirmed Champ
1. Will the activiti process engine start from the spring context file or we should start it using a controller with load on start up process.

You can have a look on engine initialization from ProcessEngines class.


  protected static void initProcessEngineFromSpringResource(URL resource) {
    try {
      Class< ? > springConfigurationHelperClass = ReflectUtil.loadClass("org.activiti.spring.SpringConfigurationHelper");
      Method method = springConfigurationHelperClass.getMethod("buildProcessEngine", new Class<?>[]{URL.class});
      ProcessEngine processEngine = (ProcessEngine) method.invoke(null, new Object[]{resource});
     
      String processEngineName = processEngine.getName();
      ProcessEngineInfo processEngineInfo = new ProcessEngineInfoImpl(processEngineName, resource.toString(), null);
      processEngineInfosByName.put(processEngineName, processEngineInfo);
      processEngineInfosByResourceUrl.put(resource.toString(), processEngineInfo);
     
    } catch (Exception e) {
      throw new ActivitiException("couldn't initialize process engine from spring configuration resource "+resource.toString()+": "+e.getMessage(), e);
    }
  }

suoza
Champ in-the-making
Champ in-the-making
Hi Martin,

Thanks for the help.