Book a Demo

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

Pages: [1] 2
1
General Board / "ExternalSystem" visualized as a cuboid ???
« on: January 26, 2009, 06:21:58 pm »
Hi,

in pertinent literature there is used an "ExternalSystem" visualized as a cuboid in Use-Case Diagrams.
There is also a poster from OOSE where such an "ExternalSystem" is displayed.

Now my question is if an "ExternalSystem" is part of the UML Standard and if this is the case is this element is available in EA?  :-?

Best Regards,
Daniel  :)

2
General Board / External Link to Diagram
« on: September 30, 2008, 06:26:18 pm »
Hi all!  :)

Is it possible to create an external link to a diagram which is in an EA-Model? So that you can paste the link to a Word Document for example and then EA starts, loads the model and then shows the desired diagram.

Thanks for your help!  :)

3
Hi,

I tried both, package.elements.Refresh() and  Repository.RefreshModelView(PackageID) but it is still only updated if I open the properties of a TimeLine and close it again.

I think this is a bug of timing diagrams... What is the meaning of Sparx?  ;)

Regards,
Daniel  :)

4
Hi,

I have the following problem: I manipulate a Time Line of a Time Diagram with manipulation the RunState attribute of this element.

This all works quite good, but there is no change of the Time Line in the diagram although the element is updated and refreshed and the diagram also.  :o

The change is not visible until I open the properties of the Time Line and close it. This even works if I chancel the properties dialog.

Can somebody tell me how it is possible to force a visible change from the Add-In.

Here is a part of my
Code: [Select]
private void createTiming(EA.Repository repository, string elementGUID, string[,] array, int length)
{
    EA.Element element = (EA.Element) repository.GetElementByGuid(elementGUID);

    /* Creat runstate from the schedule of the string array */
    string runstate = "";
    for (int i = 0; i < length; i++)
    {
        runstate = runstate + "@VAR;Variable=" + array[i, colIndex2 - 1] + ";Value=" + array[i, colIndex1 - 1] + ";Op==;@ENDVAR;";
    }

    /* Copy created runstate to clipboard */
    // Forms.Clipboard.SetData(Forms.DataFormats.StringFormat, runstate);

    /* Replace old RunSpace */
    element.RunState = runstate;
    element.Name = element.Name + '§';

    /* Update element... */
    if(!element.Update())
    {
        // Error
        return;
    }
    /* ... and refresh it */
    element.Refresh();
    
    EA.Package package = repository.GetPackageByID(element.PackageID);
    EA.Collection diagrams = package.Diagrams;

    for (short i = 0; i < diagrams.Count ; i++)
    {
        EA.Diagram diagram = (EA.Diagram)diagrams.GetAt(i);
        if ("Timing" == diagram.Type)
        {
            /* Update diagram */
            if (!diagram.Update())
            {
                // Error
                return;
            }
            break;
        }
    }
}

Thanks for your help!  :)

5
Hi David,
thank you very much for your help! :-) The hint with Access was very helpful.
The solution is quite simple for my problem. There is the possibility to show behavior of a Method with set a string like "ShowBeh=1;" in the StyleEx attribute. To disable you have to set "ShowBeh=0;".

Here is my
Code: [Select]
public Behavior(EA.Repository repository, string objectGUID, int show)
{
    EA.Element element = repository.GetElementByGuid(objectGUID);
    EA.Collection methods = element.Methods;

    string searchString_0 = "ShowBeh=0;";
    string searchString_1 = "ShowBeh=1;";
    string insertString = "ShowBeh=" + Convert.ToString(show) + ";";

    for (short i = 0; i < methods.Count; i++)
    {
        EA.Method method = (EA.Method)methods.GetAt(i);
        string styleEx = method.StyleEx;

        if (styleEx.Contains(searchString_0))
        {
            method.StyleEx = styleEx.Replace(searchString_0, insertString);
        }
        else if(styleEx.Contains(searchString_1))
        {
            method.StyleEx = styleEx.Replace(searchString_1, insertString);
        }
        else
        {
            method.StyleEx = styleEx.Insert(0, insertString);
        }
        /* Update modified method */
        method.Update();
    }
    /* Update ... */
    element.Update();
    /* ... and refresh modified elements */
    element.Refresh();
}


Because the entry in the help about this StyleEx attribute of a Method is wrong I sent out an bug report.

Daniel  ;)

6
Hi @ all!  :)

Does someone of you know if there is any API for showing the Behavior of a Method in a Diagram? In the documentation I found only the possibility to get accessto the Behavior field itself but not the possibility to show it.
If there is none I will request this feature because it cost a lot of time to check this option for every method and maybe uncheck again...  :-/

Thanks for your help!  :)

Daniel

7
I have just sended out a report to Sparx. Now lets see if (and when  ;)) something happens....  8-)

8
Thanks for all your help :), the next time I will open my eyes when I am reading the documentation!  ::)

I resolved this issue with replacing the GetByName() through GetAt():

Code: [Select]
/* Loops through all MethodTags of the actual operation */
for (short j = 0; j < tempLocalOperation.TaggedValues.Count; j++)
{
    /* Try to get MethodTag */
    try
    {
        objectLocalOperation = tempLocalOperation.TaggedValues.GetAt(j);
        taggedValueLocalOperation = (EA.MethodTag)objectLocalOperation;
    }
    catch (Exception e)
    {
        /* Display exception e.g. an "Out of Bounds" one */
        output.writeSystemException(e);
        return;
    }

    /* Reference to realizing operation available? */
    if ("ImplementsGuid" == taggedValueLocalOperation.Name)
    {
        break;
    }
    /* Keep in mind that actual no reference is available */
    else
    {
        taggedValueLocalOperation = null;
    }
}

9
1. -> There is a tagged value collection, when I debug I can see the correct amount of tagged values.

2. -> According to the documentation a method has a Collection of type MethodTag named TaggedValues. And because it is a collection I should have access via GetByName().

3. -> I have got access through GetByName() to TaggedValues of a Requirement without any troubles.

So I will contact Sparx Support and tell you what the results are.  ;)

10
That is the following exception:
"Action is not supported"   caused by   "System.Object GetByName(System.String)"

This exception is caused by the following line:
Code: [Select]
objectLocalOperation = tempLocalOperation.TaggedValues.GetByName("ImplementsGuid");

I´m despairing of this problem :-[, so thanks a lot for your help! :)

11
Yes, I have all this done but it didn't work.... :-/ To be shure that I didn't misunderstood you here is my whole function:

Code: [Select]

        public void adjustOperations(EA.Element localElement)
        {
            EA.Collection localOperations = localElement.Methods;
            /* Loops through all operations of the local element... */
            for (short i = 0; i < localOperations.Count; i++)
            {
                EA.Method tempLocalOperation = (EA.Method)localOperations.GetAt(i);
                EA.MethodTag taggedValueLocalOperation = null;
                object objectLocalOperation = null;
                string guidLocalOperation = null;

                try /* Try to get Value of ImplementsGuid of Tagged Values */
                {
                    objectLocalOperation = tempLocalOperation.TaggedValues.GetByName("ImplementsGuid");
                    taggedValueLocalOperation = (EA.MethodTag)objectLocalOperation;
                }
                catch(Exception e)
                {
                    /* Display exception */
                    output.writeSystemException(e);
                    break;
                }

                /* ImplementsGuid in Tagged Values available */
                if (null != taggedValueLocalOperation)
                {
                    guidLocalOperation = taggedValueLocalOperation.Value;
                }
                /* No ImplementsGuid in Tagged Values available */
                else
                {
                    output.writeHeading("E R R O R :   No \"ImplementsGuid\" in Tagged Values available!");
                    break;
                }

                /* ...and through all of the parent element... */
                for (short j = 0; j < parentOperations.Count; j++)
                {
                    EA.Method tempParentOperation = (EA.Method)parentOperations.GetAt(j);
                    /* ...compares both operations... */
                    if (guidLocalOperation == tempParentOperation.MethodGUID)
                    {
                        /* ... and adjust the child operation if necessary */
                        if (tempLocalOperation.Name != tempParentOperation.Name)
                        {
                            tempLocalOperation.Name = tempParentOperation.Name;
                            tempLocalOperation.Update();
                            operationsCount++;
                        }
                    }
                }
            }
        }

12
Thank you for your information, I have changed the cast but the exception occurs although  :o. When I debug until the exception occurs it occurs at the following line:

Code: [Select]
objectLocalOperation = tempLocalOperation.TaggedValues.GetByName("ImplementsGuid");

It is very strange because in the debugging I can see that there are three Tagged Values available, but I have no chance to get access to them, wether by name neither by number!  :-/

13
When I try to get acces to the Tagged Value "ImplementsGuid" of an operation which implements another one of an interface which is connected through a realization, the acces via Automation Interface with C# fails.

It fails with exception:
S Y S T E M   E X C E P T I O N   # 1:   "Action is not supported"   C A U S E D   B Y :   System.Object GetByName(System.String)      

This is my
Code: [Select]
     
EA.Element localElement = element;
EA.Collection localOperations = localElement.Methods;
   /* Loops through all operations of the local element... */
   for (short i = 0; i < localOperations.Count; i++)
   {
      EA.Method tempLocalOperation = (EA.Method)ocalOperations.GetAt(i);
     EA.TaggedValue taggedValueLocalOperation;
      object objectLocalOperation;

      try /* Get value of ImplementsGuid of Tagged Values */
      {
         objectLocalOperation = tempLocalOperation.TaggedValues.GetByName("ImplementsGuid");
        taggedValueLocalOperation = (EA.TaggedValue)  bjectLocalOperation;
     }
      catch(Exception e)
      {
         output.writeSystemException(e);
         break;
      }
      string guidLocalOperation = taggedValueLocalOperation.Value;
}

In another application I got acess to Tagged Values in the same way, the only difference is that I got acces to an EA.Element and now I try it with an EA.Method.

Could somebody tell me why this fails and could maybe post a solution for my problem?

Thanks for your help!  :)

14
I have seen this pages in documentation but if I do it like this I can only see the Method name in TaggedValues and not the Class.Method name. But when there is no other possibilíty it es enough for me to have the GUID of the related method.  ;)

Tanks for your help!  :)

15
If you realize in a class Cass1 the operation test1() of the interface Interface1 you get a pair of tagged values for test1() in Class1 created like this:

Implements            |    Interface1.test1()
ImplementsGuid     |    {EC07C0E8-DE1D-46a4-8D53-F3A7E3F4CD6A}


Now I want to create my own tagged values like this for the used dependency. Does sombody know the syntax for this kind of tagged values?

Thanks for your help!  :)

Pages: [1] 2