05-28-2012 07:32 AM
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("my_object_class", myObject.getClass().getName());
variables.put("my_object_id", myObject.getId());
runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
private List<ProcessInstance> returnProcessInstances(MyObject myObject) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("my_object_class", myObject.getClass().getName());
variables.put("my_object_id", myObject.getId());
for(Map.Entry<String, Object> variable : variables.entrySet()) {
query.variableValueEquals(variable.getKey(), variable.getValue());
}
return query.list();
}
05-28-2012 08:56 AM
05-28-2012 09:41 AM
Where is your query defined and what is it?
private List<ProcessInstance> returnOngoingProcessInstances(MyObject myObject) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("my_object_class", myObject.getClass().getName());
variables.put("my_object_id", myObject.getId());
ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();
for(Map.Entry<String, Object> variable : variables.entrySet()) {
query.variableValueEquals(variable.getKey(), variable.getValue());
}
return query.list();
}
05-28-2012 11:54 AM
05-28-2012 01:49 PM
Uhhhmmmm did you have a look at chapter 11 from the documentation?
HistoryProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery();
I had tried different ways to use the HistoryProcessInstanceQuery with variables, without success. When the process instance was executing it was easy (first post).
ID_ PROC_INST_ID_ PROC_DEF_ID_
5 5 teste:1:4
6 6 teste:1:4
7 7 teste:1:4
ID_ TYPE_ PROC_INST_ID_ NAME_ LONG_ TEXT_
10 VariableUpdate 5 obj_class NULL com.myapp.order
8 VariableUpdate 5 obj_id 9876 9876
14 VariableUpdate 6 obj_class NULL com.myapp.order
12 VariableUpdate 6 obj_id 12345 12345
16 VariableUpdate 7 obj_class NULL com.myapp.order
14 VariableUpdate 7 obj_id 12345 12345
05-28-2012 09:31 PM
HistoricProcessInstance.processInstanceId()
05-29-2012 03:35 AM
05-29-2012 06:04 AM
why don't you use the businesskey concept of activiti? or do like rogerofyan did store things the othe way around
08-16-2012 12:13 PM
01-21-2014 06:45 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.