Attribute problem [message #1535317] |
Mon, 29 December 2014 16:45 |
MSh h2 Messages: 5 Registered: October 2014 |
Junior Member |
|
|
Hi all,
I am having an error to execute the bellow code, it gives this error.
The transformation encountered an error: Entity excepted as the Container parameter of the ElementCreateRule rule instead of String. (see the Error Log view for details)
The error happens when I create Vote1 as an attribute inside element Voter1:
new(Agent.vote(Vote1) in fqn(Voter1));
It executes only to creates the Voter1, but not the rest (Vote1, and the relations).
When I change fqn() to:
new(Agent.vote(Vote1) in startGraph.model.Voter1);
the problem is :
- Model element constant 'startGraph.model.Voter1' is non-existing in the model space.
gtrule createNode()=
{
precondition pattern lhs(Voter2,Vote2)=
{
Agent(Voter2);
Agent.vote(Vote2);
Agent.attr(V2Attr,Voter2,Vote2);
check(toBoolean(value(Vote2))==false);
}
action {
let Voter1=undef,Vote1=undef,V1Attr=undef in
seq
{
new(Agent(Voter1) in startGraph.model);
new(instanceOf(Voter1,metamodel.Agent));
rename(Voter1,"Voter"+name(Voter1));
// node Vote1 in Voter1
new(Agent.vote(Vote1) in fqn(Voter1));
new(Agent.attr(V1Attr,Voter1,Vote1));
setValue(Vote1,"false");
new(instanceOf(V1Attr,metamodel.Agent.attr));
new(instanceOf(Vote1,metamodel.Agent.vote));
println("nodes created");
}
}
}
-
Attachment: Vote1.jpg
(Size: 65.56KB, Downloaded 457 times)
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01663 seconds