#------------------------------------------------------------------------------- #----------------------- ENTER YOUR COMMENT IN AN EDITBOX----------------------- #------------------------------------------------------------------------------- CC "AdoScript" EDITBOX text:"Comment: " title:"Enter your Comment" oktext:"Comment!" SET s_CommentInput:(text) CC "Modeling" GET_ACT_MODEL SET n_ModelId:(modelid) #------------------------------------------------------------------------------- #------------------- CREATE A COMMENTBOX FOR THE ENTERED COMMENT---------------- #------------------------------------------------------------------------------- IF (endbutton = "ok") { CC "Core" GET_CLASS_ID classname: "Comment Box" SET n_CommentBoxClassId: (classid) CC "Core" GET_CLASS_ID classname: "Task" SET n_TaskClassId: (classid) CC "UserMgt" GET_USER_ID_OF_CURRENT_USER # --> RESULT ecode:intValue userid:intValue SET n_Curr_UserId:(userid) CC "UserMgt" GET_USER_NAME userid:(n_Curr_UserId) # --> RESULT username:strValue ecode:intValue SET s_Curr_UserName:(username) CC "Application" GET_DATE_TIME date-format:"DD.MM.YYYY" time-format:"HH:MM:SS" #--> RESULT date:strValue time:strValue SET d_date:(date) SET d_time:(time) #------------------------CREATE "Comment Box"-OBJECT------------------------------- CC "Core" CREATE_OBJ modelid:(n_ModelId) classid:(n_CommentBoxClassId) objname:("User: " + (s_Curr_UserName ) + " "+ (d_date) + " " +(d_time)) #-->RESULT ecode:intValue objid:intValue SET n_CommentObjId:(objid) CC "Core" SET_ATTR_VAL objid:(n_CommentObjId) attrname: "Comment" val: (s_CommentInput) CC "Core" GET_CLASS_ID classname: "Task2Comment" SET n_Task2CommId:(classid) #---------------------CREATE "Task2Comment"-Connector ------------------------------ CC "Core" CREATE_CONNECTOR modelid:(n_ModelId) fromobjid:(n_TaskObjId) toobjid:(n_CommentObjId) classid:(n_Task2CommId) SET n_ConnectorId:(objid) #-------------Get "Task"-Object Position Using the PROCEDURE Below----------------- SETL str_referenceObject_position: "" # ---- Calls the Procedure and GETs the Object Position of Task GET_OBJECT_POSITION objectid: (n_TaskObjId) param_val: str_referenceObject_position # ---- Parses the X and Y value out of the position of Task LEO parse:(str_referenceObject_position) get-tmm-value:n_x_refobj:"x" get-tmm-value:n_y_refobj:"y" # ---- Sets new variables with the values of X and Y. To the value of Y is added 5cm, so the Comment will be positioned below the Task object SET n_x_objproperty: ((n_x_refobj) + CM 7) SET n_y_objproperty: ( (n_y_refobj)) #---------------------------SET "Comment Box"-OBJECT POSITION--------------------------- CC "Core" GET_OBJ_NAME objid: (n_TaskObjId) SET s_TaskObjName:(objname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("{\""+(s_TaskObjName)+"\":\"Task\"} -> \"Task2Comment\"") modelid: (n_ModelId) SET s_ObjIdList: (objids) SET n_mcount:(tokcnt (s_ObjIdList)) CC "Modeling" SET_OBJ_POS objid:(n_CommentObjId) x:(n_x_objproperty) y:(n_y_objproperty + (n_mcount-1) * CM 2.1) #--------------------------SET BEND POINT----------------------------------- CC "Core" GET_ATTR_ID classid:(n_Task2CommId) attrname:"Positions" SET n_AttrIdPositions:(attrid) CC "Core" SET_ATTR_VAL objid:(n_ConnectorId) attrid:(n_AttrIdPositions) val: ("EDGE 1 x1:9.5cm y1:" + STR(n_y_objproperty)) } #================PROCEDURE: GET_OBJECT_POSITION============================== PROCEDURE GET_OBJECT_POSITION objectid: integer param_val: reference { CC "Core" GET_CLASS_ID objid: (objectid) #--> RESULT ecode: intValue classid: intValue isrel: intValue SETL id_class_id_local: (classid) SET n_ObjId:(objectid) CC "Core" GET_ATTR_ID classid: (id_class_id_local) attrname: ("Position") #--> RESULT ecode: intValue attrid: id SETL id_attribute_id_local: (attrid) CC "Core" GET_ATTR_VAL objid: (objectid) attrid: (id_attribute_id_local) #--> RESULT ecode: intValue val: anyValue SETL param_val: (val) }