-
1. Re: How to update the process variable instances values dynamically in audit logs.
swiderski.maciej Aug 8, 2012 12:13 PM (in response to lingaiah.sundari)Could you elaborate little bit more on this and what is the issue? Is it that variable is not updated in BAM tables....
Would be perfect if you could provide a test case for it.
HTH
-
2. Re: How to update the process variable instances values dynamically in audit logs.
lingaiah.sundari Aug 9, 2012 7:08 AM (in response to swiderski.maciej)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.
)) {
new InitialContext().lookup( "java:comp/UserTransaction"UserTransaction ut = (UserTransaction)
);
new JPAWorkingMemoryDbLogger (ksessionut.begin();
);
ksessionKnowledgeRuntimeLoggerFactory.newConsoleLogger(
);
ksession.getWorkItemManager().registerWorkItemHandler("Log", newSystemOutWorkItemHandler());
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");
newMap<String, Object> params =
HashMap<String, Object>();
"customerProfile"params.put(
, customerProfile);
"employee", "lingaiah"params.put(
);
"reason", "CC Review Process"params.put(
);
ksession.startProcess("com.sample.bpmn.creditcardissueprocess",params);
ksessionThread.sleep(200);
.fireAllRules();
Thread.sleep(200);
ut.commit();
//logger.dispose();
-
3. Re: How to update the process variable instances values dynamically in audit logs.
swiderski.maciej Aug 9, 2012 7:17 AM (in response to lingaiah.sundari)Thanks for explanation. Could you please share the code that does the variable manipulation (script task, rule)?
Cheers
-
4. Re: How to update the process variable instances values dynamically in audit logs.
lingaiah.sundari Aug 9, 2012 7:31 AM (in response to swiderski.maciej)Hi Maciej Swiderski ,
Thank you very much.
Code : used MVEL - >Updated param customerProfile.cardIssueStatus , Customet profile object is added to Map params while starting the process.
System.out.println(
" In pre Processor : customerProfile.appliedLimit -> " + customerProfile.appliedLimit );if
(customerProfile.appliedLimit > 30000) {
truecustomerProfile.accessCreditCardService =
;
else}
{
" Credit Card Issue process is suspended due to applied limit is < 30K , Logged the status and sent eMail "customerProfile.cardIssueStatus =
;
" In pre Processor : customerProfile.accessCreditCardService -> "}
System.out.println(
+ customerProfile.accessCreditCardService );
" In pre Processor : customerProfile.cardIssueStatus -> "System.out.println(
+ customerProfile.cardIssueStatus );
"\n"System.out.println(
);
I am attaching the source code while editing the discussion.
-Regards,
Lingaiah.S
-
5. Re: How to update the process variable instances values dynamically in audit logs.
lingaiah.sundari Aug 9, 2012 7:40 AM (in response to lingaiah.sundari)Hi
I have attached the total source code while editing discussion - > jbpm5webexample.zip
Regards,
Lingaiah.S
-
6. Re: How to update the process variable instances values dynamically in audit logs.
swiderski.maciej Aug 9, 2012 7:53 AM (in response to lingaiah.sundari)if you are changing the variable in for instance script task make sure you set it as process variable to replace the old value otherwise it is only valid within scope of the task that is manipulating it.
HTH