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.


Topics - Hoefler1

Pages: [1]
1
Can anyone tell me why this would not work? There is an error " 'Function' expected" appearing in the line with "End Try".
There are basically 3 cases:
1. The GUID of the AttrClassifier is in OwnElems -> set IsValid = true
2. The GUID is not in OwnElems -> set IsValid = false
3. There is no Element with the ID of the Classifier (Catch the Exception thrown in first line of Try-Block) -> set IsValid = true

Code: [Select]
public function Validate(item)
dim validationResult
set validationResult = new ValidationResult
...
Try
Dim AttrClassifier As EA.Element = Repository.GetElementByID(Attribute.ClassifierID)
Dim guid
Set guid = AttrClassifier.ElementGUID
If THandler.OwnElems.Contains(guid) Then
validationResult.IsValid = true
set Validate = validationResult
Else
validationResult.IsValid = false
set Validate = validationResult
End If
Catch Exception
validationResult.IsValid = true
set Validate = validationResult
Return 'ignore default classifiers and elements without classifier
End Try
end function

2
How can I set up profiles for the Relationship Matrix using a script?

I want to automate the creation process for several profiles which must be added to all of my projects.
So running the script should then do the creation.

Where are these profiles even stored?

There is only a Getter for this: Repository.GetRelationshipMatrix() returns something like:
Code: [Select]
...<Profile linktype="Refine" source="Requirement" target="UseCase" direction="0" targetpackage="{...guid...}"
sourcepackage="{...guid...}" showsourcechildren="1" showtargetchildren="1"/>...

3
Automation Interface, Add-Ins and Tools / Get Diagram of a Hyperlink
« on: March 29, 2016, 04:38:14 pm »
Hello,

Having a DiagramObject (e.g. as a Hyperlink, DiagramFrame etc.) that links to another diagram in my Project (on doubleclick),
how can I access the diagram it links to, itself?

Thank you all in advance

4
One simple task:
The Add-In has to unselect the currently selected Connector on a Diagram (if there is one selected).
It can be accessed by Diagram.SelectedConnector
The attribute is Read/Write, so I wanted to set it to null, which leads to this error: Invalid interface passed to 'SetSelectedConnector'.

Any ideas?

5
Hey,
I want to set a certain Stereotype to each newly created element.
I use EA_OnPostNewElement and access the Element itself by
Code: [Select]
int ElementID = Int32.Parse(Info.Get("ElementID").Value);
EA.Element Element = Repository.GetElementByID(ElementID);
(This works fine)
In the User Guide it says for the Element Class:
Quote
StereotypeEx | String | Read/Write
                                   All the applied stereotypes of the element in a comma-separated list.
 
So I want to change this Attribute by assigning it to another String-Value. This shows no effect...
Someone know why?

6
General Board / Model Validation if Category is ticked
« on: March 01, 2016, 09:53:26 pm »
I created an Add-In which I want to use as a Validation.
The program shall only be called once when validating (that's why I can't use EA_OnRunPackageRule, EA_OnRunElementRule etc.)

So my thoughts were to call my main method in EA_OnStartValidation.
The problem I'm facing is, that that way the program is called each time I "Validate Current Package". Even if I disable the category in "Configure Validation Rules..."

Is there a way to find out if the category is ticked for the Validation?

Pages: [1]