Sunday, October 25, 2009

ARIS Scripting: Hello World

When I started to write a report in ARIS, I did not have the "Hello World" to help me out. So here is something you will need to launch ARIS report scripting.

function main()
{
var g_nloc = Context.getSelectedLanguage();

// *******************

var oobjects = ArisData.getSelectedObjDefs();
var oSourceModels = ArisData.getSelectedModels();
var odataBases = ArisData.getSelectedDatabases();

// *******************

var ooutfile = Context.createOutputObject(Context.getSelectedFormat(), Context.getSelectedFile());
ooutfile.Init(g_nloc);
ooutfile.Output("Hello World", "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
ooutfile.WriteReport(Context.getSelectedPath(), Context.getSelectedFile());
ooutfile=null;
}
main();

2 comments:

  1. Hi....

    I was just wondering if you could help me in my ARIS Script, I was trying to create a report which will give all the OLE Objects attached to a model... BY using ARIS predefined scripts, I was able to get the set of OLE Objects but now I need to seperate them depending on the file type.. can you plz help me to find the type of OLE Object... I tried using Type() method.. but it would result in "OLE OBJECT" which was not of much use... Thanks in advance...

    ReplyDelete
  2. Try using the Type() method from the occ. I am adding the methods which will probably help you.

    ComObjOcc[] Model.ComObjOccs ( )
    Returns all occurrences of OLE objects in the model.

    ComObjOcc.Type ( )
    Returns the type label of the OLE object that was determined by the application used to process the object.

    ReplyDelete