Download User Manual - Actifsource
Transcript
User Manual 156 9.5.2 Model backward access Using the selector syntax accessing the model backwards is quite easy (see chapter 9.3.2 SelectorFunction) by the minus sign. Accessing the model backwards is also possible in the Java code. For the model backward access use the static function selectToMeProperty() on the class which defines the relation. Since we want to access the relation Parent.child backwards we have to choose the static method Parent.selectToMeChild() providing the actual child as parameter. As a result we get the parent of the given child. 9.5.3 Function access Use the extension mechanism to access any of your functions from within Java Code. Note that the extension mechanism also supports polymorphic calls (see chapter Fehler! Verweisquelle konnte nicht gefunden werden. Fehler! Verweisquelle konnte nicht gefunden werden.). Let’s assume that we have a function filterChild as shown in chapter 9.5.1 Model forward access. Let’s write a Java function filterChildReverse which returns a reverse list of the filtered children based on filterChild. For the function access use the extension() function on the given resource with FunctionSpace.ITypeRefFunctions.class as parameter. FunctionSpace is the function space where your function is defined. TypeRef is FunctionContext.typeRef. The static property .class is given from Java and represents a class as an object. 9.5.4 Built-in function access 9.5.5 Use the extension mechanism to access built-in functions on resources (see chapter 9.4.1 Built-in functions on Any Actifsource provides the following built-in functions on Any. Function guid Return type Literal Description Gets the unique identifier of any Resource or Literal. (For Resources it is a GUID, for Literals it is the Literal itself.) 9.5.6 Built-in functions on Any List Actifsource provides the following built-in functions on List of Any. count isEmpty isSet IntegerLiteral BooleanLiteral BooleanLiteral Counts the number of elements in the list. Returns true if and only if the list is empty. Returns true if and only if the list contains no duplicates. © 2014 actifsource GmbH, Switzerland - all rights reserved.