#---------------------------------------------------------------------------------------- #------------------------------Write Comment ProgramCall--------------------------------- #---------------------------------------------------------------------------------------- # =====================Get Comment Information====================== # TIME CC "Application" GET_DATE_TIME date-format:"DD.MM.YYYY" time-format:"HH:MM:SS" SET d_date:(date) SET d_time:(time) # USER 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) # MODEL_ID CC "Modeling" GET_ACT_MODEL SET n_ModelId:(modelid) # TASK_CLASS_ID CC "Core" GET_CLASS_ID classname:"Task" SET n_TaskClassId:(classid) #================================= Write Your Comment ======================== CC "AdoScript" EDITBOX text:("Comment: ") title:"Enter your Comment" oktext:"Comment!" SET s_CommentInput:(text) IF (endbutton = "ok") { # Collect Comment Information in an Attribute CC "Core" SET_ATTR_VAL objid: (n_TaskObjId) attrname: "CommentInfo" val:("User: " + s_Curr_UserName + " " + d_date + " " + d_time) # Set the input of the EDITBOX into 'Comment' CC "Core" SET_ATTR_VAL objid: (n_TaskObjId) attrname: "Comment" val: (s_CommentInput) # Boolean if an ATTRBOX should created CC "Core" SET_ATTR_VAL objid: (n_TaskObjId) attrname: "CommentBox" val: "Yes" #===================Parse Object Position===================== 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 CC "Core" GET_ATTR_VAL objid: (n_ModelId) attrname: "ModelingAreaSize" SET n_MAS: (val) SET n_x_objproperty: (n_x_refobj) SET n_y_objproperty: (n_y_refobj) CC "Core" SET_ATTR_VAL objid: (n_TaskObjId) attrname: "xCoorTextBox" val: (n_x_objproperty) CC "Core" SET_ATTR_VAL objid: (n_TaskObjId) attrname: "yCoorTextBox" val: (n_y_objproperty) #========================SAVE Comments in a Record Table========================== CC "Core" GET_ATTR_ID classid: (n_TaskClassId) attrname:"CommentTable" SET n_RecAttrID: (attrid) CC "Core" ADD_REC_ROW objid:(n_TaskObjId) attrid:(n_RecAttrID) SET n_RecRowId:(rowid) CC "Core" SET_ATTR_VAL objid: (n_RecRowId) attrname:"User" val: (s_Curr_UserName) CC "Core" SET_ATTR_VAL objid: (n_RecRowId) attrname:"Time" val: (d_date + " " + d_time) CC "Core" SET_ATTR_VAL objid: (n_RecRowId) attrname:"Comment" val: (s_CommentInput) } #==========================GET_OBJECT_POSITION PROCEDURE========================== 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) }