4 Replies Latest reply on Mar 31, 2015 4:28 AM by chiaan Hung

    How can I change RuntimeEnvironment without restarting wildfly-8.1.0.Final?

    chiaan Hung Novice

      I create RuntimeEnvironment by RuntimeEnvironmentBuilder.


          public RuntimeEnvironment produceEnvironment(EntityManagerFactory emf) {
              AbstractAuditLogger auditlogger = null;
              RuntimeEnvironmentBuilder a  = RuntimeEnvironmentBuilder
                      .registerableItemsFactory(InjectableRegisterableItemsFactory.getFactory(beanManager, auditlogger));
             RuntimeEnvironment environment = a.get();
              ((SimpleRegisterableItemsFactory) environment.getRegisterableItemsFactory()).addWorkItemHandler("xx", handler.TestWorkItemHandler1.class);
              return environment;


      I create TaskService and RuntimeManager by cdi.

      private RuntimeManager manager;


      TaskService taskService;



      I found out that produceEnvironment function is not called when I start a new process.

      In ths case, everytime I want to add a new bpmn file I need to restart wildfly-8.1.0.Final. How can I avoid that?