Book a Demo

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

Pages: [1] 2
1
Bugs and Issues / Re: Model transformation to DDL: multiplicity & NU
« on: January 27, 2010, 03:27:53 am »
Peter,
The transform template for the DDL attributes is :
Column
{
  %TRANSFORM_CURRENT("type", "stereotype", "collection", "constant", "containment", "ordered", "static", "volatile")%
  type=%qt%%CONVERT_TYPE(genOptDefaultDatabase,attType)%%qt%
}

I'm no expert in DDL, but there doesn't appear to be any specific manipulation of the attLowerBound or attUpperBound properties, whereas in the XSD transform it contains these lines:

%if attLowerBound!=""%
  Tag
  {
    name="minOccurs"
    value=%qt%%attLowerBound=="*" ? "unbounded" : value%%qt%
  }
%endIf%
%if attUpperBound!=""%
  Tag
  {
    name="maxOccurs"
    value=%qt%%attUpperBound=="*" ? "unbounded" : value%%qt%
  }
%endIf%

It may be that you need to change the default code to do something explicitly as above.
Hope this helps.
Dan

2
Bugs and Issues / Re: Datatype mapping
« on: January 27, 2010, 03:12:41 am »
Hi Peter,

i am doing datatype conversions from logical model to xml schema and have used the transformation templates as follows.

%if attType=="Date"%
  type="xs:date"
%elseIf attType=="Title"%
  type="xs:string"
%elseIf attType=="indicator"%
  type="xs:boolean"
%elseIf attType=="Description"%
  type="xs:string"
%elseIf attType=="Time"%
  type="xs:time"
%else%
  type="xs:string"
%endIf%

It may be that the transformation you are doing has an inbuilt conversion?  I hope this helps a bit.
Regards,
Dan

3
Bugs and Issues / Use Stylesheet on export
« on: May 11, 2010, 08:52:39 pm »
Hi,

can anyone tell me how to point EA at a stylesheet to use when exporting to XMI?  The dropdown box appears blank, should I save my xsl to a specific folder for EA to pick up?

Thanks
Dan

4
Bugs and Issues / Check across several connectors
« on: February 05, 2010, 03:10:26 am »
Hi,

Does anyone know how I can write code in the transform template to check whether there are multiple associations between the source class and the target class.  I.e. from within the scope of one connector, return other associations with the same target class name.

Thanks
Dan

5
Bugs and Issues / Re: Connector Template for different stereotypes
« on: February 02, 2010, 08:18:03 pm »
Thanks for the help, I'll give it a go

6
Bugs and Issues / Re: Connector Template for different stereotypes
« on: February 01, 2010, 10:49:00 pm »
Apologies if I'm missing something, but in the prompt dropdown, the properties listed are connectorSourceStereotype and connectorDestStereotype, there isn't a connectorSourceElemStereotype.  When I type in connectorSourceElemStereotype, it isn't recognised.

7
Bugs and Issues / Connector Template for different stereotypes
« on: January 28, 2010, 10:18:36 pm »
Hi,

I am trying to split the code within the Connector template, dependent on the Stereotype applied to the source class.  I have tried the following code at the start of the template, but it doesn't correctly evaluate the connectorSourceStereotype, I'm wondering whether the stereotype of the source class is within scope of the connector template.  - How can I know which macros are in scope at any point in the code?


%if connectorSourceStereotype!="reference entity"%

%connectorType%
%PI="\n  "%


{

%TRANSFORM_CURRENT("Direction", "name")%
%TRANSFORM_REFERENCE("Connector",connectorGUID)%
name="Reference Association"
Source
{


Dan

8
Bugs and Issues / Create XSD classes only for first Transformation
« on: February 02, 2010, 02:27:17 am »
Hi,
I would like to create a set of standard complexTypes in the XSD transform template that are only created if the transform is being run for the first time.  How can I check that the transform hasn't been run before, or alternatively check whether the target package for the transform contains the standard complexTypes?
Do the packageIsFirstNonEmpty or packageHasGenClasses  properties have anything to do with it?
I can't find these properties in the help files,
Thanks.

9
Bugs and Issues / Re: Creating Attributes within Connector Template
« on: February 02, 2010, 02:05:13 am »
thanks, I've modified the Class template to create an attribute for specific types of association.

Cheers for the help

10
Bugs and Issues / Creating Attributes within Connector Template
« on: January 29, 2010, 03:53:54 am »
Hi,
What I would like to do is create an attribute for a Foreign Key within the target end of an association.  I can see how the DDL template works, but it is creating columns, rather than attributes - I think this makes a difference.  I am trying the following code, but the Attribute tag is unexpected when I run the transform.

     Target
      {
        %TRANSFORM_REFERENCE("XSDClass",connectorDestElemGUID)%
        %TRANSFORM_CURRENT("Target","Direction", "Multiplicity","role", "Constraint")%
                  Multiplicity=%qt%$destMult%qt%
                  role=%qt%%CONVERT_NAME(connectorDestElemName,"Underscored", "Pascal Case")%%qt%
                  
                  Constraint=""
                  
                  Attribute
                  {
                        name="TESTID"
                        type="xs:integer"
                  }
      }


Can I include an attribute this way, if so how does it work in a template?
Thanks
Dan

11
Bugs and Issues / Re: Editing Connector Transform Template
« on: January 28, 2010, 08:36:13 pm »
Thanks,
that's great, now I can change the association name and the role name.  I couldn't see why the code for the DDL transform was changing the  'name' of the Source and Target, but when I tried doing the same in the XSD script it didn't work?  I guess I should just use 'role' instead.

How can I get a list of all the parameters / property names of the classes, attributes and associations?  In the help file it is not clear which ones apply to which object type.

Any help massively appreciated
Thanks
Dan

12
Bugs and Issues / Editing Connector Transform Template
« on: January 28, 2010, 02:27:49 am »
Hi,
I am relatively new to the transform templates, and am trying to understand how to change the XSD Connector template.  I would like to use the Target Class Name instead of the Target Role Name when naming the associations in the PSM.  However I can't see how I  can set up the template to allow me to change the Name.  I can see how it is done in the DDL template, but when I try to copy the approach I get 'Unexpected Symbol on line xx'
My code is as follows:
Source
{
            %TRANSFORM_REFERENCE("XSDClass",connectorSourceElemGUID)%
                  name=%qt%%connectorSourceElemName%%qt%
                  multiplicity="0..1"
            %TRANSFORM_CURRENT("Source", "multiplicity", "name")%
                  
}

Thanks
Dan

13
Bugs and Issues / Re: Can't get TRIM_LEFT to work
« on: January 27, 2010, 08:34:53 pm »
Thanks,

should have spotted that the macro wasn't being recognised in the editor

Dan

14
Bugs and Issues / Can't get TRIM_LEFT to work
« on: January 27, 2010, 03:31:16 am »
Hi,

probably something obvious, but I can't get the TRIM_LEFT function to drop the first 3 characters from an attribute name string. I'm using the following code:
 $shortName=%TRIM_LEFT(attName,3)%
Can anyone help?

Dan

15
Bugs and Issues / Re: rerunning model transformations
« on: January 27, 2010, 03:21:45 am »
I also have the same experience, which is frustrating because there are some properties of the PSM which can't automatically be derived from the PIM.  In my case the Navigability of associations needs to be set manually to determine the hierarchy structure of an xml schema.

It seems that the transform overwrites certain properties in the target model, e.g. role names on associations, but doesn't care about how Navigability is set in the target model.  

This seems odd because the Transform Templates are usually set up to transfer all properties, unless specified otherwise.  I wonder whether the transform templates can be coded to explicitly take into account any changes you make in the target model?

Have either of you got anywhere with sparx support?
Dan

Pages: [1] 2