01-10-2013 05:35 AM
historyService.createHistoricDetailQuery()
.formProperties()
.processInstanceId("123")
.orderByVariableName().asc()
.list()
should get […] all form-properties that were submitted in any task or when starting the process with id "123"
String processInstanceId = historyService
.createHistoricTaskInstanceQuery().taskId(taskId)
.singleResult().getProcessInstanceId();
List<HistoricDetail> historicFormProperties = historyService
.createHistoricDetailQuery()
.processInstanceId(processInstanceId).formProperties()
.orderByTime().desc().list();
and the XML of my Start-Element like this:
<startEvent id="_8" isInterrupting="true" name="neues Praxissemester" parallelMultiple="false">
<extensionElements>
<activiti:formProperty id="student" name="Student" required="true" type="string" variable="student"/>
<activiti:formProperty id="studentMail" name="Student-Mail-Adresse" required="true" type="string" variable="studentMail"/>
… more FormProperties
</startEvent>
01-10-2013 07:46 AM
Map<String, String> formProperties = new HashMap<String, String>();
formProperties.put("formProp1", "Activiti rocks");
formProperties.put("formProp2", "12345");
ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey("historicFormPropertiesProcess").singleResult();
ProcessInstance processInstance = formService.submitStartFormData(procDef.getId() , formProperties);
…
// 4 historic form properties should be created. 2 when process started, 2 when task completed
List<HistoricDetail> props = historyService.createHistoricDetailQuery()
.formProperties()
.processInstanceId(processInstance.getId())
.orderByFormPropertyId().asc()
.list();
HistoricFormProperty historicProperty1 = (HistoricFormProperty) props.get(0);
assertEquals("formProp1", historicProperty1.getPropertyId());
assertEquals("Activiti rocks", historicProperty1.getPropertyValue());
…
01-14-2013 01:49 AM
runtimeService.startProcessInstanceByKey("key", processVariables);
to start the process and expected it to work like
formService.submitStartFormData(definition.getId(), processVariables);
So I changed that method call, when trying to start the process, and now everything works just fine.
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.