This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella Studio » Rules and Services in Capella Studio
Rules and Services in Capella Studio [message #3345] Wed, 03 July 2019 07:30 Go to next message
jmorane is currently offline  jmorane
Messages: 63
Registered: May 2019
Member
Hello everyone,

In the viewpoint.spec.vptext file, it is possible to automatically create a Viewpoint Service file.

In this file, one can define Rules ( = which " executes code which conforms to a language type according to https://wiki.polarsys.org/images/2/26/Kitalpha-B02-AF_and_Vi ewpoint_DSLs.pdf ) and Services ( = which "orchestrates the execution of a Rules list. )

What does "Orchestrate" means in that context ? And is that way to create custom rules appropriate with Capella Studio ( Comparing for example to the automatic implementation of Java services when defining conditions in the viewpoint.diagram file ) ?

Regards,
Re: Rules and Services in Capella Studio [message #3355 is a reply to message #3345] Thu, 04 July 2019 07:34 Go to previous messageGo to next message
arnaud.dieumegard.obeo.fr is currently offline  arnaud.dieumegard.obeo.fr
Messages: 12
Registered: July 2019
Junior Member
Hi

"Orchestrate" means that a call to the service will call the rules in the order defined in the service.
I'm not sure to understand what you mean by appropriate. The two services you are referring to are different.
- services.vptext services are the way to create treatments (the "run" method) on elements satisfying the condition (the "canRun" method) implemented in the generated code.
- diagram.vptext conditions are implemented as a Java method returning a boolean value.

Regards
Re: Rules and Services in Capella Studio [message #3358 is a reply to message #3355] Thu, 04 July 2019 09:37 Go to previous messageGo to next message
jmorane is currently offline  jmorane
Messages: 63
Registered: May 2019
Member
Hello Arnaud,

First of all, thank you for your answer.

The fact is that I don't understand where and how those services will interact with the rest of the code ( I think that the fact that I never seen the code of others VP than the BasicVP does'nt help... ).
For exemple if a have a simple calculation to make in order to set the value of an attribute of a customized class, can I do that in a rule ? and how will I call the the service orchestrating this rule ?

Regards,
Re: Rules and Services in Capella Studio [message #3360 is a reply to message #3358] Thu, 04 July 2019 10:41 Go to previous messageGo to next message
arnaud.dieumegard.obeo.fr is currently offline  arnaud.dieumegard.obeo.fr
Messages: 12
Registered: July 2019
Junior Member
When you create a service in the services.vptext file, this service is contributed to the Viewpoint view: when your viewpoint is referenced and active on your model, you have a new view named after your viewpoint that can be found in the views list (window > show view) or that can be opened by double click on the viewpoint name in the Viewpoint manager view.
In the viewpoint-specific view, the services tab displays your services.
Services can be triggered from here (or from a graphical model element, right click, viewpoint services.
It seems indeed to be the right way to achieve the need you describe in your example.

Regards
Re: Rules and Services in Capella Studio [message #3361 is a reply to message #3360] Thu, 04 July 2019 10:54 Go to previous message
jmorane is currently offline  jmorane
Messages: 63
Registered: May 2019
Member
Thank you Arnaud, this is a lot clearer now !

regards,
Previous Topic: Access to the diagram's objects in Capella Studio
Next Topic: Configure build path with Capella Studio
Goto Forum:
  


Current Time: Sat Mar 28 04:03:28 EST 2020

Total time taken to generate the page: 0.00897 seconds