Quantcast
Channel: Reports & Macros
Viewing all 1118 articles
Browse latest View live

Logging Semantic Check success/Errors

$
0
0

Hi,

I want to create a report that runs semantic checks on all the models under a DB/group and maintains the success/failure message in a model attribute.

Is there a way to catch the message displayed by semantic check output dialogue/log and if so how can i put this on an attribute?

Thanks,

Puneet

 


Word report - Getting object of connected relationship type

$
0
0

I'm having a model where there is a object connected to a relationship type object to a other object.

I want to print in my report for every object the name of the relationship type object (this is easily done) but then i also want to print the other connected object of that relationship type object.

Example of my model:

|Object A| --- <HAS> --- |Object B|

 

Is this possible with prochandbook?

 

Thanks!

Excel inside MS Doc as an Embedded Object - Aris Report Script

$
0
0

Hi,

I have a requirement for ARIS report to create a MS doc file and a MS excel same time in a same report script. But excel file will be inside doc file as an embedded object.
Please let me know if you have any solution on this.

Regards,
Rupam

Create hyperlink to a specific location/section within the same MS doc - Aris Report Script

$
0
0

Hi,

How can I create a hyperlink inside MS word doc which locate a specific section inside same doc.
Please let me know if you have any solution on this.

Regards,
Rupam

getDecryptedScheduleResult without GUID

$
0
0

Hi -

I already have a report that pulls the scheduled report results and generates an Excel file on a shared drive:

        var reportScheduler = Context.getComponent("ReportScheduler");
        var aByteArrayResult = reportScheduler.getDecryptedScheduleResult("scheduledReportGUID", "username", "password", false);
        var aSelectedFile = reportScheduler.getZipEntries(aByteArrayResult);
        var aByteArrayXLSX = null;
        for (var i in aSelectedFile) {
            if (aSelectedFile[i].getName().equals("OutputFile.xlsx")) {
                aByteArrayXLSX = aSelectedFile[i].getData();
                break;
            }
        }
        var outputFile = new java.io.File(filePath + "\\OutputFile.xlsx");
        var fop = new java.io.FileOutputStream(outputFile);
        if (!outputFile.exists()) {
            outputFile.createNewFile();
        }
        fop.write(aByteArrayXLSX);
        fop.flush();
        fop.close();

This is working great for a single database, but I need to be able to set this up for multiple databases nightly. Is there a way to get to the scheduled report without needing the GUID? Since the scheduled report GUID is completely different from the report GUID, I need to hard code in the scheduled report GUID within the report.

This creates a problem - if I have to get the scheduled report GUID via the database names, they could change and it could break. And if for some reason the scheduled report gets removed and set up a 2nd time, it will also break.

Can't locate scriptrunner.bat

$
0
0

Hi,

I can't locate the scriptrunner.bat script: on ARIS 7.2 installation folder I've found only the config file, scriptrunner.cfg (on ARIS 9.8 not even that).

Does anyone know how to find it?

 

Regards

 

Maggiù Pennarola

Creation of an OLE object in a macro

$
0
0

Hello everyone,

I am working with a macro in ARIS Architect to insert a picture (specifically a logo) as an OLE object.
With a report I can do that easily with the following instruction instruction:

createComObjOcc (int x,int y, int width, int height, ComObjOcc source, boolean bCreateNewDef)

Unfortunately, using a macro there is not a similar instruction and I can't call a report because the macro is executed when the model is open.

How could I solve the problem? Did anyone have the same problem?

Thank you very much for your willingness.

Word Report : Prohibit lines splitting over several pages

$
0
0

Hello,

My script report generate table cells in a Word document.

My problem, my table is over several pages, but at the end of each page, line rows could be split between 2 pages...

Line code for creating table :

ooutfile.BeginTable(100, colWidthList, Constants.C_BLACK,Constants.C_WHITE,Constants.FMT_LEFT | Constants.FMT_ITALIC | Constants.FMT_REPEAT_HEADER ,0);

To solve my problem I have to change manualy in the Word document  the table property to prohibit splitting of lines over several pages...

Is it possible to change the table properties by script to do that automatically ?

Thanks


Get alternate language

$
0
0

Hallo,

with Context.getSelectedLanguage() I can get the LocaleID to get attributes and names in the standard language.

But how can I get the alternate or fallback language?

If there is anyone who can help me I would be very happy.

Many thanks.

Holger

Generic logging & debugging helpers

$
0
0

Anyone have any simple logging & debugging helpers code to drop in at the end of a script in ARIS? I thought this would work, but does seem to do the trick.

/*Function to Initialize the Output Log File*/
function Init_Log_File()
{
    //Creates name and output file for output log
    outFileName = Context.getSelectedFile();
    workbook = Context.createExcelWorkbook(outFileName);
   
    //Create the Font Styles
    Header_font = workbook.createFont();
    Header_font.setFontHeight(240);
    Header_style = workbook.createCellStyle(Header_font, Constants.BORDER_THIN,Constants.BORDER_THIN,Constants.BORDER_THIN,Constants.BORDER_THIN, 0, 0, 0, 0, Constants.ALIGN_LEFT,  Constants.ALIGN_LEFT, Constants.C_GREY_50_PERCENT, Constants.C_GREY_50_PERCENT, Constants.SOLID_FOREGROUND, Constants.XL_CELL_DATAFORMAT_GENERAL, false, 0 , false, 0 , true);
   
    Data_font = workbook.createFont();
    Data_font.setFontHeight(200);
    Data_style = workbook.createCellStyle(Data_font, Constants.BORDER_THIN,Constants.BORDER_THIN,Constants.BORDER_THIN,Constants.BORDER_THIN, 0, 0, 0, 0, Constants.ALIGN_CENTER,  Constants.ALIGN_LEFT, 0, 0, Constants.NO_FILL, Constants.XL_CELL_DATAFORMAT_GENERAL, false, 0 , false, 0 , true);

    //Starts a new worksheet
    Log_sheet = workbook.createSheet("Output Log");
}

Help: Creating a new Attribute Placement using a Macro

$
0
0

I am working on an automated process for creating standardized models.  I have succeeded in writing a report which creates  customized template models.  However, within the report I was unable to place the name of the model on the model graphic.

I am attempting to write a macro which places the name of a model (as an attribute) automatically, when there is no existing placement on the model.  This would allow me to either select models from the ARIS explorer or standardize name placement upon the model initially being created.

The current code that I have written is here:

function formatModel(model)
 {

     //opens a model that is modifiable, invisible, and is allowed to display error dialogs.
     Designer.openModel(model, false, false, false);
     
     var nameAttr = Designer.createAttrOcc(model, null, Constants.AT_NAME, Constants.ATTROCC_ALIGN_LEFT);
     
     Designer.save(model);
     Designer.closeModel(model);
     
 }

The difficulty lies in the 'createAttrOcc' function, which in this case is returning a null pointer exception.  The documentation that I have for this method is here:

The problem I am having is that I can't determine what to put in the 'occ' parameter.  When a model is first created, there are no occurrences placed on the model.

Does anyone know a way around this issue?

THANKS!

Tags: 

Create assignment to a created model

$
0
0

Hello,

I would like to create a assignment from a created ObjectOcc to a created model but I have no idea to achieve this? I have been looking for something like oObjOcc.setAssigment(oModel), but couldn't find anything like this?

Is there a way to implement this?

Best regards 

Daniel

Attribute data type name

$
0
0

Hi!

How to get an attribute data type name in a script (Is it date, time, text, long, double or else)?

Regards,

How to make query to SQL Sever from Aris script?

$
0
0

Hi!
Is there a way to connect a Microsoft SQL Server and get a query result from Aris script? We need to synchronize data between external data source which exists on another SQL Server with objects attributes in Aris database.
On current moment we transfer those data into an Excel book and import them into objects attributes with Aris script from that book. It is a long way.
Regards,

Automatically create connection on Visio Import

$
0
0

Hi There,

I'm currently in the process of importing a lot of Visio diagrams into ARIS into a custom SIPOC model I've created.

One of the key things I'm hoping to do is to automatically create connections between one object, and the object it is contained/nested within (i.e. Org 1 "is a" Supplier, Technical Term 1 "is a" Input). 

At the moment, my work around is importing the diagram, then dragging all the functions/orgs/technical terms out of the object they sit within, then dragging them back so the "Create Relationship" pop-up appears, and then ticking all the connection occurrences. 

Is there a programmatic way to do this?

Thanks!

Scott


How can I change the access rigths of a group?

$
0
0

Hello,

currently I need a script to change the access rights of a group inside a report.

With oCurrentGroup = oCurrentModel.Group() I get the group object and with mAccess = oCurrentGroup.AccessRights() I get a map of the rights. That works fine.

This maps contains the UID and a number for every entry. I guess the UID is the UID of an user or usergroup. And the number is a constant for the right the user haves. Now I could get the content in a string with mAccess.toString(), then separate the keys and a value into an array. But this cold generate problems with the type of the variables. There must be a smarter way.

In the ARIS Script helpside I found a function: mAccess.toArray(). But this line generates a TypeError: Cannot find function toArray in object ...
Also the iteration througth the map with for(var i of mAccess) generates a syntax error. I found this line in the internet.

I guess I could read of all entries by mAccess.get(key). But in this case I need all the keys. And the report must be flexible for the case, that other usergroups are generated in the database and for more then one database.

So my question is:
How can I read the keys and values of all entries in the map?
And how can I write back the changed rights into the group?

I only found the function .AccessRights() to read the map in the ARIS Script help and no function like .setAccessRights or so.

I would be very happy if anyone could help me.
Many thanks in advance.

getParentObjOcc() question

$
0
0

Hi All,

I'm trying to understand ARIS script a little more, I've been looking through the Script help file and have come across:

getParentObjOcc()

According to the help this is: "Objects in objects: Returns the object in which this object occurrence is contained."

I'm trying to understand how a object gets "contained" within another? I've imported some visio diagrams, and I've created a simple report to try and automatically create connections based on the objects contained in another object. 

The code so far is as follows:

  var objects = ArisData.getSelectedObjOccs();
 for(var i=0; i<objects.length; i++ )
 {
        objects[i].ObjDef().CreateCxnDef(objects[i].getParentObjOcc().ObjDef(), 283) 
 }

 

The issue I have is that it works on some of the diagrams which I have previously played around with, but on the freshly imported models it doesn't return an ObjDef from getParentObjOcc().

Any ideas?

Programatically creating a new connection

$
0
0

Hi All,

I'm trying to programmatically create a connection between 2 objects. I've created a script which detects if the objects overlap, and then I want to create the connection using CreateCxnOcc. I've tried a few different options, but can't seem to get the connection created.

Even if I go to a basic EPC model and select an Event and a Function, and use the below code the connection isn't created - I feel like I must be doing something wrong!

I'm not a programming expert by any stretch but can generally get by, so appreciate the help and sorry if I'm missing some basics.

 

var objects = ArisData.getSelectedObjOccs();
var model = objects[0].Model();
var cnx = model.CreateCxnOcc(false,objects[1],objects[0],Constants.CT_ACTIV_1,null); 

Script to Add or delete a user from UMC

$
0
0

Hi all,

I am having an idea to so that User Management Activity is simplified.

Idea is- we can cerate an ARIS script to directly add or delete a new user/ existing user from the UMC directly by executing the script in ARIS. We need to mention the name of the user whom we want to add or remove in the script and the script hits the UMC and then do the need full. Also while adding we can also mention the password for it.

kindly please suggest if anyone has already implemented this or can give suggestion for it regarding its feasibility.

Thanks & regards

Sumeet     

Macro: go to occurrence in Explorer

$
0
0

Hello,

I'm looking for a way how it's possible to go to the Explorer tree to the object definition from selected occurrence in Macro Script.

Thanks.

Viewing all 1118 articles
Browse latest View live