JBoss Community

Re: how to setVariable

created by Juliano Dantas in jBPM - View the full discussion

I think this can help you:

 

public void setVariable(Long processInstanceId, String nome, Object value) {

       TransactionManager transactionManager = jBpmConfiguration.getTransactionManager();

       try {

            transactionManager.begin();

           

            RuleFlowProcessInstance processInstance = (RuleFlowProcessInstance) JBpmConfiguration.getInstance().getKnowledgeSession().getProcessInstance(processInstanceId);

            processInstance.setVariable(nome, value);

           

           transactionManager.commit();

        } catch (Exception e) {

            logger.error(e.getMessage());

        }

}

Reply to this message by going to Community

Start a new discussion in jBPM at Community