0 Replies Latest reply on Nov 27, 2013 2:30 PM by Mike Wells

    update a process variable in jbpm 5.2

    Mike Wells Newbie

      Hi,

       

      I was wondering if anyone knows how to update/change a process variable in a jbpm workflow from external java code after the workflow has been started? Currently I have tried:

       

      final WorkflowProcessInstance p = (WorkflowProcessInstance) processInstance;

       

      final TransactionTemplate txTemplate = new TransactionTemplate(transactionManager);

       

        txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        txTemplate.execute(new TransactionCallback<AcceptanceReport>() {

           public AcceptanceReport   doInTransaction(TransactionStatus status) {

            p.setVariable("gAccept", gAccept);

          

            return gAccept;   

           }

      });

       

      I am using spring 3.0 and JPA.   @Transactional does not seem to work.

       

      Please Help.