|
Re: Load an existing model instance in Java Service Class [message #1738344 is a reply to message #1738288] |
Tue, 19 July 2016 08:10 |
|
Hello,
What does not work? Do you have an exception that could give an idea of
what happened?
The proper method to load an existing model is as presented in your link
org.eclipse.sirius.business.api.session.Session.addSemanticResource(URI,
IProgressMonitor).
Regards,
Steve
Le 18/07/2016 à 22:56, Bo Liu a écrit :
> I tried to load an existing model instance in a java service class for
> conditional style.
>
> I have tried the method in the following link:
> https://www.eclipse.org/forums/index.php/t/1078013/
>
> But it doesn't work.
>
> I have also tried this method in a normal Java Class and it worked.
> Could anyone explain why this method doesn't work for java service class?
>
> What is the correct method to load an existing model instance in java
> service?
>
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Load an existing model instance in Java Service Class [message #1738354 is a reply to message #1738347] |
Tue, 19 July 2016 09:00 |
|
Is your "Error Log" view open (Window/Show View/Others...)? If it is not
silently catched, the exception should be available there. Are you sure
you have the proper URI for the model to load?
I am not sure why you want to load a model in the predicate expression
of a conditional style. It seems more performant to have this model
loaded in your session and have the predicate expression only looking
for a specific model in the current session.
Regards,
Steve
Le 19/07/2016 à 10:19, Bo Liu a écrit :
> Hi,
> Thanks for the reply
>
> the method doesn't return and I don't know where I can see the
> exceptions and debug the method.
>
> If I only write return true in the method, the conditional style will be
> used.
>
> If I write the code to load a model, then it doesn't work any more. I
> guess that there is an exception and the method doesn't return.
>
> But I don't know where I can read the exceptions.
>
> I have also tried this method:
> http://www.vogella.com/tutorials/EclipseEMFPersistence/article.html#javacode_load
>
>
> It worked in a normal java class but not in the java service class.
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Load an existing model instance in Java Service Class [message #1738360 is a reply to message #1738357] |
Tue, 19 July 2016 09:34 |
|
Hi,
You can place a breakpoint in your java service and debug it step by
step where you call
org.eclipse.sirius.business.api.session.Session.addSemanticResource(URI,
IProgressMonitor). Can you provide a sample? I have too limited
information to help you.
Regards,
Steve
Le 19/07/2016 à 11:14, Bo Liu a écrit :
> Hi,
>
> There is no exception in the Error Log View.
>
> I want to load the model in the predicate expression because there is
> information in this model to decide if the conditional style should be
> applied.
>
> I have tried to catch the exception and write it to a file. Is there a
> better way to debug the java service and see the exceptions?
>
> Thanks for the reply!
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03691 seconds