Error with copy rule [message #1063814] |
Fri, 14 June 2013 11:11 |
Alexander Fülleborn Messages: 132 Registered: April 2013 |
Senior Member |
|
|
Hello again,
trying to use the copy rule, I get the error message "Variable Reference 'DomainSpecificProblemStatement' cannot be resolved". The variable "DomainSpecificProblemStatement" is bound during a pattern matching that takes places before the copy statement, see the subsequent listing.
Thanks for any appreciated hints and kind regards, Alexander
---
namespace uml.models;
import uml.metamodel.uml;
machine SalaryStatementPCM2PCPTransformation
{
rule main(in Model) =
let DomainSpecificProblemContextModel = undef,
XDomainProblemContextPatternModel = undef,
Y = undef in seq{
new (Model(XDomainProblemContextPatternModel) in uml.models);
rename(XDomainProblemContextPatternModel, "Cross-domain Problem Context Pattern Model");
print("'Cross-domain Problem Context Pattern Model' created\n");
choose DomainSpecificProblemStatement below uml.models
with find
isProblemStatement(DomainSpecificProblemStatement)
do print("Domain-specific problem statement '"
+ name(DomainSpecificProblemStatement)
+ "' in source model found");
copy(DomainSpecificProblemStatement,XDomainProblemContextPatternModel,Y,copy_boundary_edges);
// print( "Domain-specific problem statement '"
// + "name(DomainSpecificProblemStatement)'"
// + " copied to '" + name(XDomainProblemContextPatternModel));
}
pattern isProblemStatement(DomainSpecificProblemStatement) =
{
uml.metamodel.uml.Element(DomainSpecificProblemStatement);
uml.metamodel.uml.Stereotype(StType);
check(name(StType) == "PSL problem statement");
uml.metamodel.uml.Element.appliedStereotype(AppliedST,DomainSpecificProblemStatement,StType);
}
}
[Updated on: Fri, 14 June 2013 11:14] Report message to a moderator
|
|
|
|
|
|
|
Re: Error with copy rule [message #1064197 is a reply to message #1064154] |
Tue, 18 June 2013 08:23 |
Abel Hegedus Messages: 197 Registered: September 2015 |
Senior Member |
|
|
Hi Alex,
looking at the code, I found two things:
- the copy rule was not tested in the testing framework
- there seems to be an off-by-one error, where copy_boundary_edges is actually handled as skip_boundary_edges and the other way around
Can you try your transformation with the other value?
If that gives the expected results, I can change the code and you will be able to update when the build completes (if you use the nightly update site).
[Updated on: Tue, 18 June 2013 08:40] by Moderator Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04290 seconds