Hello,
I've read the documentation's part and some previous questions but can't really understand, Can anyone help me understanding this topic.
What is meant exactly by "aggregation relation mean that attribute of this type must exist prior to add them", attributes of which object, parent, child or both?
Moreover, if i have a multiple aggregation relationship between parent(requestInfo), child(actionTask). why does the following operation requestInfo setActions script fail with this message "Forbidden instance of com.company.model.actionTask found. It is only possible to reference persisted instances in an aggregation relation"
def List actions=new ArrayList();
def actionToAdd=actionTaskDAO.newInstance(nextInLineEmployeeID,BonitaUsers.getUser(apiAccessor,nextInLineEmployeeID).getTitle(),"",evaluatedComment,activityInstanceId);
actionToAdd.setActionDate(LocalDateTime.now());
actionToAdd.setExecutedByDelegate(false);
if(nextInLineDelegateID){
actionToAdd.setExecutedByDelegate(true);
actionToAdd.setDelegateID(nextInLineDelegateID);
actionToAdd.setDelegateName(BonitaUsers.getUser(apiAccessor, nextInLineDelegateID).getTitle())
}
actions.addAll(requestInfo.getActions());
actions.set(actions.size()-1,actionToAdd );return actions;