[jboss-user] [jBPM] - Re: Link the business object to the process instance

Pedro Gonçalves do-not-reply at jboss.com
Tue Jun 19 06:41:14 EDT 2012


Pedro Gonçalves [https://community.jboss.org/people/pgoncalves] created the discussion

"Re: Link the business object to the process instance"

To view the discussion, visit: https://community.jboss.org/message/742644#742644

--------------------------------------------------------------
Thanks Mauricio.
I've used the Variables to build Business Keys.

This is how I've managed to solve the problem:



//......Start process......
Map<String, Object> variables = new HashMap<String, Object>();
 
variables.put("business_key", buildBusinessKeyForMyObject(myObject));
 
kSession.startProcess("my_workflow_id",variables);
//......................................
 
 
 
//.........Get Process Instances Id of My Object.......
Query query = entityManager.createQuery("FROM " + VariableInstanceLog.class.getName() + " variable " +
      " WHERE variable.variableId = :business_key_id
         AND variable.value = :business_key_value);
 
     query.setParameter("business_key_id", "business_key");
     query.setParameter("business_key_value", buildCoreDataBusinessKey(coreData));
 
     List<VariableInstanceLog> resultList = query.getResultList();
 
for (VariableInstanceLog variableInstanceLog : resultList) {
     logger.info("******* " + variableInstanceLog.getProcessInstanceId());
}
//...............................................................
 
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/742644#742644]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120619/d074db82/attachment.html 


More information about the jboss-user mailing list