if (parameters != null) {
int index = 0;
for (String key : parameters.keySet()) {
index++;
final String value = parameters.get(key);
final Parameter parameter = OBProvider.getInstance().get(Parameter.class);
parameter.setSequenceNumber(index + "");
parameter.setParameterName(key);
parameter.setString(value);
// set both sides of the bidirectional association
pInstance.getADParameterList().add(parameter);
parameter.setProcessInstance(pInstance);
}
}
// persist to the db
OBDal.getInstance().save(pInstance);