This content has been marked as final.
Show 2 replies
-
1. Re: Link the business object to the process instance
salaboy21 Jun 18, 2012 11:53 AM (in response to pgoncalves)Using variables and persisters you can achieve that.. The history will be keep by the history loggers.
Variables and Persisters do the Business keys for you.
-
2. Re: Link the business object to the process instance
pgoncalves Jun 19, 2012 6:41 AM (in response to salaboy21)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()); } //...............................................................