The task is completed and I have to update the value of bytearray in act_ge_bytearray table. Please suggest me
Solved! Go to Solution.
I'm sorry that the answer was delayed.
I made the sample code to modify binary variable after process completing.
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().addInputStream("myProcess.bpmn20.xml", new FileInputStream(filename))
.deploy();// Process executed
Map<String, Object> var1 = new HashMap<String, Object>();
var1.put("aaa", "bbb");
Map<String, Object> var = new HashMap<String, Object>();
var.put("var1", var1);
ProcessInstance pi = processEngine.getRuntimeService().startProcessInstanceByKey("myProcess", var);
Task task = processEngine.getTaskService().createTaskQuery().processInstanceId(pi.getId()).singleResult();
processEngine.getTaskService().complete(task.getId());// Alteration of history
((ProcessEngineConfigurationImpl) processEngineConfiguration).getCommandExecutor().execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
HistoricVariableInstance historicVar = processEngine.getHistoryService().createHistoricVariableInstanceQuery().processInstanceId(pi.getId()).singleResult();
HistoricVariableInstanceEntity entity = (HistoricVariableInstanceEntity) historicVar;
var1.put("ccc", "ddd");
final VariableTypes variableTypes = Context.getCommandContext().getProcessEngineConfiguration().getVariableTypes();
final VariableType variableType = variableTypes.findVariableType(entity.getValue());
entity.setVariableType(variableType);
variableType.setValue(var1, entity);
return null;
}
});
I'm sorry that the answer was delayed.
I made the sample code to modify binary variable after process completing.
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().addInputStream("myProcess.bpmn20.xml", new FileInputStream(filename))
.deploy();// Process executed
Map<String, Object> var1 = new HashMap<String, Object>();
var1.put("aaa", "bbb");
Map<String, Object> var = new HashMap<String, Object>();
var.put("var1", var1);
ProcessInstance pi = processEngine.getRuntimeService().startProcessInstanceByKey("myProcess", var);
Task task = processEngine.getTaskService().createTaskQuery().processInstanceId(pi.getId()).singleResult();
processEngine.getTaskService().complete(task.getId());// Alteration of history
((ProcessEngineConfigurationImpl) processEngineConfiguration).getCommandExecutor().execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
HistoricVariableInstance historicVar = processEngine.getHistoryService().createHistoricVariableInstanceQuery().processInstanceId(pi.getId()).singleResult();
HistoricVariableInstanceEntity entity = (HistoricVariableInstanceEntity) historicVar;
var1.put("ccc", "ddd");
final VariableTypes variableTypes = Context.getCommandContext().getProcessEngineConfiguration().getVariableTypes();
final VariableType variableType = variableTypes.findVariableType(entity.getValue());
entity.setVariableType(variableType);
variableType.setValue(var1, entity);
return null;
}
});
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.