Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Evaluator: QvtRuntimeException by Transformation
[QVTO] Evaluator: QvtRuntimeException by Transformation [message #496655] Tue, 10 November 2009 19:43 Go to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
i want to transform UML to XSD
i become this Error:

org.eclipse.m2m.internal.qvt.oml.evaluator.QvtRuntimeExcepti on: java.lang.NullPointerException
at uml2xsd::Package::package2schema(uml2xsd.qvto:26)
at uml2xsd::Package::toschema(uml2xsd.qvto:21)
at uml2xsd::main(uml2xsd.qvto:<Unknown>)

my code looks like this:

modeltype UML "strict" uses 'http://www.eclipse.org/uml2/3.0.0/UML';
modeltype XSD "strict" uses 'http://www.eclipse.org/xsd/2002/XSD';

transformation uml2xsd(in uml:UML, out xsd:XSD);

main() {
uml.objectsOfType(UML::Package) -> map toschema();
}

mapping UML::Package::toschema() : xsd::XSDSchema{
init{
var schemaTargetNamespace := 'http://www.example.com/' + self.name;
var schemaTargetPrefix := self.name.normalizeSpace();
var schemaForSchemaNamespace := 'http://www.w3.org/2001/XMLSchema';
var schemaForSchemaPrefix := 'xsd';

result.targetNamespace := schemaTargetNamespace;
result := self.map package2schema();
}
}
mapping UML::Package::package2schema() : XSD::XSDSchema {
var newObj := object XSDSchema{
schema.contents := self.packagedElement[UML::Class] -> map class2complexType();
schema.contents := self.packagedElement[UML::Class] -> map class2attributeGroup();
result := schema;
}

}

mapping UML::Class::class2complexType() : XSD::XSDComplexTypeDefinition {

name := self.name + 'Type';
_abstract := self.isAbstract;
derivationMethod := self.getDerivationMethod();
}

mapping UML::Class::class2attributeGroup() : XSD::XSDAttributeGroupDefinition{

}

query UML::Class::getDerivationMethod() : XSDDerivationMethod{
return if self.generalization -> notEmpty() then
XSDDerivationMethod::extension
else
XSDDerivationMethod::restriction
endif;
}

please help me.
Thanks,

[Updated on: Tue, 10 November 2009 19:45]

Report message to a moderator

Re: [QVTO] Error by Transformation [message #496657 is a reply to message #496655] Tue, 10 November 2009 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Youssef,

Could you please check the Eclipse 'Error Log'?
I assume a Java stack-trace is logged there.

Regards,
/Radek


On Tue, 10 Nov 2009 20:43:12 +0100, Youssef <aitlaydi.youssef@gmail.com>
wrote:

> i want to transform UML to XSD
> i become this Error:
>
> org.eclipse.m2m.internal.qvt.oml.evaluator.QvtRuntimeExcepti on:
> java.lang.NullPointerException
> at uml2xsd::Package::package2schema(uml2xsd.qvto:26)
> at uml2xsd::Package::toschema(uml2xsd.qvto:21)
> at uml2xsd::main(uml2xsd.qvto:<Unknown>)
>
> my code looks like this:
>
> modeltype UML "strict" uses 'http://www.eclipse.org/uml2/3.0.0/UML';
> modeltype XSD "strict" uses 'http://www.eclipse.org/xsd/2002/XSD';
>
> transformation uml2xsd(in uml:UML, out xsd:XSD);
>
> main() {
> uml.objectsOfType(UML::Package) -> map toschema();
> }
>
> mapping UML::Package::toschema() : xsd::XSDSchema{
> init{
> var schemaTargetNamespace := 'http://www.example.com/' + self.name;
> var schemaTargetPrefix := self.name.normalizeSpace();
> var schemaForSchemaNamespace := 'http://www.w3.org/2001/XMLSchema';
> var schemaForSchemaPrefix := 'xsd';
>
> result.targetNamespace := schemaTargetNamespace;
> result := self.map package2schema();
> }
> }
> mapping UML::Package::package2schema() : XSD::XSDSchema {
> var newObj := object XSDSchema{
> schema.contents := self.packagedElement[UML::Class] -> map
> class2complexType();
> schema.contents := self.packagedElement[UML::Class] -> map
> class2attributeGroup();
> result := schema;
> }
>
> }
>
> mapping UML::Class::class2complexType() : XSD::XSDComplexTypeDefinition {
>
> name := self.name + 'Type';
> _abstract := self.isAbstract;
> derivationMethod := self.getDerivationMethod();
> }
>
> mapping UML::Class::class2attributeGroup() :
> XSD::XSDAttributeGroupDefinition{
>
> }
>
> query UML::Class::getDerivationMethod() : XSDDerivationMethod{
> return if self.generalization -> notEmpty() then
> XSDDerivationMethod::extension
> else
> XSDDerivationMethod::restriction
> endif;
> }
>
> please help me.
> Thanks,
Re: [QVTO] Error by Transformation [message #496733 is a reply to message #496657] Wed, 11 November 2009 08:52 Go to previous messageGo to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
Hi Radek,

thanks,
the Error LOg is below.
I think, I must Import the class xsdschema from the package org.eclipse.xsd in order to use the method setSchemaForSchemaQNamePrefix( schemaForSchemaPrefix ) and getQNamePrefixToNamespaceMap() . because the schema is empty.
the first mapping will be look like this:

mapping UML::Package::toschema() : xsd::XSDSchema{
init{
var schemaTargetNamespace := 'http://www.example.com/' + self.name;
var schemaTargetPrefix := self.name.normalizeSpace();
var schemaForSchemaNamespace := 'http://www.w3.org/2001/XMLSchema';
var schemaForSchemaPrefix := 'xsd';
result.targetNamespace := schemaTargetNamespace;

result := result.setSchemaForSchemaQNamePrefix( schemaForSchemaPrefix );
[Map qNamePrefixToNamespaceMap = result.getQNamePrefixToNamespaceMap();
result := self.qNamePrefixToNamespaceMap.put(schemaForSchemaPrefix , schemaForSchemaNamespace );
result := self.qNamePrefixToNamespaceMap.put(schemaTargetPrefix , schemaTargetNamespace );



result := self.map package2schema();
}
import org.eclipse.xsd.xsdschema did not function. how can I import a Library or a Package?
thanks,

the Error log is below

eclipse.buildId=M20090917-0800
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


Error
Wed Nov 11 09:05:14 CET 2009
Operational QVT: Exception

java.lang.NullPointerException
at org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.handleNewB aseTypeDefinition(XSDComplexTypeDefinitionImpl.java:2116)
at org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.patch(XSDC omplexTypeDefinitionImpl.java:1061)
at org.eclipse.xsd.impl.XSDConcreteComponentImpl.patch(XSDConcr eteComponentImpl.java:535)
at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java: 1602)
at org.eclipse.xsd.impl.XSDSchemaImpl.traverseToRootForPatching (XSDSchemaImpl.java:1529)
at org.eclipse.xsd.impl.XSDSchemaImpl.adoptContent(XSDSchemaImp l.java:1921)
at org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDCon creteComponentImpl.java:1074)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(E coreEList.java:255)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:300)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList. java:307)
at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvalu ationEnv.callSetter(QvtOperationalEvaluationEnv.java:531)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVi sitorImpl.java:412)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:3 27)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpIm pl.accept(AssignExpImpl.java:404)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVi sitorImpl.java:950)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:3 79)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpI mpl.accept(ObjectExpImpl.java:176)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitVariableInitExp(QvtOperationalEvalua tionVisitorImpl.java:1004)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitVariableInitExp(QvtGenericEvaluationVisitor. java:407)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.VariableIni tExpImpl.accept(VariableInitExpImpl.java:262)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVi sitorImpl.java:950)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:3 79)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpI mpl.accept(ObjectExpImpl.java:176)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitOperationBody(QvtOperationalEvaluati onVisitorImpl.java:985)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingBody(QvtOperationalEvaluation VisitorImpl.java:569)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java :355)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBod yImpl.accept(MappingBodyImpl.java:122)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingOperation(QvtOperationalEvalu ationVisitorImpl.java:732)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingOperation(QvtGenericEvaluationVisitor .java:363)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOpe rationImpl.accept(MappingOperationImpl.java:220)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.executeImperativeOperation(QvtOperational EvaluationVisitorImpl.java:1611)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.doVisitOperationCallExp(QvtOperationalEva luationVisitorImpl.java:638)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitOperationCallExp(QvtOperationalEvalu ationVisitorImpl.java:597)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluat ionVisitorImpl.java:587)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.j ava:359)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCal lExpImpl.accept(MappingCallExpImpl.java:112)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVi sitorImpl.java:354)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:3 27)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpIm pl.accept(AssignExpImpl.java:404)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingBody(QvtOperationalEvaluation VisitorImpl.java:555)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java :355)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBod yImpl.accept(MappingBodyImpl.java:122)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingOperation(QvtOperationalEvalu ationVisitorImpl.java:732)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingOperation(QvtGenericEvaluationVisitor .java:363)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOpe rationImpl.accept(MappingOperationImpl.java:220)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.executeImperativeOperation(QvtOperational EvaluationVisitorImpl.java:1611)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.doVisitOperationCallExp(QvtOperationalEva luationVisitorImpl.java:638)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitOperationCallExp(QvtOperationalEvalu ationVisitorImpl.java:597)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluat ionVisitorImpl.java:587)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.j ava:359)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCal lExpImpl.accept(MappingCallExpImpl.java:112)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitExpression(QvtOperationalEvaluationV isitorImpl.java:329)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(E valuationVisitorDecorator.java:156)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitExpression(QvtGenericEvaluationVisitor.java: 191)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtImpe rativeIteratorTemplate.evaluateResultTemplate(QvtImperativeI teratorTemplate.java:45)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtIter ationTemplate.evaluate(QvtIterationTemplate.java:84)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitImperativeIterateExp(QvtOperationalE valuationVisitorImpl.java:1341)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitImperativeIterateExp(QvtGenericEvaluationVis itor.java:435)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.ImperativeI terateExpImpl.accept(ImperativeIterateExpImpl.java:210)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitOperationBody(QvtOperationalEvaluati onVisitorImpl.java:985)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitEntryOperation(QvtOperationalEvaluat ionVisitorImpl.java:459)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitEntryOperation(QvtGenericEvaluationVisitor.j ava:443)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.EntryOpera tionImpl.accept(EntryOperationImpl.java:67)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.executeImperativeOperation(QvtOperational EvaluationVisitorImpl.java:1611)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.runMainEntry(QvtOperationalEvaluationVisi torImpl.java:2123)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl$1.invoke(QvtOperationalEvaluationVisitorI mpl.java:924)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.doVisitTransformation(QvtOperationalEvalu ationVisitorImpl.java:898)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitModule(QvtOperationalEvaluationVisit orImpl.java:750)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitModule(QvtGenericEvaluationVisitor.java:371)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ModuleImpl .accept(ModuleImpl.java:622)
at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre tedTransformation.evaluate(QvtInterpretedTransformation.java :170)
at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre tedTransformation.run(QvtInterpretedTransformation.java:118)
at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega teBase.java:182)
at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega teBase.java:137)
at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegate$1.run(QvtLaunchConfigurationDelegate.java :65)
at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$Sa meThreadRunner.run(SafeRunner.java:33)
at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$1. run(SafeRunner.java:26)
at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces s.run(ShallowProcess.java:41)
at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces s.run(ShallowProcess.java:32)
at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegate$3.run(QvtLaunchConfigurationDelegate.java :98)
at java.lang.Thread.run(Unknown Source)


Re: [QVTO] Error by Transformation [message #496746 is a reply to message #496733] Wed, 11 November 2009 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Youssef,

Not sure what you need to import here. As for QVT access to metamodels
your are done,
as you have compiled. Just reference classes by simple or qualified name
(using modeltype identifier).

See where the NPE happens in the stack trace. It's in the xsd model.
Sometimes custom modified Java generated models are not coded sufficiently
defensive
and require certain invariants to hold in order to work correctly.

I recommend to check the line:
org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.handleNewB aseTypeDefinition(XSDComplexTypeDefinitionImpl.java:2116)
to see how the model needs to be initialized.

QVTO can access only what the metamodel exposes and you have to know how
to populate the
[out] model correctly.

Regards,
/Radek


On Wed, 11 Nov 2009 09:52:12 +0100, Youssef <aitlaydi.youssef@gmail.com>
wrote:

> Hi Radek,
>
> thanks,
> the Error LOg is below.
> I think, I must Import the class xsdschema from the package
> org.eclipse.xsd in order to use the method
> setSchemaForSchemaQNamePrefix( schemaForSchemaPrefix ) and
> getQNamePrefixToNamespaceMap() . because the schema is empty.
> the first mapping will be look like this:
>
> mapping UML::Package::toschema() : xsd::XSDSchema{
> init{
> var schemaTargetNamespace := 'http://www.example.com/' + self.name;
> var schemaTargetPrefix := self.name.normalizeSpace();
> var schemaForSchemaNamespace := 'http://www.w3.org/2001/XMLSchema';
> var schemaForSchemaPrefix := 'xsd';
> result.targetNamespace := schemaTargetNamespace;
> result :=
> result.setSchemaForSchemaQNamePrefix( schemaForSchemaPrefix );
> [Map qNamePrefixToNamespaceMap =
> result.getQNamePrefixToNamespaceMap();
> result :=
> self.qNamePrefixToNamespaceMap.put(schemaForSchemaPrefix ,
> schemaForSchemaNamespace );
> result :=
> self.qNamePrefixToNamespaceMap.put(schemaTargetPrefix ,
> schemaTargetNamespace );
>
>
> result := self.map package2schema();
> }
> import org.eclipse.xsd.xsdschema did not function. how can I import a
> Library or a Package?
> thanks,
>
> the Error log is below
>
> eclipse.buildId=M20090917-0800
> java.version=1.6.0_16
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
> Framework arguments: -product org.eclipse.epp.package.jee.product
> Command-line arguments: -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product
>
>
> Error
> Wed Nov 11 09:05:14 CET 2009
> Operational QVT: Exception
>
> java.lang.NullPointerException
> at org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.handleNewB
> aseTypeDefinition(XSDComplexTypeDefinitionImpl.java:2116)
> at org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.patch(XSDC
> omplexTypeDefinitionImpl.java:1061)
> at org.eclipse.xsd.impl.XSDConcreteComponentImpl.patch(XSDConcr
> eteComponentImpl.java:535)
> at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java: 1602)
> at org.eclipse.xsd.impl.XSDSchemaImpl.traverseToRootForPatching
> (XSDSchemaImpl.java:1529)
> at org.eclipse.xsd.impl.XSDSchemaImpl.adoptContent(XSDSchemaImp
> l.java:1921)
> at org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDCon
> creteComponentImpl.java:1074)
> at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(E
> coreEList.java:255)
> at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq
> ue(NotifyingListImpl.java:300)
> at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.
> java:307)
> at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvalu
> ationEnv.callSetter(QvtOperationalEvaluationEnv.java:531)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVi
> sitorImpl.java:412)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:3 27)
> at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpIm
> pl.accept(AssignExpImpl.java:404)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVi
> sitorImpl.java:950)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:3 79)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpI
> mpl.accept(ObjectExpImpl.java:176)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitVariableInitExp(QvtOperationalEvalua
> tionVisitorImpl.java:1004)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitVariableInitExp(QvtGenericEvaluationVisitor. java:407)
> at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.VariableIni
> tExpImpl.accept(VariableInitExpImpl.java:262)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVi
> sitorImpl.java:950)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:3 79)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpI
> mpl.accept(ObjectExpImpl.java:176)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitOperationBody(QvtOperationalEvaluati
> onVisitorImpl.java:985)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingBody(QvtOperationalEvaluation
> VisitorImpl.java:569)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java :355)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBod
> yImpl.accept(MappingBodyImpl.java:122)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingOperation(QvtOperationalEvalu
> ationVisitorImpl.java:732)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingOperation(QvtGenericEvaluationVisitor .java:363)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOpe
> rationImpl.accept(MappingOperationImpl.java:220)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.executeImperativeOperation(QvtOperational
> EvaluationVisitorImpl.java:1611)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.doVisitOperationCallExp(QvtOperationalEva
> luationVisitorImpl.java:638)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitOperationCallExp(QvtOperationalEvalu
> ationVisitorImpl.java:597)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluat
> ionVisitorImpl.java:587)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.j ava:359)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCal
> lExpImpl.accept(MappingCallExpImpl.java:112)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVi
> sitorImpl.java:354)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:3 27)
> at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpIm
> pl.accept(AssignExpImpl.java:404)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingBody(QvtOperationalEvaluation
> VisitorImpl.java:555)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java :355)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBod
> yImpl.accept(MappingBodyImpl.java:122)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingOperation(QvtOperationalEvalu
> ationVisitorImpl.java:732)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingOperation(QvtGenericEvaluationVisitor .java:363)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOpe
> rationImpl.accept(MappingOperationImpl.java:220)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.executeImperativeOperation(QvtOperational
> EvaluationVisitorImpl.java:1611)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.doVisitOperationCallExp(QvtOperationalEva
> luationVisitorImpl.java:638)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitOperationCallExp(QvtOperationalEvalu
> ationVisitorImpl.java:597)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluat
> ionVisitorImpl.java:587)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.j ava:359)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCal
> lExpImpl.accept(MappingCallExpImpl.java:112)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitExpression(QvtOperationalEvaluationV
> isitorImpl.java:329)
> at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(E
> valuationVisitorDecorator.java:156)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitExpression(QvtGenericEvaluationVisitor.java: 191)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtImpe
> rativeIteratorTemplate.evaluateResultTemplate(QvtImperativeI
> teratorTemplate.java:45)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtIter
> ationTemplate.evaluate(QvtIterationTemplate.java:84)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitImperativeIterateExp(QvtOperationalE
> valuationVisitorImpl.java:1341)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitImperativeIterateExp(QvtGenericEvaluationVis
> itor.java:435)
> at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.ImperativeI
> terateExpImpl.accept(ImperativeIterateExpImpl.java:210)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitOperationBody(QvtOperationalEvaluati
> onVisitorImpl.java:985)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitEntryOperation(QvtOperationalEvaluat
> ionVisitorImpl.java:459)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitEntryOperation(QvtGenericEvaluationVisitor.j ava:443)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.EntryOpera
> tionImpl.accept(EntryOperationImpl.java:67)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.executeImperativeOperation(QvtOperational
> EvaluationVisitorImpl.java:1611)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.runMainEntry(QvtOperationalEvaluationVisi
> torImpl.java:2123)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl$1.invoke(QvtOperationalEvaluationVisitorI
> mpl.java:924)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.doVisitTransformation(QvtOperationalEvalu
> ationVisitorImpl.java:898)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva
> luationVisitorImpl.visitModule(QvtOperationalEvaluationVisit
> orImpl.java:750)
> at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat
> ionVisitor.visitModule(QvtGenericEvaluationVisitor.java:371)
> at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ModuleImpl
> .accept(ModuleImpl.java:622)
> at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre
> tedTransformation.evaluate(QvtInterpretedTransformation.java :170)
> at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre
> tedTransformation.run(QvtInterpretedTransformation.java:118)
> at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon
> figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega
> teBase.java:182)
> at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon
> figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega
> teBase.java:137)
> at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon
> figurationDelegate$1.run(QvtLaunchConfigurationDelegate.java :65)
> at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$Sa
> meThreadRunner.run(SafeRunner.java:33)
> at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$1.
> run(SafeRunner.java:26)
> at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces
> s.run(ShallowProcess.java:41)
> at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces
> s.run(ShallowProcess.java:32)
> at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon
> figurationDelegate$3.run(QvtLaunchConfigurationDelegate.java :98)
> at java.lang.Thread.run(Unknown Source)
>
>
>
Re: [QVTO] Error by Transformation [message #496797 is a reply to message #496746] Wed, 11 November 2009 11:57 Go to previous messageGo to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
Hi Radek,

thank you for your quickly reply
I have reformed my code und now it look like this:

modeltype UML uses 'http://www.eclipse.org/uml2/3.0.0/UML';
modeltype XSD uses 'http://www.eclipse.org/xsd/2002/XSD';

transformation uml2xsd(in uml:UML, out xsd:XSD);

main() {
uml.objectsOfType(UML::Package) -> map package2schema();
}

mapping UML::Package::package2schema() : XSD::XSDSchema
{
targetNamespace := 'http://www.example.com/' + self.name;
schemaLocation := 'http://platform:/resource/UML to XSD/' + self.name + '.xsd';
result := self.map setSchemaContent(result);

}
mapping UML::Package::setSchemaContent(inout schema : XSDSchema) : XSDSchema
{
typeDefinitions += self.packagedElement[UML::Class] -> map class2complexType();
elementDeclarations += self.packagedElement[UML::Class] -> map class2globalElement();
result := schema;
}

mapping UML::Class::class2complexType() : XSD::XSDComplexTypeDefinition
{
name := self.name + 'Type';
_abstract := self.isAbstract;
derivationMethod := self.getDerivationMethod();
attributeContents := self.ownedAttribute -> map property2attribute();
}

I don't become an error, but I become a file that just transformed the targetNamespace.
the file look like this: my package ist named as "Library".

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema targetNamespace="http://www.example.com/Library"/>

just two lines. Sad
how can I say that package2schema() a class must be transformed in a complexType.
A complexType attribute in the XSDComplexTypeDefinition is not read. I can't use it for transform a UML Class to XSDComplexType.
have you any Idea?
Thank you

[Updated on: Wed, 11 November 2009 12:09]

Report message to a moderator

Re: [QVTO] Error by Transformation [message #497157 is a reply to message #496797] Thu, 12 November 2009 17:24 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Youssef,

There was exactly the same thread some time ago
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg02802.html

Nested topic contains solution (sample QVTo script with Java blackbox
library)
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg02807.html

Another nested topic contains attached sources for the Java blackbox library
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg02823.html

Regards,
Sergey


Youssef wrote:
> Hi Radek,
>
> thank you for your quickly reply
> i have reformed my code und now it look like this:
>
> modeltype UML uses 'http://www.eclipse.org/uml2/3.0.0/UML';
> modeltype XSD uses 'http://www.eclipse.org/xsd/2002/XSD';
>
> transformation uml2xsd(in uml:UML, out xsd:XSD);
>
> main() {
> uml.objectsOfType(UML::Package) -> map package2schema();
> }
>
> mapping UML::Package::package2schema() : XSD::XSDSchema {
> targetNamespace := 'http://www.example.com/' + self.name;
> schemaLocation := 'http://platform:/resource/UML to XSD/' +
> self.name + '.xsd';
> result := self.map setSchemaContent(result);
>
> }
> mapping UML::Package::setSchemaContent(inout schema : XSDSchema) :
> XSDSchema { typeDefinitions +=
> self.packagedElement[UML::Class] -> map class2complexType();
> elementDeclarations += self.packagedElement[UML::Class] -> map
> class2globalElement();
> result := schema;
> }
>
> mapping UML::Class::class2complexType() : XSD::XSDComplexTypeDefinition
> {
> name := self.name + 'Type';
> _abstract := self.isAbstract;
> derivationMethod := self.getDerivationMethod();
> attributeContents := self.ownedAttribute -> map property2attribute();
> }
>
> i don't become error, but I become a file that just transformed the
> targetNamespace. the file look like this:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <schema targetNamespace="http://www.example.com/Library"/>
>
> just two lines. :( how can I say that package2schema() a class must be
> transformed in a complexType.
> A complexType attribute in the XSDComplexTypeDefinition is not read. I
> can't use it for transform a UML Class to XSDComplexType.
> have you an Idea?
> Thank you
>
Re: [QVTO] Error by Transformation [message #498285 is a reply to message #497157] Mon, 16 November 2009 11:09 Go to previous messageGo to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
Hallo Sergey,

Thank you for your reply,
that's what I was looking for.
I still have a little problem.
where the jar file will be exported? in the Eclipse plug-ins file, or in my QVT Transformation Project.

Thank you very much for your help.
Youssef
Re: [QVTO] Error by Transformation [message #498288 is a reply to message #497157] Mon, 16 November 2009 11:42 Go to previous messageGo to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
Hallo sergey

I created a lib file in my transformation project and I added in this lib file the Jar-file.
But the import of the library doesn't fonction. I become "Cannot find imported compilation unit 'org.eclipse.m2m.qvt.oml.ocl.emf.libraries.XSDUtil'"

please help me.
Thanks.

[Updated on: Mon, 16 November 2009 12:19]

Report message to a moderator

Re: [QVTO] Error by Transformation [message #498289 is a reply to message #498288] Mon, 16 November 2009 11:43 Go to previous messageGo to next message
Youssef  is currently offline Youssef Friend
Messages: 16
Registered: July 2009
Junior Member
Hallo Sergey,

I have resolved my problem.
Thank you

[Updated on: Tue, 17 November 2009 08:50]

Report message to a moderator

Re: [QVTO] Error by Transformation [message #506846 is a reply to message #498289] Sun, 10 January 2010 20:16 Go to previous messageGo to next message
Rosmon Sidhik is currently offline Rosmon SidhikFriend
Messages: 2
Registered: January 2010
Junior Member
Hi Youssef,

I've also been trying to create uml2xsd transformation.
I saw your post and was trying to use the code used by you.
Could you please share the source? My email id is rosmon.sidhik@gmail.com

thanks
Re: [QVTO] Error by Transformation [message #507306 is a reply to message #506846] Tue, 12 January 2010 21:31 Go to previous message
Rosmon Sidhik is currently offline Rosmon SidhikFriend
Messages: 2
Registered: January 2010
Junior Member
Youssef
I'm sorry i had my email wrong rosmon.sidhik@gmail.com

Could you plz send me the source code?
Previous Topic:[QVT] Transformation is using UML 3.0.0 versus 2.1.0
Next Topic:[ATL] correspond m target elements to 1 source element
Goto Forum:
  


Current Time: Tue Apr 16 14:24:49 GMT 2024

Powered by FUDForum. Page generated in 1.11243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top