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 ... 31
1
Hi,

Turns out it is possible - but only if you generate the doc as PDF (extension = ".pdf" below) due to encoding/zipping... this code did the trick for me..

p.RunReport thePackage.PackageGUID, "DB Diagram and Element Details (A3)", fname & extension
            
            Set theElement = thePackage.Elements.AddNew ("Baseline Approval Document [" & theDate & "]" & extension, "Artifact")
            theElement.LoadLinkedDocument (fname & extension)
            theElement.Update
            sql = "UPDATE t_object SET style = 'ExtDoc=1;' WHERE object_id = " & theElement.ElementID
            Repository.Execute (sql)
            
            sql = "UPDATE t_document SET DocName = '" & theElement.Name & "', ElementType = '" & extension & "', DocType = 'ExtDoc' " &_
               "WHERE ElementID = '" & theElement.ElementGUID & "' AND ElementType = 'ModelDocument'"
            Repository.Execute (sql)
            

Regards,

Jon.

2
Ok, thanks both - I think I might be able to hack my way around it with EAElement.LoadLinkedDocument (string Filename) - assuming it does the zipping/encoding of the document into t_document.strcontent ...

Regards,

Jon.

3
Hi,

Anyone know if there is an API that can be used to add a document (as an artefact in t_object and corresponding extdoc entry in t_document) to a Sparx repository ? If there isn't' an API has anyone got a script that does this ?

Regards,

Jon.

4
Hi,

What I'm really after is a way via a script. I think I remember sometime ago reading that there were some undocumented features that could be used to simulate a menu/ribbon click via script. I can't find the thread on the group however. Ring any bells with anyone ?

Regards,

Jon.

5
Hi,

Is there a way to open the Relationship Matrix via a script ? Ideally also set the 'profile' and/or source and targets ?

Regards,

Jon.

6
Hi,

As you have found its in t_document, it is in png format - however its zipped/compressed - so you need to unzip before you can save as png.

7
General Board / Re: BPMN Model folder structure
« on: October 19, 2017, 01:39:34 am »
Hi,

I think I'd qualify Simons advice. If you are creating a small (less than 10 diagrams) process mode,l then fine put everything in a single folder. If however you are documenting the processes for a medium to large business, you should think about using a Process Classification Framework (PCF) (see APQC for example) and creating a folder structure based on the PFC. I'd also recommend that you create a separate folder(s) for any elements that are reused across your model. Finally I'd recommend having a look at this webinar on the Sparx site:

http://www.sparxsystems.com/resources/webinar/partners/bpmn/bpmn-enhancements-cephas.html

Which gives a good overview on Sparx BPMN modelling.

8
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



9
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.

10
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.

11
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.

12
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)
      

13
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#");   
   }   
}

14
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.

15
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.

Pages: [1] 2 3 ... 31