Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Problem of Duplication of Elements in Every Container
Problem of Duplication of Elements in Every Container [message #1706742] Sat, 29 August 2015 14:12 Go to next message
Shin-Yi Lin is currently offline Shin-Yi LinFriend
Messages: 34
Registered: June 2015
Member
Hi All,

I want that only elements are contained in their own container,
but they are also in the other containers.

For example, I only want Subprocess SP1-1 and Subprocess SP1-2 in Lane1 and Lane2 is empty as the hierarchy shown in the following picture,
index.php/fa/23053/0/


but Lane1 and Lane2 both contain SP1-1 and SP1-2.
index.php/fa/23052/0/


I tried to add Conditional Style and Precondition Expression in Containers and Nodes, but, still, I didn't solve it.
index.php/fa/23054/0/

Wendy
  • Attachment: Q1.jpg
    (Size: 120.32KB, Downloaded 215 times)
  • Attachment: Q2.jpg
    (Size: 70.87KB, Downloaded 228 times)
  • Attachment: Q3.jpg
    (Size: 59.31KB, Downloaded 218 times)
  • Attachment: Q4.jpg
    (Size: 171.44KB, Downloaded 72 times)

[Updated on: Sat, 29 August 2015 14:15]

Report message to a moderator

Re: Problem of Duplication of Elements in Every Container [message #1706828 is a reply to message #1706742] Mon, 31 August 2015 12:33 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi,


Le 29/08/2015 16:12, Shin-Yi Lin a écrit :
> Hi All,
>
> I want that only elements are contained in their own container,
> but they are also in other containers.
>
> For example, I only want Subprocess SP1-1 and Subprocess SP1-2 in Lane1 and Lane2 is empty as the hierarchy in the following picture,
>
>
>
> but Lane1 and Lane2 are both contain SP1-1 and SP1-2.

Which version of Sirius do you use?

Did you set your own semantic candidates expression on each mapping ? It
will allow you to indicates how to find the element you want to
represent for each mapping:
. LStartEvent: your expression should return only the start event of
the current lane
. LReceiveTask: your expression should return only the receive tasks
of the current lane
. SPStartEvent: your expression should return only the start event of
the current sub process
. SPReceiveTask: your expression should return only the receive tasks
of the current sub process.

The "self" variable corresponds to the current context, in the case of
the SPStartEvent, it will be a SubProcess as the
SPStartEvent.semanticCandidatesExpression will be evaluated on a
SubProcess to compute the SPStartEvent to displa in it.
You can either compute it from the topology of your model:
feature:eContents and let Sirius filter with the domain class or
explicitly use the metamodel, you might have a "start" feature and you
will just call feature:myCallFeature, it will return the content of the
"myCallFeature" for your current sub process. If you need to write a
more complex expression, you will use Acceleo or a java service, see [1]
or [2]

If you have an empty semantic candidates expression, Sirius will simply
create an element for each instance of the domain class in each element
created from the parent mapping.

>
>
>
> I tried to add Conditional Style and Precondition Expression in Containers and Nodes but, still, I can't find any solution.

The conditional style allows to choose how to display the diagram
elements, but not how to compute the element to display. The
ConditionalStyle.preconditionExpression is evaluated to choose a style,
the first style description which returns true will be chosen, if no
conditional style is chosen, Sirius will took the default style.

The structure of the diagram will follow the mapping strucure, on each
diagram element, Sirius take its semantic element (A), and looks for
elements to display inside: for each children/reused mapping, the
semantic candidates expression is evaluated on A, then the result is
filtered with the domain class of the mapping and the evaluation of the
precondition expression on each candidate.

>
>
> Wendy
>

Regards


--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] Sirius 1.0: https://www.eclipse.org/sirius/doc/1.0.x
[2] Sirius 2.0.x: https://www.eclipse.org/sirius/doc/2.0.x/
[3] Sirius 3.0.x: https://www.eclipse.org/sirius/doc/3.0.x/ and
https://www.eclipse.org/sirius/doc/


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Problem of Duplication of Elements in Every Container [message #1706832 is a reply to message #1706828] Mon, 31 August 2015 12:36 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
In my preceding answer, I wanted to reference the "writing queries" part
of the documentation, here are the link for the current release (Sirius
3.0):

https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html


Le 31/08/2015 14:33, Maxime Porhel a écrit :
> Hi,
>
>
> Le 29/08/2015 16:12, Shin-Yi Lin a écrit :
>> Hi All,
>>
>> I want that only elements are contained in their own container,
>> but they are also in other containers.
>>
>> For example, I only want Subprocess SP1-1 and Subprocess SP1-2 in
>> Lane1 and Lane2 is empty as the hierarchy in the following picture,
>>
>>
>>
>> but Lane1 and Lane2 are both contain SP1-1 and SP1-2.
>
> Which version of Sirius do you use?
>
> Did you set your own semantic candidates expression on each mapping ? It
> will allow you to indicates how to find the element you want to
> represent for each mapping:
> . LStartEvent: your expression should return only the start event of
> the current lane
> . LReceiveTask: your expression should return only the receive tasks
> of the current lane
> . SPStartEvent: your expression should return only the start event of
> the current sub process
> . SPReceiveTask: your expression should return only the receive tasks
> of the current sub process.
>
> The "self" variable corresponds to the current context, in the case of
> the SPStartEvent, it will be a SubProcess as the
> SPStartEvent.semanticCandidatesExpression will be evaluated on a
> SubProcess to compute the SPStartEvent to displa in it.
> You can either compute it from the topology of your model:
> feature:eContents and let Sirius filter with the domain class or
> explicitly use the metamodel, you might have a "start" feature and you
> will just call feature:myCallFeature, it will return the content of the
> "myCallFeature" for your current sub process. If you need to write a
> more complex expression, you will use Acceleo or a java service, see [1]
> or [2]
>
> If you have an empty semantic candidates expression, Sirius will simply
> create an element for each instance of the domain class in each element
> created from the parent mapping.
>
>>
>>
>>
>> I tried to add Conditional Style and Precondition Expression in
>> Containers and Nodes but, still, I can't find any solution.
>
> The conditional style allows to choose how to display the diagram
> elements, but not how to compute the element to display. The
> ConditionalStyle.preconditionExpression is evaluated to choose a style,
> the first style description which returns true will be chosen, if no
> conditional style is chosen, Sirius will took the default style.
>
> The structure of the diagram will follow the mapping strucure, on each
> diagram element, Sirius take its semantic element (A), and looks for
> elements to display inside: for each children/reused mapping, the
> semantic candidates expression is evaluated on A, then the result is
> filtered with the domain class of the mapping and the evaluation of the
> precondition expression on each candidate.
>
>>
>>
>> Wendy
>>
>
> Regards
>
>


--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Problem of Duplication of Elements in Every Container [message #1706925 is a reply to message #1706828] Mon, 31 August 2015 22:04 Go to previous messageGo to next message
Shin-Yi Lin is currently offline Shin-Yi LinFriend
Messages: 34
Registered: June 2015
Member
Hi,

Thank you so much for the help.

My Sirius version is 2.0.

As for SPStartEvent.SemanticCandidateExpression, do you mean I should fill it with [self.eContainer()/]? It comes out that SubProcess in Evaluation Result of Acceleo Interpreter and the StartEvent diagram disappear. I also try to type [self.eContainer(SubProcess)/] and [self.eContent()/], it still not works.

By the way, there's no "start" feature in my metamodel. StartEvent is a class in the class diagram.

Best Regards,

Shin-Yi

[Updated on: Mon, 31 August 2015 22:05]

Report message to a moderator

Re: Problem of Duplication of Elements in Every Container [message #1706952 is a reply to message #1706925] Tue, 01 September 2015 07:28 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Le 01/09/2015 00:04, Shin-Yi Lin a écrit :
> Hi,
>
> Thank you do much for the help.
> My Sirius version is 2.0.
>
> As for SPStartEvent.SemanticCandidateExpression, do you mean I should
> fill it with [self.eContainer()/]?

SPStartEvent mapping is a child of Subprocess mapping which has
SubProcess as domain class. So for the computation of
SPStartEvent.SemanticCandidateExpression, self is a SubProcess,
feature:eContents or [self.eContents()/] should allow you to retrieve
the StartEvent: in your screenshot, it seems contained by the
subprocess. You might also use a more specific feature if it exists to
direcly retrieve the start event.


It comes out that SubProcess in
> Evaluation Result of Acceleo Interpreter and the StartEvent diagram
> disappear. I also try to type [self.eContainer(SubProcess)/] and
> [self.eContent()/], it still not works.
>
> By the way, there's no "start" feature in my metamodel. StartEvent is a
> class in the class diagram.

How does the SubProcess cass reference the StartEvent class ?

>
> Best Regards,
>
> Shin-Yi


--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Problem of Duplication of Elements in Every Container [message #1707164 is a reply to message #1706952] Wed, 02 September 2015 17:09 Go to previous message
Shin-Yi Lin is currently offline Shin-Yi LinFriend
Messages: 34
Registered: June 2015
Member
Hi,

Thank you very much. I fix it.

Best Regards,

Shin-Yi
Previous Topic:Problem of Edge in Container
Next Topic:Label for Container necessary?
Goto Forum:
  


Current Time: Wed Jan 27 08:41:31 GMT 2021

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

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

Back to the top