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 - OpenIT Solutions

Pages: 1 [2] 3 4 ... 32
16
Hi,

Please see some vbscript I use with Repository.SQLQuery below (so I'm not using JavaScript):

set dom = CreateObject ("MSXML2.DOMDocument")

xml = Repository.SQLQuery (sql)
dom.setProperty "SelectionLanguage", "XPath"   
dom.loadXML (xml)

for each node In dom.SelectNodes ("//Row")
      pid = node.selectSingleNode("./pid").Text
      did = node.selectSingleNode("./did").Text
                 ...
NEXT



17
Hi,

I'm assuming this is possible - just not sure how. I want to include clickable links (hyperlinks) to model elements and diagrams in the text displayed in the Sparx system output window. Anyone have a VB script example of how to do this ? Any pointers to help/guides ?


Regards,


Jon.

18
Automation Interface, Add-Ins and Tools / Connector created date
« on: September 19, 2017, 03:19:35 am »
Hi,

Anyone aware of any secret db column holding the connector created date ? can't see it in t_connector. Can I get it at all or do I need to alter the table to include a created timestamp ?

Regards,

Jon.

19
Automation Interface, Add-Ins and Tools / Convert to local copy
« on: September 05, 2017, 07:57:53 pm »
Hi,

I can see a clone method on the Element Class. But I can't see the equivalent of the menu option Advanced -> Convert Linked Element to Local Copy in the API anywhere. Does the equivalent exist in the API ? Or do I clone the element and add (move) it to the required Package object ?

Regards,

Jon.

20
Hi,

Thanks; yes had to code something up in the end, see snippet of vscript for those that are interested below. You would need to replace the contents of the str variable with your own custom compartment names:

dim obj as EA.DiagramObject
dim elm as EA.Element
dim diagramObjects as EA.Collection
dim objRegEx
set objRegEx = CreateObject("VBScript.RegExp")
set diagramObjects = currentDiagram.DiagramObjects
style = currentDiagram.StyleEx
      
for each obj in diagramObjects
   set elm = Repository.GetElementByID (obj.ElementID)
         
   if elm.Stereotype = "Container" then
      uid = obj.InstanceGUID
      str = "OPTIONS_" & uid & "=CCOMP_Deliverables=1:CCOMP_Process=1:CCOMP_Measurement Points=1:CCOMP_Applications=1:CCOMP_Control Category=1;"
            
      if InStr (1, style, "OPTIONS_" & uid, 1) = 0 then
         style = str & style
      else
         objRegEx.Global = True
         objRegEx.Pattern = "OPTIONS_" & uid & ".+?;"
         style = objRegEx.Replace (style, str)
      end if
   end if
next
      
currentDiagram.StyleEx = style
currentDiagram.Update
Repository.ReloadDiagram (currentDiagram.DiagramID)
      

21
Hi,

Is there a way to automatically show custom compartments for a given stereotype? I've added a shapescript to a stereotype. It works and displays my compartments - but only if I select the Features & Properties -> Feature and Compartment Visibility and check the option to show my custom compartment. I'd like them to be shown by default somehow. My shapescript is below, it adds and compartment and shows the details of related Activities and Components...

shape RelatedElement
{

if(HasProperty("Element.Stereotype", "Activity"))
   {      
   SetCompartmentName("Process");
   AppendCompartmentText("#Connector.Name#   #TAG:taskType#: #Element.Name#");
   }   
   
      if(HasProperty("Element.Type", "Component"))
   {      
   SetCompartmentName("IT Systems");
   AppendCompartmentText("#Connector.Name#   #Element.Stereotype#: #Element.Name# - #Element.Alias#");   
   }         

   
   
   if(HasProperty("Element.Stereotype", "MeasurementPoint"))
   {      
   SetCompartmentName("Measurement Points");
   AppendCompartmentText("#Connector.Name#   #Element.Name#:  #Element.Alias#");
    }         
   
   if(HasProperty("Element.Stereotype", "ControlCategory"))
   {      
   SetCompartmentName("Control Category");
   AppendCompartmentText("#Connector.Name#   #Element.Name#");
    }
   
   
   if(HasProperty("Element.Stereotype", "DataObject"))
   {      
   SetCompartmentName("Deliverables");
   AppendCompartmentText("#Connector.Name#:  #Element.Name#");   
   }   
}

22
Hi,

The dll needs to be on your PATH AND the eaapi.jar needs to be on your Java classpath. It looks like a config issue so check both are OK.

Regards,

Jon.

23
Hi,

You can do this I think. Have a look at the bpmn2.xml MDG in the sparx install folder for an example. If you just generate a 'profile' you may not get the xmi your after - I think you need to generate an MDG - as you need to define a <taggedvaluetypes> section

Regards,

Jon.

24
Automation Interface, Add-Ins and Tools / Re: Shapescript #TAG
« on: July 12, 2017, 07:58:09 pm »
Yes, just wanted to double check - feels like an enhancement request - i'll raise one ....

25
Automation Interface, Add-Ins and Tools / Shapescript #TAG
« on: July 12, 2017, 06:37:16 pm »
Hi,

I have a tagged value of type <memo> (ie value is <memo> and notes contain the tagged values actual value/content). In my shape script if I use 'print("#TAG:condition#")' where condition is the tagged value name - the value column, ie <memo> is displayed note the actual value in the notes field. Is there anyway in a shapescript to print the actual value of a tagged value of type memo ?

Regards,

Jon.

26
Hi,

FYI, the way I ended up solving this:

Repository.Execute ("UPDATE t_diagramobjects SET ObjectStyle='Tag=1;' WHERE diagram_id = " + diagramID + " AND object_id = " + diagramObjectID);

I found that the ShowTags=true; method on EA.DiagramObject didn't work. So I had to use the above code when I wanted to show my tagged values (i.e. the ProgressBar) for a specific DiagramObject.

Regards,

Jon.

27
Hi,

In my VBscript I just use:

Set activity = package.Elements.AddNew (activityName, "BPMN2.0::Activity")
activityName.Update

And the activity has the correct BPMN2.0 tagged values.

Regards,

Jon.

28
Hi,

I have a similar requirement and would like some advice please :-)...

I'd like to show a ProgressBar ONLY if its value is less then 100%. Plus my element has multiple tagged values - I only want to show its ProgressBar tagged value, none of the others.

Is this possible via a ShapeScript ? I can't see a function/command in the shapescript notation to show a ProgressBar only the print/println statements to show the text of a tagged value. Is it possible ?

29
General Board / Re: Add an image to stereotype
« on: February 15, 2017, 01:42:14 am »
Hi,

As mentioned by Simon you will need to use a shape script ... you were almost there add _image to name and click ... then in the shape script editor add a decoration that uses the "image" command described in the link below to add an Image that you will have added to the Sparx Image Manager ...

http://www.sparxsystems.com/enterprise_architect_user_guide/10/extending_uml_models/drawing_methods.html

Hope this help,

Regards,


Jon.

30
General Board / Re: matrix overlays on BPMN activities/pool
« on: February 10, 2017, 12:20:04 am »
Hi,

I don't think so; the only think that has changed since my original post which would have related to v9.x of Sparx I think - is that v13 by default nests activities as a child of the containing pool in the project browser. See http://sparxsystems.com/resources/webinar/partners/bpmn/bpmn-enhancements-cephas.html which explains how to create BPMN models in Sparx. If you adopt this approach, you should be able to query an activities t_object.parent_id column to find out the containing pool; if the activity itself has a classifier defined in a library of processes you should also be able to query this...


Regards,


Jon.

Pages: 1 [2] 3 4 ... 32