Hi All,
I am creating a Matrix model (Function-Role) for several EPC's model. So my report reads the functions& roles from the EPC models & creates a Matrix model for the same.
I have been able to generate the model & the connections, but I need to setCxnAliases (Alias Name) for each connection type.
For e.g.: Constants.CT_DECID_ON (is responsible for) == R & so on
In my matrix model, I should display an "R" instead of a checked box. Below is my code.
/*Create & Assign Matrix Model*/ var oModel = oGroup[0].CreateModel(220,"Matrix Model",lg) var matrix = oModel.getMatrixModel(); /*Sets the Header for the Row & Column*/ var Row_matrixHeader = matrix.getHeader(false) var Column_matrixHeader = matrix.getHeader(true) var Row_Header_Title = Row_matrixHeader.setTitle("Function",lg) var Column_Header_Title = Column_matrixHeader.setTitle("Role",lg) /*Identify the values from the EPC*/ var EpcModel = oGroup[0].ModelList(false,13) for(var i=0; i<EpcModel.length;i++) { var ObjOccFunc = EpcModel[i].ObjOccListBySymbol(335) for(i1=0;i1< ObjOccFunc.length;i1++) { var objFunc = ObjOccFunc[i1].ObjDef() var objRole = ObjOccFunc[i1].getConnectedObjOccs(Constants.ST_POS_TYPE) var objRoleDef = objRole[0].ObjDef() var rowcellHeader = matrix.createHeaderCell(null,objFunc,Constants.ST_FUNC,-1,true) matrix.setVisibleObjectSymbolTypes([Constants.ST_FUNC],true); var columncellHeader = matrix.createHeaderCell(null,objRoleDef,Constants.ST_POS_TYPE,-1,false) matrix.setVisibleObjectSymbolTypes([Constants.ST_POS_TYPE],false); var ObjCxn = matrix.createNewMatrixConnectionDataObject(Constants.ST_POS_TYPE,Constants.ST_FUNC,Constants.CT_DECID_ON,null,true,false) matrix.setCxnData ([ObjCxn]) } }Need help. thanks in advance.
Regards,
kaushik Mishra
Hi Kaushik,
I guess in this situation, there is no need to create a script for generating matrix model. You already have the connections created in EPC. So you can simply create a new matrix model manually, do a search and copy all the roles and functions in the matrix, and turn on the visibility of the required connections. And you can edit the connection alias as well in matrix. I guess this will be much faster approach.
Regards,
Amol Patil
Hi Amol,
I understand that we could do that as part of Out of Box feature, but I need to do it with the help of a script as this script is part of a larger picture.
If you could let me know, how I can use alias like (RACI, CRUD) through a script instead of checked boxes which is now visible in my matrix model.
Regards,
Hey Kaushik,
Once you create the matrix model from EPC, try mapping the CxnTypeNum with the alias name and set it for the matrix model.
Try the below code
var map = new java.util.HashMap();
map.put(new java.lang.Integer(435), "R");
map.put(new java.lang.Integer(326), "A");
matrix.setCxnAliases( map, lg )
Regards,
Prathibaa
Hi Kaushik,
When I am trying to create connections between objects in Matrix Model. I am not able to do it. I am using the below code for the same:
matrix.createNewMatrixConnectionDataObject(Constants.ST_POS_TYPE,Constants.ST_FUNC,Constants.CT_DECID_ON,null,true,false)
matrix.setCxnData ([ObjCxn])
Kindly help in resolving the issue. Thanks in advance!!