|
|
|
Re: Is it possible to increment and store a variable in helper context declerative part? [message #1853355 is a reply to message #1853324] |
Tue, 28 June 2022 21:38 |
Burak Karaduman Messages: 84 Registered: July 2018 |
Member |
|
|
Hi Dennis,
When I try to run the refSetValue, it says "org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.UnsupportedOperationException: static EMFTVM!ExecEnv::refSetValue(String, Integer)
at static EMFTVM!ExecEnv::incDiff2() : Integer#12(platform:/resource//PIMtoPSM/DSML4Riot.atl#[59:29-59:80])
Local variables: []"
Is it related to only supporting the EObjects?
EDIT: static EMFTVM!ExecEnv:: ... problem also happens when I would like to debug something in do part as well such as { thisModule...[anything] < thisModule...[anything] } is there a way to bypass it? I would like to debug and test some operations before assigning them to the properties.
Best regards.
[Updated on: Tue, 28 June 2022 22:54] Report message to a moderator
|
|
|
|
|
|
|
Re: Is it possible to increment and store a variable in helper context declerative part? [message #1856340 is a reply to message #1855880] |
Sun, 04 December 2022 20:16 |
|
Burak Karaduman wrote on Tue, 08 November 2022 19:37Assume that A contains B. For each B element I increase this counter, but for each different A I should reset the counter so that other set of B's can start from 0. I think i need to form a kind of specific endpoint rule.
Can you just use the index at which each B is contained within A, like this:
helper context MM!B def : counter : Integer =
if self.refImmediateComposite().oclIsUndefined() then
-1
else
self.refImmediateComposite().ownedB->indexOf(self)
endif;
rule B {
from
source : MM!B
to
target : MM!B (
property <- source.counter
)
}
Cheers,
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.02369 seconds