Hi Eva,
I would like to build one large report that I can output the following fields against either Database level or Group. The idea is to be able to then sort the data as required using pivot tables in excel ie the need to have many fieclds in onde spreadsheet :
Process Model (Name/attributes/group)/Upstream processes(name and type)/Downstream processes (name and type) if via Group / Roles(Actors-participants) / Event(name and type) / Function(name and type) - i hope this makes sense Eva - pls let me know if it does n't - thnx JB
Hi Eva, apologies for the small print - pls see the below - i hopw this is viewable for you.
Basically it is the following fields from Left to Right: Group / Process / Process Model name / Model Type / Connected Models / Participant Acter Lane / Function name / Function Type / Rule / Rule Type / Is predecessor of / Activates (source object name) -basically I am trying to get information around specifically the Actor Lane / Model name / Processes / Connected Models / Function etc hope this helps, many thanks for getting back to me
Hi John,
the report below delivers the following information.
You can start the report in the context of a database or a group.
var g_nLoc = Context.getSelectedLanguage(); var sDB = ArisData.getActiveDatabase().Name(g_nLoc) var oOut = Context.createOutputObject(); oOut.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0); // Headline oOut.TableRow(); oOut.TableCell("Database", 30, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_GREEN, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell("Group", 30, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_GREEN, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell("Process", 30, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_GREEN, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell("Process Model Name", 30, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_GREEN, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell("Model Type", 30, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_GREEN, 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); var oGroups = getGroups(); for (var i = 0; i < oGroups.length; i++) { var oGroup = oGroups[i]; var oProcesses = oGroup.ObjDefList(true/*bRecursive*/, [Constants.OT_FUNC]); for (var j = 0; j < oProcesses.length; j++) { var oProcess = oProcesses[j]; var sProcess = oProcess.Name(g_nLoc); var sGroup = oProcess.Group().Name(g_nLoc); var oProcessModels = getProcessModels(oProcess); for (var k = 0; k < oProcessModels.length; k++) { var oProcessModel = oProcessModels[k]; var sProcessModel = oProcessModel.Name(g_nLoc); var sModelType = oProcessModel.Type(); oOut.TableRow(); oOut.TableCell(sDB, 30, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell(sGroup, 30, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell(sProcess, 30, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell(sProcessModel, 30, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); oOut.TableCell(sModelType, 30, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP | Constants.FMT_EXCELMODIFY, 0); } } } oOut.EndTable("", 100, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0); oOut.WriteReport(); function getGroups() { if (ArisData.getSelectedDatabases().length > 0) { return [ArisData.getSelectedDatabases()[0].RootGroup()]; } return ArisData.getSelectedGroups(); } function getProcessModels(oProcessDef) { var oModels = new Array(); var oProcessOccs = oProcessDef.OccList(); for (var i = 0; i < oProcessOccs.length; i++) { var oModel = oProcessOccs[i].Model(); if (isProcessModel(oModel)) { oModels.push(oModel); } } return ArisData.Unique(oModels); function isProcessModel(oModel) { var nModelType = oModel.TypeNum(); if (nModelType == Constants.MT_EEPC) return true; if (nModelType == Constants.MT_EEPC_COLUMN) return true; if (nModelType == Constants.MT_EEPC_ROW) return true; //... return false; } }
I hope this will help you. If you have further questions please feel free to ask me.
Hello Eva,
Firstly many thanks for the report. However I do not get any results at present? I get the Column titles ingreen but empty result set. Sorry to be a pain, but wondered if you had any idea why that is occuring? Is there any thing to check my end do you think? Lastly do you think it would be difficult to get the Actor (name) column inserted too?
Best Regards,
John.
That's strange. You should get something like the picture below as output.
At the moment it only works with these model types:
function isProcessModel(oModel) { var nModelType = oModel.TypeNum(); if (nModelType == Constants.MT_EEPC) return true; if (nModelType == Constants.MT_EEPC_COLUMN) return true; if (nModelType == Constants.MT_EEPC_ROW) return true; //add your model types return false; }
What do you mean by actor? The creator of the model?
Regards
Eva