Hi,
how can I highlight an ObjOcc in a Model for a report?
We plan to build a process-book that contains the process map on the first page. The selected (and reported) process is somewhere down (3rd-level) the tree and not all users know the main process the reported process belongs to. I can imagine a red rectangle around the main process, or probably the shadow-option?
The model-comparsion report do something similar, but it creates complete new models. I don't want to have some more models in the DB only used for reporting. So is there a solution to do it without storing in the DB?
Regards,
Dominik
Hi,
Not sure if this will work as I havent tried it myself.
You could use createRoundedRectangle to
1. place a rectangle around the object
2. save the model (to ensure the rounded rect appears in a model graphic)
3. extract a model graphic
4. remove the rounded rectangle
5. save the model
The only issue I see with this, is that the model's attributes will be changed every time you run the script.
If you have any issues, let me know and I'll try to actually do this
Regards
Mayur
Hi Mayur,
Thank you for your help, that drived my the right way. But I could exclude step 2 and 5, it seams, that the model will be written anyway.
It is very important to remove the rectangle! And be aware of any other script errors. It may be, that the report stop and you didn't cleanup. So the model will still contain the rectangle!!!
Here some code I used:
function drawRectangle(oobjocc, ncolor) { var oroundrect = oobjocc.Model().createRoundedRectangle((oobjocc.X() - 30), (oobjocc.Y() - 30), (oobjocc.Width() + 60), (oobjocc.Height() + 60)); oroundrect.setRoundness(5, 5); oroundrect.setZOrder((oobjocc.getZOrder() - 1)); oroundrect.setPenStyle(Constants.PS_NULL); oroundrect.setBrushColor(ncolor); return oroundrect; }
(based on a similar function of the model-compare-report - Thank you guys)
The call of the function above:
g_gGPOcc = drawRectangle(g_oGPOcc,RGB(255,0,0));
Please make sure, that g_gGPOcc (contains the graphical Object) and g_oGPOcc (is the Occurance to highlight) are global variables, because you need them for the cleanup:
g_oGPOcc.Model().deleteGfxObj(g_gGPOcc);
As you can see in the code, I work with the Occurance, not the Object-Definition! This is well designd by ARIS-Stuff, because like this, the based model is defined too (see "Model()" in the method-pipe of creation and deletion of the grafic.
Ah, and don't forget to output the model once in the report ;-)
Good luck to all trying.
Dominik
RGB is the following simple function:
function RGB(r, g, b) { return (new java.awt.Color(r/255.0,g/255.0,b/255.0,1)).getRGB() & 0xFFFFFF }