AW
Hello,
I am trying to build a report which includes the following:
- activities
- responsable who executes the activity
- application used for the activity
- description of the activity
so far, so good, however now i want to add the following two items
- all events that are input of the activity
- all events that are output of the activity
I can make it work with the following command:
getSelectedModels.ObjOccListbySymbol.getConnectObjOccs.InEdges.TargetObjOcc.ObjDef
getSelectedModels.ObjOccListbySymbol.getConnectObjOccs.OutEdges.SourceObjOcc.ObjDef
However, i cannot get the events which are linked, with a AND or OR rule in between.... I don't find anyway to include those events in my query. Please can anyone help me
Thank you
Arne
I use this function. oObjOcc - first object occurence. In your case - function. nInOut - direction. Constants.EDGES_IN | Constants.EDGES_OUT aFindTypes - array of object types to find. In your case [Constants.OT_EVT] aPassTypes - array of object types, which pass over. Optional. bFlag - do not pass anything. Technical parameter. It may need some addtional function like IsDefined or ValueAt. var GoneObjects = null; function MultiConnected(oObjOcc, nInOut, aFindTypes, aPassTypes, bFlag) { var aResult = new Array(); var oEs = []; var nE = 0; var oAdj = null; var nStructure = Constants.EDGES_ALL; if (!IsDefined(aFindTypes)) return aResult; if (typeof(aFindTypes)=="number") aFindTypes = [aFindTypes]; if (!IsDefined(aPassTypes)) aPassTypes = []; if (typeof(aPassTypes)=="number") aPassTypes = [aPassTypes]; aPassTypes.push(Constants.OT_RULE); //Чтобы не бегать по одним и темже объектам несколько раз //сделаем список всех объектов, по которым уже прошись if (typeof(bFlag)=="undefined") GoneObjects = new __map(); else if (!bFlag) GoneObjects = new __map(); //Проверяем, не рассматривали ли мы уже это объект if (GoneObjects.ContainsKey(oObjOcc.ObjDef().GUID(),oObjOcc)) return aResult; GoneObjects.Insert(oObjOcc.ObjDef().GUID(),oObjOcc); //Собираем входящие и выходящие связи if(nInOut & Constants.EDGES_IN) oEs = oEs.concat(oObjOcc.InEdges(nStructure)); if(nInOut & Constants.EDGES_OUT) oEs = oEs.concat(oObjOcc.OutEdges(nStructure)); //Рассматриваем все связи for(nE = 0; nE < oEs.length; nE++) { //Находим объект с другой стороны связи oAdj = oEs[nE].TargetObjOcc(); if (oAdj.IsEqual(oObjOcc)) oAdj = oEs[nE].SourceObjOcc(); for (var i=0; i<aFindTypes.length; i++) if(oAdj.ObjDef().TypeNum() == aFindTypes.ValueAt(i)) { aResult.push(oAdj); break; } //Если это логика, для неё снова запустим эту функцию for (var i=0; i<aPassTypes.length; i++) if(oAdj.ObjDef().TypeNum() == aPassTypes.ValueAt(i)) { aResult = aResult.concat(MultiConnected(oAdj, nInOut, aFindTypes, aPassTypes, true)); break; } } return aResult; }