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

Pages: [1]
1
Yeah the documentation for this is completely absent.  I finally figured this out.  Here are the steps.

1. Go select a class.
2. Right Click Choose "Add/Interaction/With Sequence Diagram"

This will create a Interaction (Sequence) Diagram for you.

a. Be aware the Interaction is represented as a method/operation in your class.  Click on properties and you can set its name and arguments.

3. Now go back to your class and drag it onto the Interaction.
4. When the Dialog asks you to Drop As:  Choose Not Link, but LifeLine from the option window

Now hit generate code and you will see the (Interaction(Sequence) diagram) in your code.


2
Hey Guys, this thread really helped me to get scripting hyperlinks to point to a different sequence diagram to work.  Thank you all.  Hope this snippet helps someone out a bit.

var hyperlink as EA.Element;
                  hyperlink = srcDiagPackage.Elements.AddNew("$diagram://"+diagram.DiagramGUID,"Text");
                  hyperlink.Subtype = 0; // This one is important for hyperlinks to diagrams to work!!
                  hyperlink.Update();
                  
                  //
                  // Required Update the PDATA1 and set it to the target diagram's ID
                  //
                  Repository.Execute( "UPDATE t_object SET PDATA1='" + diagram.DiagramID + "' where object_ID = " + hyperlink.ElementID + "" );
                  
                  var diagramObject as EA.DiagramObject;
                  diagramObject = sourceDiagram.DiagramObjects.AddNew("","");
                  diagramObject.ElementID = hyperlink.ElementID;
                  if (con.EndPointX <= con.StartPointX) {
                     // Connector End Point id  <--- Place Hyper link to the left
                     diagramObject.left = con.EndPointX-35;
                     diagramObject.top = con.EndPointY+10;
                     diagramObject.right = con.EndPointX-15;
                     diagramObject.bottom = con.EndPointY-10;   
                     diagramObject.Sequence=50;                  
                  }
                  else if  (con.EndPointX > con.StartPointX) {
                     // Connector End Point id  ---> Place Hyper link to the right
                     diagramObject.left = con.EndPointX+15;
                     diagramObject.top = con.EndPointY+10;
                     diagramObject.right = con.EndPointX+35;
                     diagramObject.bottom = con.EndPointY-10;   
                     diagramObject.Sequence=50;
                  }
                  //diagramObject.ElementDisplayMode = templateElement.ElementDisplayMode;
                  //diagramObject.Style = templateElement.Style;
                  
                  diagramObject.Update();
                  sourceDiagram.Update();

Pages: [1]