Is it possible to save model in BPEL?
Code transformation:
-- @nsURI UML=http:\\www.eclipse.org\uml2\2.1.0\UML
-- @path BPEL=platform:/plugin/org.eclipse.bpel.model/model/bpel.ecore
module UmlToBpel;
create OUT : BPEL from IN : UML;
rule Process {
from
A : UML!Activity
to
process : BPEL!Process (
name <- A.name,
activity <- seq
),
seq: BPEL!Sequence1 (
activities <- A.ownedNode->iterate(e; res : OrderedSet(BPEL!Activity) = OrderedSet {} |
if (e.oclIsTypeOf(UML!OpaqueAction)) then
res->including(thisModule.invoke(e))->including(thisModule.assign(e))
else
res
endif
)
)
}
lazy rule assign {
from
s : UML!OpaqueAction
to
a: BPEL!Assign (
name <- 'test3'
)
}
lazy rule invoke {
from
A : UML!OpaqueAction
to
invoke : BPEL!Invoke (
name <- A.name
)
}
Launcher config:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.atl.adt.launching.atlTransformation">
<stringAttribute key="ATL File Name" value="/UmlToBpel/Transformations/UmlToBpel.atl"/>
<stringAttribute key="ATL VM" value="EMF-specific VM Profiler"/>
<stringAttribute key="ATL_COMPILER" value="atl2006"/>
<booleanAttribute key="IS_REFINING" value="false"/>
<mapAttribute key="Input">
<mapEntry key="IN" value="UML"/>
</mapAttribute>
<mapAttribute key="Libs"/>
<mapAttribute key="Model Handler">
<mapEntry key="BPEL" value="EMF"/>
<mapEntry key="UML" value="EMF"/>
</mapAttribute>
<mapAttribute key="ModelType">
<mapEntry key="BPEL" value="METAMODELOUTPUT"/>
<mapEntry key="IN" value="MODELINPUT"/>
<mapEntry key="OUT" value="MODELOUTPUT"/>
<mapEntry key="UML" value="METAMODELINPUT"/>
</mapAttribute>
<mapAttribute key="Options">
<mapEntry key="OPTION_CLEAR" value="true"/>
<mapEntry key="OPTION_CONTENT_TYPE" value="true"/>
<mapEntry key="OPTION_DERIVED" value="true"/>
<mapEntry key="allowInterModelReferences" value="false"/>
<mapEntry key="printExecutionTime" value="true"/>
<mapEntry key="step" value="true"/>
<mapEntry key="supportUML2Stereotypes" value="false"/>
</mapAttribute>
<listAttribute key="OrderedInput">
<listEntry value="IN"/>
</listAttribute>
<listAttribute key="OrderedOutput">
<listEntry value="OUT"/>
</listAttribute>
<mapAttribute key="Output">
<mapEntry key="OUT" value="BPEL"/>
</mapAttribute>
<mapAttribute key="Path">
<mapEntry key="BPEL" value="platform:/plugin/org.eclipse.bpel.model/model/bpel.ecore"/>
<mapEntry key="IN" value="/UmlToBpel/Models/start.uml"/>
<mapEntry key="OUT" value="/UmlToBpel/Models/end.bpel"/>
<mapEntry key="UML" value="uri:http:\\www.eclipse.org\uml2\2.1.0\UML"/>
</mapAttribute>
<stringAttribute key="Port" value="6060"/>
<listAttribute key="Superimpose"/>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="UTF-8"/>
</launchConfiguration>
When I run the transformation, I get an exception:
java.lang.NullPointerException: eObject cannot be null in getNamespaceMap()
at org.eclipse.bpel.model.util.BPELUtils.getNamespaceMap(BPELUtils.java:255)
at org.eclipse.bpel.model.resource.BPELResourceImpl.doSave(BPELResourceImpl.java:101)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.eclipse.m2m.atl.core.emf.EMFExtractor.extract(EMFExtractor.java:65)
at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:141)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:237)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[Updated on: Thu, 18 December 2014 22:29]
Report message to a moderator