| Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » OCL Tuple Problem
 Goto Forum:| 
| OCL Tuple Problem [message #45902] | Tue, 22 August 2006 03:17  |  | 
| Eclipse User  |  |  |  |  | OK this is a little bit complex: 
 In the oclconsole I have to evaluate Methods:
 One can evaluate only one expression, and the other can evaluate defines
 and expressions.
 
 I evaluate the following to statements:
 define:
 theCompoundQuery(InfC:Set(Information), LToolC:Set(LogicalTool)) :
 Set(Tuple(
 i : Information,
 lt: LogicalTool,
 r : Boolean )) =
 InfC->collect( info:Information | LToolC->collect(
 ltool:LogicalTool |
 Tuple {
 i : Information = info,
 lt: LogicalTool = ltool,
 r : Boolean     = theCheck(info, ltool)
 }))->asSet()
 expression:
 theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()- >at(1).i
 
 
 My problem:
 theCompoundQuery returns Tuples like
 Tuple{i = Information XDF, lt = Paper Based System PN, r = false}
 Tuple{i = Information XLI, lt = Paper Based System PN, r = true}
 Tuple{i = Information XDF, lt = IT Base System PACS, r = false}
 
 so the expression takes the first Tuple and returns the information.
 
 My problem, if I use my method which adds the definition to the
 IOCLHelper, everything works fine.
 
 But if I use only the method for the expression, i get the following error:
 The feature 'i' is not a valid feature
 
 But if I evaluate:
 theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()
 I get the Tuples?
 
 Chris
 |  |  |  |  | 
| Re: OCL Tuple Problem [message #47930 is a reply to message #45902] | Wed, 30 August 2006 09:22  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: cdamus.ca.ibm.com 
 Hi, Chris,
 
 I looks like the TupleType defined when your operation definition was parsed
 is a distinct from (though similar to) the TupleType defined when your
 query expression was parsed.
 
 If these were parsed in the same Environment, the the same TypeResolver
 would have been used to define the TupleType, so you would end up with only
 one TupleType and this should work.  Otherwise, two different Environments
 will have two different TupleTypes.
 
 If you are using a single environment, then this would be a bug, in which
 case could you please raise a Bugzilla?
 
 Thanks,
 
 Christian
 
 
 Chris Lenz wrote:
 
 > OK this is a little bit complex:
 >
 > In the oclconsole I have to evaluate Methods:
 > One can evaluate only one expression, and the other can evaluate defines
 > and expressions.
 >
 > I evaluate the following to statements:
 > define:
 > theCompoundQuery(InfC:Set(Information), LToolC:Set(LogicalTool)) :
 >     Set(Tuple(
 >       i : Information,
 >       lt: LogicalTool,
 >       r : Boolean )) =
 >         InfC->collect( info:Information | LToolC->collect(
 > ltool:LogicalTool |
 >           Tuple {
 >             i : Information = info,
 >             lt: LogicalTool = ltool,
 >             r : Boolean     = theCheck(info, ltool)
 >           }))->asSet()
 > expression:
 >
 theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()- >at(1).i
 >
 >
 > My problem:
 > theCompoundQuery returns Tuples like
 > Tuple{i = Information XDF, lt = Paper Based System PN, r = false}
 > Tuple{i = Information XLI, lt = Paper Based System PN, r = true}
 > Tuple{i = Information XDF, lt = IT Base System PACS, r = false}
 >
 > so the expression takes the first Tuple and returns the information.
 >
 > My problem, if I use my method which adds the definition to the
 > IOCLHelper, everything works fine.
 >
 > But if I use only the method for the expression, i get the following
 > error: The feature 'i' is not a valid feature
 >
 > But if I evaluate:
 > theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()
 > I get the Tuples?
 >
 > Chris
 |  |  |  |  | 
| Re: OCL Tuple Problem [message #586910 is a reply to message #45902] | Wed, 30 August 2006 09:22  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: cdamus.ca.ibm.com 
 Hi, Chris,
 
 I looks like the TupleType defined when your operation definition was parsed
 is a distinct from (though similar to) the TupleType defined when your
 query expression was parsed.
 
 If these were parsed in the same Environment, the the same TypeResolver
 would have been used to define the TupleType, so you would end up with only
 one TupleType and this should work.  Otherwise, two different Environments
 will have two different TupleTypes.
 
 If you are using a single environment, then this would be a bug, in which
 case could you please raise a Bugzilla?
 
 Thanks,
 
 Christian
 
 
 Chris Lenz wrote:
 
 > OK this is a little bit complex:
 >
 > In the oclconsole I have to evaluate Methods:
 > One can evaluate only one expression, and the other can evaluate defines
 > and expressions.
 >
 > I evaluate the following to statements:
 > define:
 > theCompoundQuery(InfC:Set(Information), LToolC:Set(LogicalTool)) :
 >     Set(Tuple(
 >       i : Information,
 >       lt: LogicalTool,
 >       r : Boolean )) =
 >         InfC->collect( info:Information | LToolC->collect(
 > ltool:LogicalTool |
 >           Tuple {
 >             i : Information = info,
 >             lt: LogicalTool = ltool,
 >             r : Boolean     = theCheck(info, ltool)
 >           }))->asSet()
 > expression:
 >
 theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()- >at(1).i
 >
 >
 > My problem:
 > theCompoundQuery returns Tuples like
 > Tuple{i = Information XDF, lt = Paper Based System PN, r = false}
 > Tuple{i = Information XLI, lt = Paper Based System PN, r = true}
 > Tuple{i = Information XDF, lt = IT Base System PACS, r = false}
 >
 > so the expression takes the first Tuple and returns the information.
 >
 > My problem, if I use my method which adds the definition to the
 > IOCLHelper, everything works fine.
 >
 > But if I use only the method for the expression, i get the following
 > error: The feature 'i' is not a valid feature
 >
 > But if I evaluate:
 > theCompoundQuery(self.informations,self.logicalTools)->asOrderedSet()
 > I get the Tuples?
 >
 > Chris
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 04:30:11 EDT 2025 
 Powered by FUDForum . Page generated in 0.05539 seconds |