JBoss Community

Re: How to update the process variable instances values dynamically in audit logs.

created by Lingaiah Sundari in jBPM - View the full discussion

Hi Maciej Swiderski,

 

   Thank you very much.

  

    I would like to update the process params in audit logs ( VariableInstanceLog)  , While starting the process the initial param value is inserted into audit logs , but in process update of the same param in the action script  or drools, the reset value is not updated in the audit logs.

 

   My aim is to update the process status in  the VariableInstanceLog audit log . I am using H2 in memory database, I am not sure any costraint with data base.

 

 

  While starting the process the initial param value is inserted into data base , but changed  param value  in progress process is not updated in audit log.

 

 

   I' have started the process using below code:  in middle of the process the param value is changed but it is not updated in the audit log end of the process. But the changed value is availabke

in WorkflowProcessInstance instance.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

if (action.equals("CreateProcess"

)) {

 

UserTransaction ut = (UserTransaction)

new InitialContext().lookup( "java:comp/UserTransaction"

);

ut.begin();

 

 

new JPAWorkingMemoryDbLogger (ksession

);

 

KnowledgeRuntimeLoggerFactory.newConsoleLogger(

ksession

);

 

 

ksession.getWorkItemManager().registerWorkItemHandler("Log", new

SystemOutWorkItemHandler());

 

 

ksession

.getWorkItemManager().registerWorkItemHandler(

 

"Email", new EmailWorkItemHandler("20.139.68.11","86400","lsundari","Shiva@2012"

));

 

 

//ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

 

CustomerProfile customerProfile =

new CustomerProfile(request.getParameter("fName"),request.getParameter("lName"),Integer.parseInt(request.getParameter("age")),Integer.parseInt(request.getParameter("aLimit")),Integer.parseInt(request.getParameter("mSalary")),request.getParameter("eMail"),"TODO","TODO"

);

Map<String, Object> params =

new

HashMap<String, Object>();

params.put(

"customerProfile"

, customerProfile);

params.put(

"employee", "lingaiah"

);

params.put(

"reason", "CC Review Process"

);

 

 

 

 

ksession.startProcess("com.sample.bpmn.creditcardissueprocess"

,params);

Thread.sleep(200);

 

ksession

.fireAllRules();

Thread.sleep(200);

ut.commit();

 

//logger.dispose();

 

 

  

  



Reply to this message by going to Community

Start a new discussion in jBPM at Community