Show Posts

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.


Messages - Volkov

Pages: [1] 2
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  :-[

2
Bugs and Issues / Re: Problem with complex SQL query
« on: July 23, 2015, 09:38:26 pm »
Hi guys,
The query issue still alive. I've been trying to wrap that query with Transact SQL UDF returning table. No luck. Tested on some other user defined functions. Some of them are ok, some are not. So kinda unstable problem and there is no way to understand which queries are allowed and how the EA check them before execution.
So this code:
Code: [Select]
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.
Any ideas or references??
Thank you!

3
Bugs and Issues / Re: Problem with complex SQL query
« on: July 22, 2015, 02:34:13 pm »
Really good version, too! Will be tested today. Will be trying to rebuild the query.
Thanks!

4
Bugs and Issues / Re: Problem with complex SQL query
« on: July 22, 2015, 08:47:49 am »
Thanks! Gonna give it a try tomorrow. Frankly, I've been thinking that EA sends SQL as is. Or probably, changing MS SQL Server OLE DB provider to ODBC or any other driver will be enough. The same request run in the MS SQL Server Management Console and the Oracle SQL Studio is working just fine.

Anyway, thanks !!!

5
Bugs and Issues / Re: Problem with complex SQL query
« on: July 22, 2015, 07:56:01 am »
So one can call SQLQuery for very limited types of queries, right?
Any detour or trick???
Is it possible to run select with stored procedure or function??

Thanks!!

6
Bugs and Issues / Problem with complex SQL query
« on: July 22, 2015, 07:11:53 am »
Hi everybody  :D
Got a trouble with complex SQL query execution. Using Repository. SQLQuery() call. Some queries are doing great but some are failing returning no data. Well, looks like only limited SELECT is supported but I hope for best since we need to run really complex queries sometimes.
This is the typical inoperable request (sorry for messing, I'm not the author!):
Code: [Select]
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?
Thanks!!!

7
Bugs and Issues / Re: decoration feature doesn't work in Shape Scrip
« on: July 15, 2015, 06:32:24 am »
Then, guys, you need to make it full-featured. Currently, it pushes you back drastically. Java inventors were caught into the same trap. But they found it instantly, and had made tons of good and right steps to get initiative back.
We're making system generating hundreds and hundreds shapes. It takes time and makes shape scripts cumbersome.  

8
Bugs and Issues / Re: decoration feature doesn't work in Shape Scrip
« on: July 15, 2015, 05:03:49 am »
Hi guys,
And thanks for good advices! Moved my decoration in front of main shape and finally have it seen :) 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!
Looks like Shape Script is sensitive to order. BTW, the BNF for Shape Script is a pure disaster and doesn't reflect any recent changes made in v.12 As well as the whole documentation which is outdated totally  :'( Guys from the Sparx, make you documentation aligned to your product!! That action is really vital for your customers!
One more thing. Is there any way to draw at lower level say, from an add-in? I didn't find anything except the Shape Script which is fine but sometimes really inconvenient as it hasn't complex features and variables.
Well, anyway! Thank you guys for your support and great clues!!! ;)

9
Bugs and Issues / Re: decoration feature doesn't work in Shape Scrip
« on: July 13, 2015, 11:49:12 pm »
Well, there is no processing for now. Just main shape and decoration.

Code: [Select]
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 :(

By the way, trying to bypass that problem, I've discovered one more strange issue. I'm defining 2 subshapes (1 for image and second as the substitute for inoperable decoration), then calling them using

Code: [Select]
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.

10
Bugs and Issues / decoration feature doesn't work in Shape Script
« on: July 13, 2015, 10:39:59 pm »
Trying to draw the decoration element for my custom stereotype. Doesn't appear neither at the diagram, nor in the Shape Editor's preview.
Ok, putting the sample triangle decoration right from the documentation. No deal.
Was the decoration feature revoked from the 1214? The same for 'label' feature.

11
You won't believe but I even don't expect any reply from the Sparx :) And yes, I know so much about EA internals regarding add-ins that I'm afraid to keep writing add-ins  :-[
P.S. Prefer Dante, Carrol was too optimistic from IT industry POV

12
Automation Interface, Add-Ins and Tools / Trouble with Add-in's event model
« on: November 15, 2015, 09:41:39 pm »
Hi guys and little foreword describing my trouble.
As every EA programmer knows, there is no way to draw custom shape except using ShapeScript. But customization on the run is almost impossible. The one and only tool available is calling ‘hasproperty()’ function from ShapeSctipt. I'm trying to make add-in getting signals from ShapeScript and replying back with coded values letting know the script how to draw some elements, depending on user’s settings.
Well, this notification mechanism is ok and running smoothly. But what’s really bothering me is inconsistent event model. So, you can not get any notification when you’re opening diagram. You will be notified only after it’s been opened and painted already. And if you want to change something BEFORE the diagram drawn you’re out of luck. For some strange reasons, there is only EA_OnPostOpenDiagram event fired post-factum. And there are no EA_OnPreOpenDiagram or EA_OnOpeningDiagram though it’d be logically correct model.
There are basically 2 possible solutions: to catch first ‘hasproperty()’ call from ShapeScript to your add-in’s replying function and make customisation right in time, or catch EA_OnTabChanged event to understand that new diagram is being opened right now. Yessssss!!!! Did you see this documentation excerpt?
Quote
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 :(
What is real pain and shame, you’ll never know when diagram want to redraw itself. That makes customization via catching calls from ShapeScript to your add-in almost useless. I know for sure now, that
1. ShapeScript works 2 (!) times on diagram opening
2. ShapeScript can run or not run when you switching diagrams tabs
3. ShapeScript starts if you select any diagram element
4. ShapeScript starts if you open some drop down menu partially covering the diagram thus invalidating drawing canvas
It drives me nuts!
So! Guys, can you either update your documentation or make a patch which will notify add-ins when diagram gonna paint itself (to be able to prepare the context for that particular diagram), and sending EA_OnTabChanged with diagram ID of diagram being exposed when old active diagram’s tab is closed?
Dear Spars! We all love you fabolous software but THAT kind of documentation and lack of state machine showing events sequencing is as crappy as it gets (especially lack of C# samples in docs). Sorry! But I spent 2 days sitting in front of MS VS debugger trying to understand why it works not like documented. Debug your documentation, finally! Even half of menus are documented wrong since you've changed the GUI but left its description as is.

Ready to listen to your advices how to:
1. Catch the moment of diagram’s beginning of paining
2. Know what diagram is becoming active after previous one is closed

Thanks!
Andrey  

13
Hi,
All is ok now. It seems to me, that EA has some buggy cache inside. It is become obvious when one tries to change picture in Image Manageer without changing its name. Old picture will be drawn every time. Looks like something similar is for add-ins or profiles, too. I've just make changes to different profile element and all items start to work.
Very strange and definitely a bug.
Thanks for everyone!!

14
Hi KP and everybody!
Tried to implement as shown in the sample from your message. No effect. Now my function's signature (Class method, indeed) aligned to sample's one looks like this:

Code: [Select]
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.
I'm really disoriented. What's wrong? :( Documentation regarding calling add-in from ShapeScript is almost useless. And no trace logs or whatever to know what went wrong.
Any help is highly appreciated!!!

15
Hi KP,
And many thanks for your message!! Hope, this will be real solution of my trouble. Seems to me, good sample and couple of pages in docs would be just what doctor prescribed  ;D

Cheers!!

Pages: [1] 2