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

Pages: [1] 2 3 ... 36
1
General Board / Re: Stereotype, tagged values, and Integer types
« on: April 19, 2018, 12:57:19 am »
Hi Martin

There is indeed a tagged value type that suits your needs, define it as follows:

Type=Spin;
LowerBound=0;
UpperBound=127;

There is an optional default defined as

Default= 0;

Hope this helps

Phil

2
Thanks Geert, I will give it a try

Phil

3
Hi All

Let's say I define an MDG with a stereotype named ABC which is based upon a meta class of UML::Class

I then define attributes (tagged values) and a shapescript within ABC as per usual

I now add a new stereotype XYZ, which is connected to ABC via a Generalisation connector, hence XYZ inherits from ABC

I generate the MDG, and test

Lo and behold the tagged values are inherited as expected, but alas the shapescript is not inherited

I suppose this is the intended behaviour, but just in case I have missed something, can shapescripts be inherited? If so how?

If not (as I suspect), then no option other than to copy the shapescript to all subclasses.

Thanks

Phil

4
General Board / Re: How to report on elements contained on a diagram
« on: January 23, 2018, 11:51:15 pm »
Try this:

  • Open the diagram properties for the diagram containing the elements to be reported on
  • Select Diagram in the tree on the left hand side
  • Check the check box labelled Add each contained element in Documentation
  • Close the Diagram Propeties

Then in your document template

  • Check Package and Diagram
  • Expand the Diagram check box and select Element

Add the data fields in the Element tags

If you wish you can use Document Options to filter the report for selected element types, etc

Phil

5
Hi All

I have solved the problem

The delimiter to be used is <p> (HTML Paragraph)

The string representing the custom field is added to the XML with a formatted attribute with a value of 1

Cheers

Phil

6
Hi All

I am developing a script for a documentation template fragment.

Part of this involves processing a list of GUIDS from a refGUIDList tagged value, getting each GUID is easy, but as part of the XML returned which contains several custom fields, I wish to return a CustomField called, say ELELIST which is a newline delimited string of element names

Does anyone know how to achieve this?

I have tried using \n as the delimiter as well as &#13;&#10; all are simply ignored during documentation generation and all element names appear on a single line of text.

Phil

7
Thanks for all the help guys

I have now got the Add In window working perfectly

Cheers

Phil

8
Hi All

I am attempting to add a custom window to an addin and have used Sparx's rather brief notes

http://sparxsystems.com/enterprise_architect_user_guide/13.5/automation/custom_docked_window.html

However the addiin window is not added:

I am using Visual Studio 2013 and C# .Net 4.5

My Code is as below:

The very simple Test Addin:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestAddIn
{
    public class TestAddIn
    {
        // ----------------------------------------------------------------------
        // Menu Strings
        // ----------------------------------------------------------------------

        private String menuHeader = null;
        private String[] menuOptions = { null };

        private bool safeDeleteIsEnabled;
        private MyCustomControl myCustomControl;       
 
        //-----------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------

        public TestAddIn()
        {
            safeDeleteIsEnabled = true;
            menuHeader = "-&Tester";
            menuOptions = new String[] { "&Checked", "-", "&Unchecked", "-", "&Show Window", "&Hide Window"};

        }

        // Enterprise Architect standard extension methods

        public void EA_Connect(EA.Repository repository)
        {

            myCustomControl = (MyCustomControl)repository.AddWindow
                     ("Test Addin", "TestAddIn.MyCustomControl");
            if (myCustomControl == null)
            {
                MessageBox.Show("Test AaddIn Custom Window not added");
            }
            else
            {
                MessageBox.Show("Test AddIn Custom Window added);
         }
        }

        public void EA_Disconnect()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }

        public object EA_GetMenuItems(EA.Repository repository,
                                      string menuLocation,
                                      string menuName)
        {

            if (menuName == String.Empty)
            {
                //return top level menu option
                return menuHeader;
            }
            if (menuName == this.menuHeader)
            {
                // return submenu options
                return menuOptions;
            }
            else
            {
                return string.Empty;
            }
        }

        public void EA_GetMenuState(EA.Repository repository,
                                    string menuLocation,
                                    string menuName,
                                    string itemName,
                                    ref bool isEnabled,
                                    ref bool isChecked)
        {
            switch (menuLocation)
            {
                case "MainMenu":
                    switch (itemName)
                    {
                        case "&Checked":
                            isEnabled = true;
                            isChecked = safeDeleteIsEnabled;
                            break;
                        case "&Unchecked":
                            isEnabled = true;
                            isChecked = !safeDeleteIsEnabled;
                            break;
                    }
                    break;
            }
        }

        public void EA_MenuClick(EA.Repository repository,
                                    string menuLocation,
                                    string menuName,
                                    string itemName)
        {
            switch (itemName)
            {
                case "&Checked":
                    safeDeleteIsEnabled = !safeDeleteIsEnabled;
                    break;
                case "&Unchecked":
                    safeDeleteIsEnabled = !safeDeleteIsEnabled;
                    break;
            }
        }
    }

}

The addin window has been added to the solutions as a Visual Studio Custom Control and the Code is:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestAddIn
{
    public partial class MyCustomControl : Control
    {
        public MyCustomControl()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}

Everything builds fine and the addin works fine, but the reference nyCustomControl is always null thus indicating the Custom Window has not not been added.

Using the Extend | Manage | Add-in Windows returns No loaded add-ins are using this window

I must be missing something, but what?

All namespaces and names are correct.s

One curious thing, the article by Sparx on Custom Windows, mentions an ActiveX Custom Control and and OCX file. I do not see any OCX file in my build, so if this is what is missing, how is such an OCX file created, and where should it be located.

Any help or advice will be most appreciated.

Phil

9
Check the ID used when the MDG is generated.

The ID must be the same name as the name used in the MDG packages, for example, if using the Model Wizard to create an MDG project browser structure, you are prompted for a name, let's say you entered MYMDG, this name is then used throughout the package structure for the MDG model.

When generating the MDG ensure that you use MYMDG as the ID, then all should be OK.

Once more thing, the ID cannot be more than 12 characters, so when choosing a name for the MDG bear this in mind.

Hope this helps
Phil

10
Uml Process / Re: How to change default programming language?
« on: October 03, 2017, 07:24:11 pm »
In addition to what Geert has suggested you can make the Code Generation Toolbar visible:

1) From the Start Ribbon select the Preferences drop down and select Customize from the menu
2) Select Toolbars
3) Check Code Generation

Select C# from the drop down in the Code Generation Toolbar

Phil


11
This is what I do

1) Model the callable process on a temporary diagrams, make it a composite element, set the sub-process and callable tagged values.
2) Double-click and model the process.
3) I have a package in my BPMN 2.0 elements library called Callable Processes, I move the callable process from 1) together with its child diagram and elements to this package,
4) Delete the temporary diagram.
5) When I want to use by callable process(es) in other process diagrams, simple re-use from the library package as LINK

Changing the name in the library, will of course change the name wherever the callable process has been used.

Phil

12
Automation Interface, Add-Ins and Tools / Re: Tagged Value Groups
« on: August 02, 2017, 05:49:48 pm »
Thanks I had a feeling that might be the case.

Phil

13
Automation Interface, Add-Ins and Tools / Tagged Value Groups
« on: August 01, 2017, 10:54:29 pm »
Hi All

Does anyone know a method in script (or SQL) to discover what Tagged Value Group a given tagged value is in?

I know that tagged value group membership is defined with a MDG Profile stereotype in the element attribute _tagGroupings, but how to access this information within a script / addin?

Cheers

Phil

14
When you create an MDG you get a toolbox containing elements within your MDG (assuming that you not define your own toolboxes). Either way, open up the toolbox containing your MDG elements (Toolbox | More Tools...)

Right-click on an element within your MDG toolbox
Select Synchronize Stereotype

You should see a dialog display

Click OK

After a while all affected elements will be displayed
Click Cancel

Repeat for all other elements in your MDG

NOTE
This action will update the Tagged Values associated with the stereotype defined within your MDG and I assume this is the update you are referring to

Phil



15
Hi Try

This code

        private EA.Connector createSequenceFlow(EA.Repository repository, Element source, Element target)
        {

            // Get corresponding elements from EA
            EA.Element EASource = repository.GetElementByGuid(source.Guid);
            EA.Element EATarget = repository.GetElementByGuid(target.Guid);

            EA.Connector sequenceFlowTo = EASource.Connectors.AddNew("", "BPMN2.0::SequenceFlow");
            sequenceFlowTo.SupplierID = EATarget.ElementID;
            sequenceFlowTo.Update();

            return sequenceFlowTo;
        }

This is written in C#, but you should be able to use to create your script

All the best#

Phil

Pages: [1] 2 3 ... 36