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

Pages: [1]
1
Hey,

I was wondering: is there a way to update the diagram after deleting things from the model? For examlpe it's really easy to delete some selected connectors:

Code: [Select]
dim i
dim element as EA.Element
dim diagramObject as EA.DiagramObject

for i = 0 to (selectedObjects.Count - 1)
set diagramObject = selectedObjects.GetAt(i)
set element = getElementByID(diagramObject.ElementID)
dim allConnectors : allConnectors = element.Connectors.Count-1
element.Connectors.Delete(allConnectors)
element.Update

'can't seem to update diagram appearance...
currentDiagram.Update
currentDiagram.DiagramLinks.Refresh
next

But even though -- in this case -- the relationship is removed, the connector still meaninglessly appears in the diagram.

2
Automation Interface, Add-Ins and Tools / Finding Parent Lane, Pool
« on: December 23, 2016, 05:07:43 am »
(VBScript)

Is there a way to find the lane an element is located in?  I've been trying to use this through the diagram object,s but perhaps looking through the packages is better?  I hesitated to do that because they're elements and not packages.

To be clear, for something like this in Project Browser:

Pool 1
   Lane 1
      Element 1
      Element 2
   Lane 2
      Element 3
      Element 4
Pool 2
    Lane 3
      Element 5
      Element 6
   Lane 4
      Element 7
      Element 8
     

Want to be able to determine that, for example, Element 5 is located in Lane 3 in Pool 2.

3
General Board / Ghost element connections
« on: December 14, 2016, 06:43:22 am »
After deleting an element from my diagram -- but still having it in the Project Browser -- it still seems to retain Links to other elements in the diagram. This causes issues for the script I'm developing since it uses said links when going through the diagram.

Is it therefore necessary to delete these elements from the project browser? How can elements be deleted from the diagram in a way that ensures they are unlinked from those still in the diagram? It doesn't make sense to me that an element would retain its links when it's graphically removed from the model.

4
General Board / Get a gateway's "Type"?
« on: December 13, 2016, 06:32:54 am »
Hi,

This should be an easy thing, I'm just unsure of where to get the info. I want to get the name of the "Type" of an element in my VBScipt, in particular one with the stereotype "Gateway". E.g., "Parallel", "Even-Parallel", "Exclusive", etc...

I've looked through the intellisense options and have tried everything that sounded like it could be it, and have had no luck.

Thanks for the help,
Dana

5
I'll admit I haven't tried to dig into this yet, but I was wondering if anyone had already figured this one out and might have some advice?

I want to conditionally create model documents for a virtual doc and add a particular filter to their corresponding template depending on that condition, but I've never tried to change a template from inside a script before so I'm not sure how to approach this, or if it can even be done.

Thanks!
Dana

6
General Board / Invisible tags and changed Type??
« on: November 29, 2016, 05:51:08 am »
I'm trying to define flows in a diagram by tagging elements.  If element1 and element3 are tagged with the "Tag" as "tagName" and the "Value" as "tagValue", I want to tag element2 identically:

BEFORE SCRIPT:
element1 (Tag: tagName; Value: tagValue) ---(sequence connector)--> element2 (Tag: X; Value: Y) ---(sequence connector)---> element3 (Tag: tagName; Value: tagValue)

AFTER SCRIPT:
element1 (Tag: tagName; Value: tagValue) ---(sequence connector)--> element2 (Tag: tagName; Value: tagValue) ---(sequence connector)---> element3 (Tag: tagName; Value: tagValue).

This is part of the code I've been playing with to make this happen:

if ((traverseNormal) and (not normalFound)) then
      dim weirdCounter : weirdCounter = 0
      'messin about
      for each connector in myElement.Connectors
         'initialize
         connectorClientID = connector.ClientID
         connectorSupplierID = connector.SupplierID      
         set clientElement = GetElementByID(connectorClientID)
         set supplierElement = GetElementByID(connectorSupplierID)
                        'make sure it's an outgoing connector
         if clientElement.Name = myElement.Name then
            'it's determined at this point that there's only one outgoing connector, therefore supplierElement is the next element
            for each myTag in supplierElement.TaggedValues
                   'I'm doing this because I wasn't sure how to use "supplierElement.TaggedValues.AddNew" properly
               while weirdCounter = 0   
               
                     myTag.Value = "Normal"
                     myTag.Name = "Path"
                     myTag.Update
                     weirdCounter = 1
                                                        'function returns the next element tagged accordingly
                     set getNextElement = supplierElement   
                     
               wend
               
            next            
         end if
      
      next
end if


It currently enters the code given the conditions and changes element2 in some way, but when I go to the diagram and check out element2's properties and the Tags table, it appears blank still.  However, the BPMN 2.0 (the diagram type I chose) table looks quite different and the "Type" is changed -- in the case where the elements are activities -- from "abstractTask" to blank.

A template fragment, as well as code running through element2's tagged values, recognizes that element2 has been tagged as I've intended, but I'm concerned about the changed Type and I'm bewildered as to why the tagged value is invisible to me within the properties dialogue.

7
General Board / Progress Bar for a Script run from a Diagram
« on: November 23, 2016, 11:19:52 am »
Hey!

Does anyone know how to implement a progress bar that displays a script's progress as it's running? 

I have a script that analyzes diagrams, and I want to update the user of its progress as it's running -- but I'm not super keen on using the annoying message boxes. I was hoping there's something more elegant, such as a progress bar that gives info as the script is executing.

Thanks!
Dana

8
General Board / Finding elements relative to connectors in VBScript
« on: November 15, 2016, 11:01:35 am »
Hi,

Is there a way to simply access the source and target of a given connector element?  I've defined and populated an array with elements as below, where getDiagramObjects is a procedure that returns an array of elements of the specified type from the diagram:


dim arrSequenceFlows

set arrSequenceFlows = getDiagramObjects(currentDiagram, "SequenceFlow")



I want to now access the ID (or any unique identifier) of a source/target of a given element in teh array arrSequenceFlows. 

Thanks!
Dana

9
Hey,

I'm running a script from a diagram inside a package to create a virtual doc.  The script defines the model doc with a package as source.  My package structure in Project Browser looks like this:

Package 1
    Package 2
        Package 3
           My Diagram
Package 4

The script is run from My Diagram.  I want to use Package 2 and Package 4 as sources for specific model docs.  I currently understand how Package 3 can be used, but I'm unsure how to get the others.

Thanks!
Dana



10
General Board / Filtering Elements by Multiple Tagged Values in a Template
« on: November 02, 2016, 08:13:07 am »
Hey,

I'm trying to use the "Element Filters" in the "Document Options" dialogue of the document editor to select an element satisfying two or more values present in its tagged values table.

Say for element1: tag1 = val1; tag2 = val2. element2: tag1' = tag1 = val1; tag2' = val2'. Could I filter for "val1" and "val2' " to grab only element2 using two separate TagValue filters (I realize it might not be necessary in this simplistic example)?  For some reason my attempts to use two filters at once are returning nothing, despite the element having both the tags I'm filtering for.

Thanks!
Dana

11
I'm new to Enterprise Architect. I'm not sure if this has been asked, so I'll continue to look through the threads -- but here is the issue I'm struggling with:

I am trying to grab very specific values from elements in my diagrams to put in my report.

Here is a specific example to illustrate the sort of thing Iím trying to do:

Here is a simplistic activity diagram, for the purposes of the example:

(start) ----> [Activity1]----> <Decision1> ----> [Activity2] ----> (end)

I want to be able to code in my document

1.   {Field that specifies name of only the first activity}
2.   {Field that specifies name of only the first decision}
3.   {Field that specifies name of only the second activity}

So that the result in the generated document is

1.   Activity1
2.   Decision1
3.   Activity2


I have tried a lot and I am very confused about how to obtain this level of specificity in report generation from my model. Is this possible to do? So far Iíve played with the ďSectionsĒ part of the templates, template fragments, and even some SQL code and custom queries, but havenít figured out how to do this. Please let me know if any more info is required to answer my question, or if there's a thread somewhere already addressing this!

Thanks!



Pages: [1]