Hi, I am using ARIS 7,2 and trying to create a connection between oActObjOcc with aObjOcc in FAD model using script. I get the message "createCxnOcc illegal argumentsl.". And the details provided are as follows: But it's no problem create connection manually.
getorCreateCXN(oModel, aObjOcc, oActObjOcc) function getorCreateCXN(aModel, SourceOcc, TargetOcc) { var CxnTypeList; var cCXN = null; if ((TargetOcc != null) && (SourceOcc != null)){ CxnTypeList = ArisData.ActiveFilter().CxnTypes(aModel.TypeNum(), SourceOcc.SymbolNum(), TargetOcc.SymbolNum()); if (CxnTypeList.length > 0) cCXN = getorCreateCXN2(aModel, SourceOcc, TargetOcc, CxnTypeList[0]); } return cCXN; } function getorCreateCXN2(cModel, sourceOcc, targetOcc, CXNTypeNumber){ var iCxnOcc = cModel.Neighbour(sourceOcc, targetOcc) if(!isValidItem(iCxnOcc) || iCxnOcc.SourceObjOcc().ObjDef().GUID() != sourceOcc.ObjDef().GUID()){ var sourcePoint; var targetPoint; var import_custom = JavaImporter(Packages.java.awt) ; // Java Package Import with(import_custom){ sourcePoint = new Point(sourceOcc.X() + sourceOcc.Width()/2, sourceOcc.Y()+sourceOcc.Height()); targetPoint = new Point(targetOcc.X() + targetOcc.Width()/2, targetOcc.Y()); } var points = new Array(); points[0] = sourcePoint; points[1] = targetPoint; iCxnOcc = cModel.CreateCxnOcc(sourceOcc, targetOcc, CXNTypeNumber, points, false, true); } return iCxnOcc; }oModel - Function Allocation Diagram oActObjOcc - Information carrier type Occurrence aObjOcc - Function type Occurrence CXNTypeNumber - provides input for 2014. 3. 19 ???? 5:09:52 SEVERE: error running Model.CreateCxnOcc(IObjOcc, IObjOcc53,Point[],false,true): IObjOcc.createCxnOcc illegal arguments java.lang.IllegalArgumentException: IObjOcc.createCxnOcc illegal arguments at com.idsscheer.aris.server.arisomimpl.directctx.AObjOcc.createCxnOcc(AObjOcc.java:117) at com.idsscheer.aris.server.arisomimpl.methodctx.AObjOcc.createCxnOcc(AObjOcc.java:45) at com.idsscheer.aris.server.arisomimpl.accessrightctx.AObjOcc.createCxnOcc(AObjOcc.java:28) at com.idsscheer.aris.server.arisomimpl.arisctx.AObjOcc.createCxnOcc(AObjOcc.java:37) at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AModel.createWithExistingDef(AModel.java:1667) at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AModel.CreateCxnOcc(AModel.java:1630) at sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) at com.idsscheer.report.execution.javascript.AScriptContextFactory.doTopCall(AScriptContextFactory.java:281) at com.idsscheer.report.execution.javascript.ADelegatingContextFactory.doTopCall(ADelegatingContextFactory.java:183) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:173) at com.idsscheer.report.execution.debugger.backend.AScriptDebugger.startScript(AScriptDebugger.java:166) at com.idsscheer.report.execution.interpreter.AJReportDebugger.executeReport(AJReportDebugger.java:153) at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptReportThread.run(AJavaScriptReportThread.java:91) at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptDebuggerThread.run(AJavaScriptDebuggerThread.java:36) at java.lang.Thread.run(Thread.java:722) 2014. 3. 19 ???? 5:09:52 SEVERE: (0): An error occurred in the report object model. error running Model.CreateCxnOcc(IObjOcc, IObjOcc53,Point[],false,true): IObjOcc.createCxnOcc illegal arguments Best Regards, Toven
Hi Toven,
I'm trying to create connections on the model, script is running without issues, no errors or so, but there is no connections created.
I stuck with this and I think I tried everything :) I also studied this your fragment of code...
Is there anything else I should do except CreateCxnOcc? Do you create Connection Definition before?
Hi Alexey,
I know CreateCxnOcc only to create creation on model.
And I don't create Connection Definition before.
If your script has no errors, please check your Filter setting.
In Filter, connection have to be allowed between objects.
Above sample source, CXNTypeNumber is allowed between two objects in Filter.
If you are possible, please show me your script.
Regards,
Toven
HI Toven,
I need your help in one issue.
I am creating two objects in one model and after that I want to create relationship between those objects.
I am trying to create connections on the [Table type] model, script is running without issues, no errors or so, but there is no connections created.
var cxnPoints = astCxnPoints(created_entity,created_collection); //user defined function
var cnx = model.CreateCxnOcc(created_entity,created_collection,Constants.CT_DEPICTS_1,cxnPoints);
function astCxnPoints(entity,collection) {
var startXPos = entity.X();
var startYPos = entity.Y();
var endXPos = collection.X();
var endYPos = collection.Y();
var points = new Array();
points[0] = new java.awt.Point(startXPos,startYPos);
points[1] = new java.awt.Point(endXPos,endYPos);
return points;
}
created_entity --> means occurence of entity type in [table type] model
created_collection --> means occurence of data collection in [table type] model
but if I will change the source and destination then it is working fine. see below mentioned case in which I am getting relationship.
var cxnPoints = astCxnPoints(created_entity,created_collection); //user defined function
var cnx = model.CreateCxnOcc(created_collection,created_entity,Constants.CT_DEPICTS_1,cxnPoints);
function astCxnPoints(entity,collection) {
var startXPos = collection.X();
var startYPos = collection.Y();
var endXPos = entity.X();
var endYPos = entity.Y();
var points = new Array();
points[0] = new java.awt.Point(startXPos,startYPos);
points[1] = new java.awt.Point(endXPos,endYPos);
return points;
}
I want to make entity type as a source object and data collection as a destination object.
I want to connect these object by depicts relationship.
please help me guys....
Thanks,
Ankit