JavaScript Extension Development API for Oracle Visual Builder Cloud Service - Classic Applications

Class: module:operation/js/api/Conditions

An API object providing methods used for building a certain Condition.

Version:
  • 15.4.5
Source:
See:

Members

Methods

(static) AND(arguments) → {operation/js/api/Condition}

stable API

Creates new composite Condition which consist of multiple Conditions joining them using an AND operator.

Parameters:
Name Type Description
arguments Array.<operation/js/api/Condition>

either array of Condition's or simply Condition's separated and passed one by one

Version:
  • 15.4.5
Source:
Returns:
Type
operation/js/api/Condition
Examples

Creates an instance of Condition with two sub-restrictions combining them using an AND operator.

// Finds all employees with firstname = 'Martin' and lastname = 'Janicek'.

var composite = Conditions.AND(
    Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
    Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
);

Creates an instance of Condition with two sub-restrictions combining them using an AND operator - this time using an array of Conditions.

// Finds all employees with firstname = 'Martin' and lastname = 'Janicek'.

var conditions = [];
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'));
conditions.push(Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek'));
var composite = Conditions.AND(conditions);

Creates a more complex Condition combining multiple AND and OR operators.

// Finds all employees whose name is either 'Martin Janicek' or 'Ondrej Brejla'

var condition = Conditions.OR(
    Conditions.AND(
        Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
        Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
    ),
    Conditions.AND(
        Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'),
        Conditions.SIMPLE(lastName, Operator.EQUALS, 'Brejla')
    )
);

(static) OR(arguments) → {operation/js/api/Condition}

stable API

Creates new composite Condition which consists of multiple Conditions joining them using an OR operator.

Parameters:
Name Type Description
arguments Array.<operation/js/api/Condition>

either array of Condition's or simply Condition's separated and passed one by one

Version:
  • 15.4.5
Source:
Returns:
Type
operation/js/api/Condition
Examples

Creates an instance of composite Condition with two sub-restrictions combining them using an OR operator.

// Finds all employees with firstname = 'Martin' or firstname = 'Ondrej'.

var composite = Conditions.OR(
    Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
    Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej')
);

Creates an instance of composite Condition with two sub-restrictions combining them using an OR operator - this time using an array of Conditions.

// Finds all employees with firstname = 'Martin' or firstname = 'Ondrej'.

var conditions = [];
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'));
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'));
var composite = Conditions.OR(conditions);

Creates a more complex composite Condition combining AND and OR operators.

// Finds all employees whose name is either 'Martin Janicek' or 'Ondrej Brejla'

var condition = Conditions.OR(
    Conditions.AND(
        Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
        Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
    ),
    Conditions.AND(
        Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'),
        Conditions.SIMPLE(lastName, Operator.EQUALS, 'Brejla')
    )
);

(static) SIMPLE(property, operator, value) → {operation/js/api/Condition}

stable API

Creates a new instance of Condition with a single restriction.

Parameters:
Name Type Description
property entity/js/api/Property

property used by this condition

operator module:operation/js/api/Operator

applied operator

value String
Version:
  • 15.4.5
Source:
Returns:
Type
operation/js/api/Condition
Example

Create an instance of Condition with a single restriction.

var condition = Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin');