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 - harvinder

Pages: [1] 2
1
Bugs and Issues / No way to disable new attribute dialog box
« on: July 13, 2011, 11:02:58 pm »
The documentation mentions that it is possible to suppress the dialog box that is shown when a new attribute is dragged to say a class (see below the excerpts from the help file of EA 9 v905). However, I have noticed that the dialog box is shown even before the call to EA_OnPreNewAttribute.

Is there any way to suppress the dialog box? I would like to show my own dialog box.


Quote
EA_OnPostNewAttribute notifies Add-Ins that a new attribute has been created on a diagram. It enables Add-Ins to modify the attribute upon creation.

This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the attribute is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs.

Also look at EA_OnPreNewAttribute.

2
I just finished modifying/generating 1223 files and I got following 3 COMExceptions. In total there were 5 exceptions.

EaProcess - Exception System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
   at EA.AppClass.get_Repository()
   at TAF.Test.Processor.EAProcessor.GenerateTestSpecification(String eapFile) in c:\Project\AUTO\TAF\test\src\EAProcessor\EaProcessor.cs:line


EaProcess - Exception System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
   at TAF.Test.Processor.Ea.ModelUpdator.Generate(EaNode treeRoot) in c:\Project\AUTO\TAF\test\src\EAProcessor\Ea\ModelUpdator.cs:line 111


EaProcess - Exception System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
   at TAF.Test.Processor.Ea.ModelUpdator.Generate(EaNode treeRoot) in c:\Project\AUTO\TAF\test\src\EAProcessor\Ea\ModelUpdator.cs:line 111

3
We have created a MDG (workflow language) for writing basic algorithms. The language has basic constructs like assignments, verification etc. These basic constructs have taggedvalues to customise the behavious and are connected through connectors for the flow.

In an addin on a press of a click generate C# code from this workflow.

We wanted to test (automated) that constructs are implemented properly (i.e. right c# code is generated). We approached it by
 
[1] We construct the EA.App and call OpenFile to load the template  eap files from an external application.
[2] We read a configuration file from the file system and modifying the values of the taggedvalues etc.
[3] once we modify the file we save it with  a different name and that becomes our test data.
[4] We close the file and start the process with next configuration file.

We create around 1000 such input files, however, sometime we see COMException. We have tried increasing the memory etc but without fail. and all this is very random.
 
Sometimes the values retrieved from EA changes in the middle of execution.

Has anybody experienced something similar or done something similar?

Cheers
harvinder

PS: I am in the process of writing a smaller application to simulate the problem so that I can share it with the group.

I am using version 935 on win 7 64 bit and Win xp

Another thing to notice is that on Win 8.1 the problem is there but very very rare.

4
Hello,

We have an application which reads a configuration file and updates the EA mode (eap file) using the APIs.

myTaggedValue.Value = myAttribute.AttributeGUID.
myTaggedValue.Update();

We noticed that for some taggedValues the values are not getting updated. This behaviour is also very random, if I run the application with the same configuration file repeatedly, some times it succeeds.

Also we have noticed that if I change my configuration file to change an additional taggedValue or any other element of the model. TV's update succeeds.

Am I doing something wrong? Am I suppose to call any other function? I am using 9.3 (version 935).

Thanks
Harvinder

5
I have made some changes to the SQLRepository (Implements IRepository) and also added EADiagramObject to make it work for me.

I would be happy to contribute my changes to the project after somebody reviews them.

Cheers
Harvinder
PS: thanks stao for uploading the project, it would now make many things possible for our project.

6
typo, I trust it should be EA_OnNotifyContextItemModified

7
Code: [Select]
thanks thanks thanksToday I have changed my code to use http://code.google.com/p/ea-sqlapi/ and reduced the time taken by add-in from 5:48 min to 12 s. That is 29 times faster. Of which around 50% is taken by the initial load of the model.

I would now be working on loading appropriate tables whenever any element/attributes etc is modified. If I am able to achieve it, it would be ~ 60 times faster. ;-)

Code: [Select]
EA_OnContextItemChanged would be helpful I trust
Thanks
Harvinder

8
Thanks Geert,

[1] Thanks I will have a look at the EA navigator.

[2]
Furthermore, to speed up your add-in you can:
- disable GUI updates (flag in EA.Respository)
Will look into it, not sure if it important in my case as the only thing my addin does is traverse the graph of EA objects and creates C#, xml files. It does not at any point update the model.

- cache certain EA object you need more then once
I have already done this and achieved a 41% time saving by caching GetElementById.

- avoid iterating EA.Collections (such as Element.Attributes, Element.Methods)
I depend on these functions to traverse my graph. What would be the best way to avoid them? SQL query?

- use Repository.SQLQuery() to search for the id's of object you need so you can use the Repository.Get...ByID() operations to access the object
Not sure what you mean here, could you please elaborate. Generally if I have to get the parent object I do

Code: [Select]
repository.GetElementById(element.ParentID)

Are you suggesting the SQL query would help in the above case?

- use the SQL based Repository implementation provided by stao http://code.google.com/p/ea-sqlapi/
I will look into it

thanks

9
I have a addin that when invoked access the EA object model to create some artefacts. The problem is that it takes 3-5 minutes for the addin to finish and during this time the EA UI is not responsive.

Is it possible to access the EA objects using a background thread like C#'s BackgroundWorker etc....

Also, I found that accessing EA object through Automation Object Model slows the things, Is there a way to speed up things here.

Thanks
Harvinder

10
The documentation mentions that it is possible to suppress the dialog box that is shown when a new attribute is dragged to say a class (see below the excerpts from the help file of EA 9 v905). However, I have noticed that the dialog box is shown even before the call to EA_OnPreNewAttribute.

Is there any way to suppress the dialog box? I would like to show my own dialog box.


Quote
EA_OnPostNewAttribute notifies Add-Ins that a new attribute has been created on a diagram. It enables Add-Ins to modify the attribute upon creation.

This event occurs when a user creates a new attribute on an element by either drag-dropping from the Project Browser, using the Attributes Properties dialog, or using the in-place editor on the diagram. The notification is provided immediately after the attribute is created. Set Repository.SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs.


11
I finally found it

add following after the main shape
Code: [Select]
shape label
{
}

12
Thanks, it worked.

I was wondering if there is a way to hide stereotype in decision derived stereotypes too.

I have "Choose" Stereoptype extended from Decision metaclass in my UML profile. I always see "Choose" floating over the shape.

thanks
harvinder

13
Hello,

I have created a UML profile in which I have Flow Class (Stereotype) derived from Dependency (MetaClass).

I have trying to customize the look of the "Flow" through shape script, however I am not been able to get rid of the stereotype label <<flow>> in my diagram.

Cheers
harvinder

14
I have seen icons placed on top right corners (stereotype element in UML Profile).

I made one attempt by adding image to the shape script but it has two issues
[1] image get enlarged when I enlarge the shape. I would like it to be constant size.
[2] I cannot place a image with transparent areas. I tried png, but it looks like a black rectangle.

thanks
harvinder

15
Following is the shape script that I have used for dependency

Code: [Select]
shape main
{
    noshadow=true;
    setlinestyle("solid");
    moveto(0,0);
    lineto(100,0);
}

As long as the connector is straight I see solid line. However, when I break the connector I would see dashed line.

Okay
Code: [Select]
Source _______________Destination

Not so okay
Code: [Select]

_______________Destination
|

|

|

|
Source


Pages: [1] 2