[Xtend] access to Issues from JAVA extension [message #537529] |
Wed, 02 June 2010 14:53  |
Eclipse User |
|
|
|
Hi there,
can I get access to the Issues object from a Java extension?
I want to report a warning or error from my Java extension without
completely interrupting the workflow. Any Exception I could throw instead?
I got access to the ExecutionContext but am not sure where the Issues are.
Cheers,
Hauke
|
|
|
|
|
Re: [Xtend] access to Issues from JAVA extension [message #537918 is a reply to message #537529] |
Fri, 04 June 2010 03:45  |
Eclipse User |
|
|
|
It is not intended to use the Issues object from Xtend, so there is no direct way to do this. What you could do is to write a small WorkflowComponent, or subclass ExtIssueReporter, which gets the Issues object passed. This object must be stored for later access. ExtIssueReporter uses a ThreadLocal, but the getIssues() method is private. You would need a public static method that returns the value of the ThreadLocal. This method could be used from a JAVA extension. Since you are returning the Issues object you would need to use the JavaMetaModel to use the object, this needs to be configured in the project properties and the workflow.
HTH,
~Karsten
|
|
|
Re: [Xtend] access to Issues from JAVA extension [message #537928 is a reply to message #537670] |
Fri, 04 June 2010 03:37  |
Eclipse User |
|
|
|
Write a class which implements IWorkflowComponent.
configure it before the Xpand components
component = MyIssuesComponent as issuesComp {}
make issuesComp available as global var to the Xpand component.
Within MyIssuesComponent you simply hold the passed issues object.
Within Xtend you can now access the MyIssueComponent and its contained
Issues object through the means of global var.
Sven
Hauke Fuhrmann schrieb:
> Sven,
> where do I get them from in Xtend? So far I only used the Issues stdlib
> in Xtend to use the reportWarning(String) and reportError(String)
> functions. How do I get the Issues object itself in Xtend?
>
> Hauke
>
> Sven Efftinge schrieb:
>> They are not directly accessable.
>> You'll have to pass them in, either by parameter or as a global var.
>>
>> Sven
>>
>>
>> Hauke Fuhrmann schrieb:
>>> Hi there,
>>>
>>> can I get access to the Issues object from a Java extension?
>>> I want to report a warning or error from my Java extension without
>>> completely interrupting the workflow. Any Exception I could throw
>>> instead?
>>>
>>> I got access to the ExecutionContext but am not sure where the Issues
>>> are.
>>>
>>> Cheers,
>>> Hauke
>>
>>
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
Powered by
FUDForum. Page generated in 0.03578 seconds