Log in

OCLOperators PSEval

From MDrivenWiki
Revision as of 06:53, 6 June 2023 by Stephanie (talk | contribs)

The OCLOperator PSEval makes it possible to use oclPS in any OCL expression. Using this, you can "reach into" the database from OCL and action-language (EAL).

Expression template:


Note! PSEval doesn't subscribe to sets from DB. To make the operator auto-updating, provide an expression in "dependon" that, when changed, should also rerun the PSEval expression. This can, for example, be a timer.


Uppdrag.PSEval(self.Uppdrag->select(u|u.Aktivt)->orderDescending(u|u.Startdatum),  1000, 0, self.Uppdrag)

For example, this expression from a method has "userName" as a parameter:


Always remember that your SQL-server might also need indexes and other performance settings to execute your expression efficiently.

See also: Sqlpassthrough, PSEvalValue, PSEvalTuples