Concept Checking Rule with abstract concept

Hey,
I have a concept named clause. There can be 0..1 TriggerStatements. The TriggerStatement contains exactly 1 Trigger. The Trigger concept is abstract. My only Trigger is a ClauseTrigger which references exactly 1 clause. When I add a new clause with a TriggerStatement and the trigger is the new clause itself there should be a error. I already tried but it seems that it is not working.

My clause concept

my triggerstatement concept. Trigger is an abstract concept here

and my clauseTrigger which extends the abstract concept trigger

I want something like this, but this does not act like i want it to do right now and i dont know what i am missing

0
2 comments

I think you are assuming that `clause.parent` will be some node that refers to `clause` but it's not, its value is the immediate container of `clause`.

You probably want something like `if (clause.triggerState.triggerRef as ClauseTrigger.clauseRef == clause)`. Or maybe associate the check with ClauseTrigger instead and use `if (clauseTrigger.clauseRef == clauseTrigger.parent.parent)`?

0

This solved it. thanks! :)

0

Please sign in to leave a comment.