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 - Jeff Hegedus

Pages: [1]
1
General Board / Show Element Description in attached Note
« on: October 29, 2016, 12:38:25 am »
Does anyone know if there is any feature in EA for showing the description of a diagram in an attached Note or visual element of some kind, rather than showing it inside the body of the element itself?  This would give more control over presentation in diagrams.

2
General Board / EA 13 Customize Toolbar
« on: October 28, 2016, 11:30:59 pm »
Does anyone know how it is possible to add commands to toolbars when those commands are not in the default list.  For example, how would I add "Align Horizontally" and "Align Vertically" to the diagram toolbar.  The help seems to refer to facilities available in older EA versions but no longer available in EA 13 and I haven't been able to figure it out by spelunking.

3
Hi all, I've created an MDG with a base profile with my element stereotypes, a diagram profile and a toolbox profile.  Everything is working as I expected.  I would also like to have the built in "Class" and "Class Relationships" toolbox pages show up for my diagram.  I thought I remembered reading about how to do this once upon a time but I can't remember the details and I can't find any reference to it on the help, here or through Google.  Does anyone know if it is possible and where I might find a little guidance?

4
Uml Process / Formatted String for Attribute
« on: April 06, 2016, 04:02:26 am »
Is it possible to create a formatted string for an attribute type like you can for tagged values (help at http://sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/creatingacustomtaggedvalue.html)?  I've been digging through help, the forum and google and haven't been able to find anything.

I would like to create a string for semantic versioning that follows the <majorversion>.<minorversion>.<patch> format.  I know I could create a class and fill in the three values separately, just wondering if Sparx has any features to improve the user experience when populating masked string attributes.  Any suggestions would be greatly appreciated.

5
I've been working on a transformation for C# but the model that I need to transform uses multiple inheritance.  C# does not support multiple class inheritance, though it does support implementation of multiple interfaces.  So in my transform, I'm checking if the class is inherited by a class that uses multiple inheritance and if it is, I'm trying to create an interface and a class from the original class and change all of the original generalizations to point to the newly created interface.

The code in the intermediate file looks right to me and everything works except the associations to the interface created by the transformation.  I've pasted the text from the intermediate file specific to the associations that are not working, the transformation code and a link to the full text of the intermediate file below.  There is an EXEC_ADD_IN call to determine if the class is inherited by a class that uses multiple inheritance in the transformation and I have not posted the addin code but I have tested the function used and verified that it operates as expected.

Does anyone see what could be causing the problem?  Any help will be greatly appreciated.

---------------------------- Associations from the Intermediate File -------------------------------------
Code: [Select]
Association
{
  notes=""
  alias=""
  name="A_upperValue_owningUpper"
  stereotype=""
  direction="Source -> Destination"
  XRef{namespace="C#" name="Connector" source="{8C04F9C8-612A-43d9-9312-EC0BB21D899D}"}
  Source
  {
  XRef{namespace="C#" name="Class" source="{4AAEB96F-92DE-4076-BCE6-1A2E7AEE6C17}"}
    access="Private"
  notes=""
  qualifier=""
  ordered="0"
  scope=""
  multiplicity="0"
  role="owningUpper"
  alias=""
  containment=""
  stereotype=""
  membertype=""
  allowduplicates=""
  navigability="Non-Navigable"
  changeable=""
  constraint=""
  aggregation="2"
  }
  Target
  {
  XRef{namespace="C#" name="Class" source="{DD7BB394-4F3E-4dd5-98B7-34924F8FB403}"}
    access="Private"
  notes="The specification of the upper bound for this multiplicity."
  qualifier=""
  ordered="0"
  scope=""
  multiplicity="0"
  alias=""
  containment=""
  stereotype=""
  membertype=""
  allowduplicates=""
  navigability="Navigable"
  changeable=""
  constraint=""
  aggregation="0"
  role="upperValue"
  }
}
Association
{
  notes=""
  alias=""
  name="A_lowerValue_owningLower"
  stereotype=""
  direction="Source -> Destination"
  XRef{namespace="C#" name="Connector" source="{322D7D08-5A0A-4054-9779-5923BE8090F1}"}
  Source
  {
  XRef{namespace="C#" name="Class" source="{4AAEB96F-92DE-4076-BCE6-1A2E7AEE6C17}"}
    access="Private"
  notes=""
  qualifier=""
  ordered="0"
  scope=""
  multiplicity="0"
  role="owningLower"
  alias=""
  containment=""
  stereotype=""
  membertype=""
  allowduplicates=""
  navigability="Non-Navigable"
  changeable=""
  constraint=""
  aggregation="2"
  }
  Target
  {
  XRef{namespace="C#" name="Class" source="{DD7BB394-4F3E-4dd5-98B7-34924F8FB403}"}
    access="Private"
  notes="The specification of the lower bound for this multiplicity."
  qualifier=""
  ordered="0"
  scope=""
  multiplicity="0"
  alias=""
  containment=""
  stereotype=""
  membertype=""
  allowduplicates=""
  navigability="Navigable"
  changeable=""
  constraint=""
  aggregation="0"
  role="lowerValue"
  }
}
---------------------------- Associations from the Intermediate File -------------------------------------



----------------------------------------- Class Template ---------------------------------------------------
Code: [Select]
$templateName = "Class__EIIW_Class"
%if elemType != "Class" and elemType != "Interface" and elemType != "Enumeration"%
%endTemplate%

$isMultiplyInherited = %EXEC_ADD_IN("EIIWEAAddin", "IsMultiplyInherited", classGUID)%
%if $isMultiplyInherited == "true"%
$interfaceName="I"+%className%

Interface
{
  %TRANSFORM_REFERENCE("Interface", classGUID)%
  %TRANSFORM_CURRENT("language", "name")%
  name=%qt%$interfaceName%qt%
  language="C#"
%list="ClassBase" @separator="\n" @indent="  "%
%list="ClassInterface" @separator="\n" @indent="  "%
%list="InnerClass" @separator="\n" @indent="  "%
%list="Attribute__Property" @separator="\n" @indent="  " attScope=="Public"%
%list="Operation" @separator="\n" @indent="  "%
}
%list="Connector__EIIW_InterfaceConnectorsFromClass" @separator="\n"%

%elemType%
{
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT("language")%
  language="C#"
%list="ClassBase" @separator="\n" @indent="  "%
%list="ClassInterface" @separator="\n" @indent="  "%
%list="InnerClass" @separator="\n" @indent="  "%
%if elemType!="Interface"%
%list="Attribute" @separator="\n" @indent="  "%
%endIf%
%list="Attribute__Property" @separator="\n" @indent="  " attScope=="Public"%
%list="Operation" @separator="\n" @indent="  "%
}
%list="Connector__EIIW_Association" @separator="\n"%

Generalization
{
%TRANSFORM_REFERENCE("Connector", classGUID)%
Source
{
%TRANSFORM_REFERENCE("Class",classGUID)%
  access=%qt%Public%qt%
  notes=%qt%Generalization to transformation created interface.%qt%
}
Target
{
%TRANSFORM_REFERENCE("Interface",classGUID)%
  access=%qt%Public%qt%
}
}

%else%

%elemType%
{
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT("language")%
  language="C#"
%list="ClassBase" @separator="\n" @indent="  "%
%list="ClassInterface" @separator="\n" @indent="  "%
%list="InnerClass" @separator="\n" @indent="  "%
%if elemType!="Interface"%
%list="Attribute" @separator="\n" @indent="  "%
%endIf%
%list="Attribute__Property" @separator="\n" @indent="  " attScope=="Public"%
%list="Operation" @separator="\n" @indent="  "%
}
%list="Connector__EIIW_Association" @separator="\n"%
%endIf%
----------------------------------------- Class Template ---------------------------------------------------

-------------------------------------- Connector Template -------------------------------------------------
Code: [Select]
$templateName = "Connector"
%connectorType%
%PI="\n  "%
{
%TRANSFORM_CURRENT()%
%TRANSFORM_REFERENCE("Connector",connectorGUID)%
%if connectorIsAssociationClass=="T"%
AssociationClass
{
%TRANSFORM_REFERENCE("Class",connectorAssociationClassElemGUID)%
}
%endIf%
Source
{
$debugMessage=%classGUID%
$debugMessage = "classGUID == " + $debugMessage
%DebugMessage($templateName, $debugMessage)%
%if connectorSourceElemGUID == classGUID%
$debugMessage = "connectorSourceElemGUID == classGUID"
%DebugMessage($templateName, $debugMessage)%
%TRANSFORM_REFERENCE("Interface",classGUID)%
%else%
$debugMessage = "connectorSourceElemGUID != classGUID"
%DebugMessage($templateName, $debugMessage)%
%TRANSFORM_REFERENCE("Class",connectorSourceElemGUID)%
%endIf%
  access=%qt%%connectorSourceAccess == "Public" ? "Private" : value%%qt%
%TRANSFORM_CURRENT("Source","access")%
}
Target
{
%if connectorDestElemGUID == classGUID%
$debugMessage = "connectorDestElemGUID == classGUID"
%DebugMessage($templateName, $debugMessage)%
%TRANSFORM_REFERENCE("Interface",classGUID)%
%else%
$debugMessage = "connectorDestElemGUID != classGUID"
%DebugMessage($templateName, $debugMessage)%
%TRANSFORM_REFERENCE("Class",connectorDestElemGUID)%
%endIf%
  access=%qt%%connectorDestAccess == "Public" ? "Private" : value%%qt%
%TRANSFORM_CURRENT("Target","access", "role")%
$role=%connectorDestRole == "object" ? "objectAttr" : value%
$role=%EIIW_ConvertName($role)%
role=%qt%$role%qt%
%PI="\n"%
}
}
-------------------------------------- Connector Template -------------------------------------------------

https://onedrive.live.com/prev?id=1737A31617426660%2159459&cid=1737A31617426660&parId=1737A31617426660%21134&v=TextFileEditor

6
I want to have a template that takes the name of another template to call as a parameter and then calls that parameter with the result of some other processing.  I tried the below but it doesn't work.  It just prints out the string "=%ReturnInputPlusJJH("testString")%" instead of executing it as a call to the child template.  Is what I'm trying possible?  Does anyone know how to do it?

--------------------------------------- Main -----------------------------------------------------
Code: [Select]
$templateName="ReturnInputPlusJJH"
%CallPassedInTemplate($templateName)%
--------------------------------------- Main -----------------------------------------------------

-------------------------------- CallPassedInTemplate -----------------------------------------
Code: [Select]
$templateToCall=$parameter1

$testString="testString"
$templateCall=$templateToCall+"("+%qt%+$testString+%qt%+")"
$returnValue=%$templateCall%
$returnValue
-------------------------------- CallPassedInTemplate -----------------------------------------


-------------------------------- ReturnInputPlusJJH -------------------------------------------
Code: [Select]
$returnValue=$parameter1+"JJH"
$returnValue
-------------------------------- ReturnInputPlusJJH -------------------------------------------

7
The default code templates have the following in them (jus a snipit - not the whole template) for the "Action Create" template

Code: [Select]
$result =  %EASL_GET("Property", $GUID, "Pin", "Result")%
%if $result == ""%
/*Warning: $sActionName - Result Pin Not Found!*/
%endTemplate%

I have added a Create Object Action to the model and added an ActionPin named "Result".  When I generate the code, I get this warning generated, so it isn't finding my "Result" pin.  Has anyone used this?  Is the code wrong or is it looking for something other than an action pin?

Thanks in advance for any help.

Pages: [1]