Dear Community,
I just started to study scripting for the reports, so the questions may seem silly, but please tell me. There is a problem, I need to develop the report in table form for the model eEPC. In the table for each function I need to display role, information system, incoming and outgoing documents. Tell me please, how to define for each function role, information system, and documents? I understand that I need to analyze all the communications to function, and thus find the desired object. I need to use the methods getConnectedObj, getConnectedObjOccs, does it? Please, If you can explain with an example. Please suggest! Thanks! Best Regards, Anastasia
//1-st step - get selecter EPC model(s) var oModelsEPCList = ArisData.getSelectedModels(); //2-nd step - get object occurrences in selected model - un this case FUNCTIONS var oObjFUNC = oModelsEPCList [0].ObjOccListFilter(Constants.OT_FUNC);
Now You have function list from Your EPC model. From each function object You can get attributes like name, description, type, etc (as You need), by object definition
for ( nObjFuncL=0 ; nObjFuncL < oObjFUNC.length ; ObjFuncL ++ ) { var My_name = oObjFUNC[nObjFuncL].ObjDef().Attribute(Constants.AT_NAME, g_nloc).GetValue(true) var My_desc = oObjFUNC[nObjFuncL].ObjDef().Attribute(Constants.AT_DESC, g_nloc).GetValue(true) //etc
If You want to get objects connected with each function You can find it by incoming or outgoing connections and source/target objects.
var InCxn = oObjFUNC[nObjFuncL].InEdges(Constants.EDGES_ALL);
var OutCxn = oObjFUNC[nObjFuncL].InEdges(Constants.EDGES_ALL);
var SourceObj = InCxn[nInCxnL].SourceObjOcc();
var TargetObj = OutCxn[nOutCxnL].TargetObjOcc();
You can also use getConnectedObjOccs(SymbolTypes) function...
For example (connected documents):
var ConnObjOccs = oObjFUNC[nObjFuncL].getConnectedObjOccs(Constants.ST_DOC)
If You want to get more by one type You must invoke this method with array of types by parameter
Example:
getConnectedObjOccs([Constants.ST_APPL_SYS_TYPE; Constants.ST_DOC])