# ----------------------------------------------------------------------- # ---------------- SetAttributeValue EVENT ----------------------------- # ----------------------------------------------------------------------- # SETG n_currModeld: (modelid) # SETG n_chAttrId: (attrid) # SETG n_instId: (instid) # instid intValue, the ID of the changed instance. # attrid intValue, the Attribute ID. # modelid intValue, the ID of the model containing the changed instance. # attrtypeid intValue, the Attribute type code as follows: # 0 INTEGER, 1 DOUBLE, 2 STRING, 3 DISTRIBUTION, 4 TIME, 5 ENUMERATION, # 6 ENUMERATIONLIST, 7 LONGSTRING, 8 PROGRAMCALL, 9 INTERREF, 10 EXPRESSION, # 11 RECORD, 12 ATTRPROFREF, 13 DATE, 14 DATETIME, 15 CLOB # ---- Getting the Class ID of the instanced object CC "Core" GET_CLASS_ID objid: (n_instId) #--> RESULT ecode:intValue classid:intValue SET n_chClassID: (classid) # ---- Getting the Class ID of the Class with the name "Task" CC "Core" GET_CLASS_ID classname: "Task" #--> RESULT ecode:intValue classid:intValue SET n_TaskClassID: (classid) # ---- Getting the Attribute ID the Attribute with name "Position" and Class ID "n_TaskClassID" CC "Core" GET_ATTR_ID classid:(n_TaskClassID) attrname:"Position" #-->RESULT ecode:intValue attrid:id SET m_TaskPosID: (attrid) # ---- IF "m_TaskPosID" equals "n_chAttrId" THEN Getting the Attribute Value of Attribute with name "Position" and setting the result to "s_newPosition" IF (m_TaskPosID = n_chAttrId) { CC "Core" GET_ATTR_VAL objid: (n_instId) attrname: "Position" SET s_newPosition:(val) # ---- Getting Attribute value of instanced object with Attribute "StartPosition" and setting the result to "s_startPosition" CC "Core" GET_ATTR_VAL objid: (n_instId) attrname: "StartPosition" SET s_startPosition:(val) # ---- If these two positions are the same then... IF ( s_newPosition = s_startPosition) { # ---- Get the Attribute value of Attribute with Attributename "Accept all changes to object" and set the result to "v_Accept all changes to objectVal" CC "Core" GET_ATTR_VAL objid: (n_instId) attrname: "Accept all changes to object" SET SET v_Accept all changes to objectVal: (val) # ---- Set the Attribute value of Attribute with Attributename "Accept all changes to object" to "Yes" CC "Core" SET_ATTR_VAL objid: (n_instId) attrname: "Accept all changes to object" val: "Yes" #-->RESULT ecode:intValue attrid:id } # ---- If this is not the case then... ELSE { # ---- Get the Attribute value of Attribute with Attributename "Accept all changes to object" and set the result to "v_Accept all changes to objectVal" CC "Core" GET_ATTR_VAL objid: (n_instId) attrname: "Accept all changes to object" SET SET v_Accept all changes to objectVal: (val) # ---- Set the Attribute value of Attribute with Attributename "Accept all changes to object" to "No" CC "Core" SET_ATTR_VAL objid: (n_instId) attrname: "Accept all changes to object" val: "No" #-->RESULT ecode:intValue attrid:id } }