1
Bugs and Issues / Re: Problem with complex SQL query
« on: July 23, 2015, 10:40:03 pm »
Yep! But the time is very valuable and official reply usually flies back few days at least
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Repository.SQLQuery("SELECT * someUDF()")works time after time. Or doesn't. Depends. Can't find what's wrong. I can only suggest that EA's unable to parse the output from the function. But unable to find any clue or directives, how query result should be defined and supplied to the EA, so the latter would be able to transform it into the output XML.
WITH Q_TREE (ID, Name) AS ( select po.Object_ID Child_ID, po.Name Child_Name from [dbo].[t_object] po WHERE po.Object_ID IN ( select do.Object_ID from dbo.t_diagramobjects do INNER JOIN dbo.t_object ob ON ob.Object_ID = do.Object_ID where do.Diagram_ID = 458 and ob.Stereotype = 'bobject' ) UNION ALL select cc.Object_ID Children_ID, cc.Name Child_Name from (select object_id, Name from [dbo].[t_object] where Stereotype = 'bobject' ) co INNER JOIN ( SELECT ci.End_Object_ID, pi.Object_ID, pi.Name, pi.Package_ID from dbo.t_connector ci INNER JOIN [dbo].[t_object] pi ON pi.Object_ID = ci.Start_Object_ID where ci.Connector_Type = 'Aggregation' ) cc ON co.object_id = cc.End_Object_ID INNER JOIN Q_TREE t ON t.ID = co.Object_ID) SELECT DISTINCT ID, Name FROM Q_TREEWell, I can predict that I'll be sent to the docs where written that Repository. SQLQuery() is for the SELECT queries only. Yet, perhaps anyone knows the way how to execute complex queries form the EA scripts?
BUT! We're using a lot of rounded shapes and decorations are sliding right onto the rounded border. So, the final solution was to make a separate sub-shape consolidating other sub-shapes instead of decoration. Just like in Java!
Guys from the Sparx, make you documentation aligned to your product!! That action is really vital for your customers!
shape main
{
decoration folder
{
image("folder.emf", 10,10, 26,26);
}
}There is no much might have been changed. I was trying to move decoration's definition outside the main shape's block. The same result 
AddSubShape("image", "S");
AddSubShape("deco", "S");First shape is ok and sits at the very bottom side of the element. But the second flies into the upper part of the main shape. Looks like it's impossible to use the same orientation for several subshapes. Only first is been drawn correctly.
And yes, I know so much about EA internals regarding add-ins that I'm afraid to keep writing add-ins 
EA_OnTabChanged notifies Add-Ins that the currently open tab has changed. Diagrams do not generate the message when they are first opened - use the broadcast event EA_OnPostOpenDiagram for this purpose.Hell, no! You’ll get this event EVERY time you’re opening diagram or switching between diagrams! The only difference is when you open diagram the ’DiagramID’ parameter will be 0 (bug??) but ‘TabName’ will be absolutely correct and will contain the name of diagram being opened. Really good signal to start customization if you open diagram but really terrible if you closing one and got to customize diagram previously obscured but now being activated! You know why? Because when you close a diagram there will NO SIGNAL telling that hidden diagram is exposed and visible now

public string isDecorated(EA.Repository repo, string guid, object arguments)but it's never called. Tested with VS2015 debugger attaching to EA process, too. No calls to my add-in assembly during shape drawing.
Documentation regarding calling add-in from ShapeScript is almost useless. And no trace logs or whatever to know what went wrong.