SaveVariablesCommand saveVariablesCommand = new SaveVariablesCommand();
saveVariablesCommand.setProcessInstanceId(processInstanceId);
Map<String, Object> map = new HashMap<String, Object>();
map.put(variableName, value);
saveVariablesCommand.setVariables(map);
commandExecutor.execute(new SaveVariablesCmd(saveVariablesCommand));
}