Ifd:addParents
From dev.ifd-library.org
API version 2
public IfdConceptInRelationship [] addParents ( String concept_guid, IfdConceptInRelationship[] parents, String rel_context_guid, String session_id ) throws IfdServerException
EXPRESS Heading:
QUERY_FUNCTION addParents(concept_guid : STRING;
parents : LIST OF IfdConceptInRelationship ;
rel_context: IfdContext ) : LIST OF IfdConceptInRelationship;
Function to add one or more parent to a concept. The function takes an array of IfdConceptInRelationship, the concept itself as a global indentifier concept_guid , a global identifier for a relative context rel_context and a session_id as input.
Input:
-
String concept_guid- The guid of the concept to which we want to add parent (must exist in the library) -
IfdConceptInRelationship[] parents- Array of one or more IfdConceptInRelationship. All the concepts in this list must already exist in the library -
String rel_context_guidThe global unique identifier for the relative context. -
String session_id- The session id for the active user
Returns:
-
IfdConceptInRelationship []- An array of IfdConceptInRelationships.
API version 3
Function public IfdConceptInRelationship [] addParents ( String session_id String concept_guid, IfdConceptInRelationship[] parents, String rel_context_guid) throws IfdServerException
EXPRESS heading
QUERY_FUNCTION addParents(
concept_guid : STRING;
parents : LIST OF IfdConceptInRelationship ;
rel_context_guid : STRING): LIST OF IfdConceptInRelationship;
The function creates relationships between child concept and list of parent concepts in a specified context.
Input:
- String session_id - The session id for the active user
String concept_guid - global unique id of a concept (not a context) to be child for the relationships in the target IFD population; IfdConceptInRelationship[] parents > - list of specifications for relationships, for every element of the aggregate shall be specified the following attributes:
- base.guid – global unique id of the concept to be parent, it shall be instantiated in target population before call to addParents
- relationship_type – type of the relationship to be created.
- String rel_context_guid - global unique id of the relationships context, the context shall exist before the call and user shall be an owner of the context
Returns:
IfdConceptInRelationship [] - Full list of parents (including assigned before the call) of the specified child concept in the provided target context. Every element of the output has the following attributes:
- base - fully specified (in all available languages) parent concept, the same as in getConcept;
- relationship_type - type of the relationship, the same as in input;
- context_guids - list of context (owned or used) of the relationship;
Difference against v.2.00
- (45) Depending of target population structure and volume it responds 2-5 times quicker then in v.2.00;
- (46) The function checks correspondence of parent and child types to relationship type. In v.2.00 the function could create e.g. relationship ‘COLLECTS’ from an actor to a measure or 'DOCUMENTS' from a value to a concept;
- (47) 'ASSIGNS_COLLECTIONS' mapped to xtdRelAssignsCollections of ISO12006-3. In v.2.00 the IFD relationship type was mapped to xtdRelCollects (the same ISO12006-3 type for 'COLLECTS' and 'ASSIGNS_COLLECTIONS');
- (48) For relationship type 'SEQUENCES' parent activity is precedence (previous) of child. In v.2.00 it was interpreted in opposite way;
- (49) The function raises an exception in incorrect relationship_type. The function in v.2.00 just ignore incorrect relationship_type;
- (50) Created relationship (instance of xtdRelationship of ISO12006-3) is assigned with dummy name (constant DEFAULT_CONCEPT_NAME = 'Anonymous') in default language (constant DEFAULT_LANGUAGE_NAME = 'English'), VersionDate is set to current data/time stamp, status is set to ‘DRAFT’, is_maintained_by is set (implicitly) to the organization of the logged user. In v.2.00 all these attributes are left unset producing invalid population of ISO12006-3;
- (51) Output reflects actual children population. v.2.00 returns narrowed set of children: representation in contrast of creating checks types of input parameters and can not show created invalid relationships;
- (52) Elements of output aggregate have the same difference with v.2.00 as output of getChildrenConcepts
*(53) In v.2.00 the function had a bug with checking if the required relationship exists and could do not create required relationship.
Comments: Wouldn't it be more efficient to only provide the guids of the concept and the guids of the parents to be added, instead of providing whole concepts? What is the benefit of returning an array of concepts? Is this the array of parents? Couldn't it be enough to return true for success or false for failure? Kees Woestenenk.