Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [MWE2] Workflow execution fails randomly
[MWE2] Workflow execution fails randomly [message #659521] Mon, 14 March 2011 08:30 Go to next message
Eclipse UserFriend
Hi,

I'm using MWE2 to execute some Xpand scripts for code-generation. This generation is triggered within another bundle. The problem is, that the workflow throws sometimes an exception, after a restart of Eclipse it works

I call the execution with:
final Map<String, String> args = new HashMap<String, String>();
        args.put("model", this.modelFile.getFullPath().toString());
        args.put("src-gen", this.projectProvider.getProject().getLocation().append("src")
                .toOSString());
 run = new WorkflowRunner().run(
                    "com/mycompany/myproject/studio/connectorgenerator/workflow/generator.mwe",
                    new ProgressMonitorAdapter(monitor), args, Collections.EMPTY_MAP);


and I get the following error-message:

[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: packageHeader(getGlobalVar("objectPrefix").toString()); Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: EXPRESSION: packageHeader(getGlobalVar("objectPrefix").toString()); Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: org.eclipse.internal.xpand2.ast.FileStatement@1d2f159; Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: inputObjects : StructuredType; Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: EXPAND inputObjects FOREACH requestObjects; Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: main : Connector; Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)
[ERROR]: Couldn't find operation 'packageHeader(String)' for datatypes::Class.(Element: EXPAND com::mycomp::myproject::studio::connectorgenerator::template ::Template::main FOR model; Reported by: Generator: generating 'com::mycomp::myproject::studio::connectorgenerator::templat e::Template::main FOR model' => C:\DEV\Workspaces\runtime-New_configuration\test\src)

Like already mentioned if I restart my target eclipse instance and execute it again, it's working, but that's also not guaranteed. Sometimes I can restart my eclipse-target 5 times and it's always working, so I'm even not able to reproduce this error.. How to resolve this issue?

Thanks in advance
Tom

Re: [MWE2] Workflow execution fails randomly [message #659548 is a reply to message #659521] Mon, 14 March 2011 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Ok, I guess I've found a solution, but it would be nice if somebody could confirm that.

My Generator-Extension file has a method like

String joinFields(StructuredType type, String suffix, connectorgenerator::Connector connector) : JAVA
	 com.mycompany.myproject.studio.connector.GeneratorUtils.joinFields(com.mycompany.myproject.studio.datatypes.StructuredType,  java.lang.String, com.mycompany.connectorgenerator.Connector)
;

The GeneratorUtil class is located in the same bundle like the ext file and uses StringUtil from org.apache.commons.lang. This dependency is created in the MANIFEST.MF of the bundle.

When the dependency was declared via Import-Package the Execution of the workflow did not work always, I've changed now the dependecy-declaration to require-bundle and it seems to work.

My question is: Could that be the reason for the above described problem? - If yes, it seems to me, that MWE has problems with OSGi. Is an execution of workflows in an OSGi-environment out of scope or probably not recommended?

Thanks
Tom
Re: [MWE2] Workflow execution fails randomly [message #659633 is a reply to message #659521] Mon, 14 March 2011 17:01 Go to previous message
Eclipse UserFriend
Could it be that another plugin or version feels responsible to fulfil the import package requirement?

~Karsten
Previous Topic:[Xpand] super() equivalent for DEFINE methods?
Next Topic:[Xpand]define of the return type
Goto Forum:
  


Current Time: Tue Jul 22 18:27:04 EDT 2025

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

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

Back to the top