Chad figured this out last night. In addition to understanding that the
name of the file containing the datatype mappings has nothing to do with the
process (it's controlled by the name attribute on the mappings element
<mappings name="Java">), the other important thing to know is that ALL files
in the directory are processed and if you have multiple sets of mappings for
the same namespace, the results are undefined.
In my case I made my edits using emacs and it saved a backup copy of
JavaWrappings.xml as JavaWrappings.xml~ which apparently took precedence
because it collates after the original filename. If you leave a file named
zzzBadMappings-DONT-EVER-USE.bad.bad lying around in the mapping directory,
you may be surprised at the result!
To make this less likely to happen in the future, I've changed my
mda/build.xml from
<mappingsSearchPath>
<pathelement location="${basedir}/src/mappings"/>
</mappingsSearchPath>
to
<mappingsSearchPath>
<fileset dir="${basedir}/src/mappings">
<include name="*Mappings.xml"/>
<exclude name="**/CVS/*"/>
</fileset>
</mappingsSearchPath>
You can also bet that I'll scrutinize the contents of the directory extra
carefully after any edits!
I'd suggest that, if possible, multiple conflicting sets of mappings be
flagged as an error.
Tom
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Tom Morris
> Sent: Monday, January 03, 2005 5:19 PM
> To: 'Chad Brandon'; [email protected]
> Subject: RE: [Andromda-user] Modeling datatypes - builtin and custom?
>
>
> > [CB] The mappingsSearchPath looks for the name attribute in
> > the each mappings file <mappings name="JavaX"/> (it's not
> > based on the actual file name). Try that and let me know if
> > it still doesn't pick it up.
>
> Ahhh! I never would have spotted that. That's probably
> worth highlighting in the documentation, particularly since
> the nice regular file names make it easy to assume that the
> filename is the key.
>
> Didn't make a difference to the behavior though. I changed
> JavaXMappings.xml to specify <mappings name="JavaX">, changed
> build.xml back to specify <property
> name="languageMappingsUri" value="JavaX"/> in the default
> name space and tested with both the directory and file
> versions of mappingsSearchPath and neither one worked.
>
> Tom
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Chad Brandon
> > Sent: Monday, January 03, 2005 4:47 PM
> > To: 'Tom Morris'; [email protected]
> > Subject: RE: [Andromda-user] Modeling datatypes - builtin
> and custom?
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Tom Morris
> > Sent: Monday, January 03, 2005 2:42 PM
> > To: [email protected]
> > Subject: RE: [Andromda-user] Modeling datatypes - builtin
> and custom?
> >
> > I was able to spend some more time debugging this and it
> > looks like it may be something to do with the way
> > mappingsSearchPath element of the Ant andromda task works (or
> > doesn't). All the editing I was doing to the various mapping
> > files wasn't getting picked up which is why nothing ever worked.
> >
> > [CB] The mappingsSearchPath looks for the name attribute in
> > the each mappings file <mappings name="JavaX"/> (it's not
> > based on the actual file name). Try that and let me know if
> > it still doesn't pick it up.
> >
> > I noticed the Jira issue CORE-24 which seems to have
> > introduced a change in behavior here, but neither the old
> > syntax directory-based or the new file-based syntax seems to
> > work. http://team.andromda.org:8080/jira/browse/CORE-24
> >
> > The build.xml in the mda subdirectory sets the
> > languageMappingsUri which I changed from its default value of
> > Java to JavaX (and created a corresponding JavaXMapping.xml
> > file) to make sure I could tell when it was working and when
> > it wasn't.
> >
> > <namespace name="default" ignore="false">
> > <property name="languageMappingsUri" value="JavaX"/>
> > </namespace>
> >
> > This fails to find the file
> > ${baseddir}/src/mappings/JavaXMappings.xml using both the old
> > and new values for the mappingsSearchPath element.
> >
> > The only way I've been able to get it to work is by
> > hardwiring a specific file name :
> >
> > <property name="languageMappingsUri"
> > value="file:${basedir}/src/mappings/JavaXMappings.xml"/>
> >
> > How is this supposed to work? As an aside, where does the
> > expansion from "Java" to "<path>JavaMappings.xml" happen?
> >
> > If this is a bug I can file a Jira report, but I'm not sure
> > there's not some hidden black magic that I'm missing here.
> >
> > Tom
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user