Interface FilterAttributeInterface

The FilterAttributeInterface interface is a FilterItemInterface to elect part instances from their string attributes metadata.

This FilterItemInterface selects part instances based on their string attributes or their parent string attributes (as defined in Documents). Each part instance is considered to have the union between their own attributes and the attributes of its genealogy (parent, grand-parent, etc ...) : the joined attribute set.

The list of attributes and their types is available through the AttributesDictionaryInterface.getDictionary function.

The FilterAttributeInterface defines 2 sets of string values : two search attribute sets:

  • exact search attribute set.
  • full text search attribute set.

This FilterItemInterface selects part instances having a string attribute inside their joined attribute set whose value :

  • setExactValues : is exactly inside the exact search attribute set (an item in the exact search attribute set is exactly the value of the attribute).
  • or setContainsValues : contains at least one of the values (full text search) of the full text search attribute set.

The existing values of a string attribute may be queried with an AttributeValuesEnumeratorInterface.

The special value N/A selects all other part instances than the union of all possible values of such a string attribute. The special value N/A (not applicable) is available and selected as default (hasNaValueAvailable, setNaValueChecked). The N/A value is not available if the FilterAttributeInterface is used inside a FilterCompoundInterface (hasNaValueAvailable will return false).
The FilterAttributeInterface has an internal property telling to use the N/A value if it is available (setNaValueChecked, isNaValueChecked).

In the case of a setContainsValues call, the search attribute set may include a full text search. It is case insensitive and allows the use of wildcards symbols :

  • ? replaces one and only one character,
  • * replaces any number of characters (by default, the engine prefixes and postfixes the search with *)
  • $ prevents the default addition of the prefix or postfix * wildcard (if $ is positioned at the beginning of the text, no * prefix added; if $ is positioned at the end, no * postfix added). This allows to make queries like : gets all the part instances whose type begins by "electrical" ($electrical). Please see 3djuump Infinite literal and search query language for more information about using special characters.

The FilterAttributeInterface interface is created through the DataSessionInterface.createFilterAttribute.

The FilterAttributeInterface has the type FilterType.FT_ATTRIBUTE (FilterItemInterface.getFilterType).

The FilterAttributeInterface has a depth contribution of 2.

/**
* Sample to illustrate :
* Select electrical `part instances` which were plugged on the 01/01/2020.
* Test : create three filters directly in a WorkingSetInterface and put them in intersection.
*/
import {
AttributesDictionaryInterface, AttributeInfoInterface, AttributeType, DataSessionInterface,
FilterRangeItemInterface, FilterAttributeInterface, GroupOperator, FilterRangeInterface,
WorkingSetInterface
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;

// The Filter Solver has been created previously, its Working set has been set
let lFilterSolver : WorkingSetInterface;

// MAKE SURE the attributes "type", "history.date" and "history.state" are relevant
const lAttributeDictionary : AttributesDictionaryInterface = lDataSession.getAttributesDictionary();
let lAttributeInfo : AttributeInfoInterface | undefined = lAttributeDictionary.getAttributeInfo('type');
// make sure the attribute is a string one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_STRING));

lAttributeInfo = lAttributeDictionary.getAttributeInfo('history.date');
// make sure the attribute is a date one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_DATE));

lAttributeInfo = lAttributeDictionary.getAttributeInfo('history.state');
// make sure the attribute is a string one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_STRING));

// create the electrical filter
const lElectricalFilter : FilterAttributeInterface = lDataSession.createFilterAttribute();
// type set to electrical (exactly)
lElectricalFilter.setAttributeName('type');
lElectricalFilter.setExactValues(['electrical']);
// warning : n/a is set to true as default, we do not want to include other `part instances`
lElectricalFilter.setNaValueChecked(false);
// useless, GroupOperator.GO_UNION is the default operator when creating a new filter (and it will be the first one)
// lElectricalFilter.setFilterOperator(GroupOperator.GO_UNION);

const lDateFilter : FilterRangeInterface = lDataSession.createFilterRange();
// work on "date" metadata
lDateFilter.setAttributeName('history.date');
// create a range
{
const lDateRange : FilterRangeItemInterface = lDateFilter.createFilterRangeItem();
// we want to include the lower bound in the query, but exclude the upper bound (it is the next day !!!)
lDateRange.setIncludedLower(true);
lDateRange.setIncludedUpper(false);
const lExpectedDate : number = Date.UTC(2020, 0, 1, 0, 0, 0, 0);
const lExpiredDate : number = lExpectedDate + 24 * 3600 * 1000;

// range between the 1st of january and the end of the first of january
lDateRange.setLowerBound(lExpectedDate);
lDateRange.setUpperBound(lExpiredDate);
}
// intersection is the way to go since intersection of type electrical and instances with the given state at the given time
lDateFilter.setFilterOperator(GroupOperator.GO_INTERSECTION);

// create the state filter
const lStateFilter : FilterAttributeInterface = lDataSession.createFilterAttribute();
// type set to plugged (exactly)
lStateFilter.setAttributeName('history.state');
lStateFilter.setExactValues(['plugged']);
// warning : n/a is set to true as default, we do not want to include other `part instances`
lStateFilter.setNaValueChecked(false);
// intersection is the way to go since intersection of type electrical and instances with the given state at the given time
lStateFilter.setFilterOperator(GroupOperator.GO_INTERSECTION);

// add the filters inside the WorkingSetInterface
// push back (-1) the electrical filter
lFilterSolver.insertFilter(-1, lElectricalFilter);
// push back (-1) the date filter, as it is the second one, its operator is used and therefore
// intersection is used
lFilterSolver.insertFilter(-1, lDateFilter);
// push back (-1) the state filter, as it is the third one, its operator is used and therefore
// intersection is used
lFilterSolver.insertFilter(-1, lStateFilter);

// and tell the DataSessionInterface to update the modified WorkingSetInterfaces
lDataSession.update();

Please refer to Available Filters for a list of other FilterItemInterfaces.
Metadata/Filters

interface FilterAttributeInterface {
    addContainValue(pValue): boolean;
    addEventListener(pType, pListener, pObject): string;
    addEventListener(pType, pListener): string;
    addExactValue(pValue): void;
    areSignalsBlocked(): boolean;
    blockSignals(pBlock): void;
    dispose(): void;
    forceRevalidation(pCacheTimeIntervalInMSec): boolean;
    fromJSON(pFilterData): boolean;
    getAttributeName(): string;
    getContainsValues(pFullTextValuesOut): void;
    getDepthContribution(): number;
    getExactValues(pExactValuesOut): void;
    getFilterId(): string;
    getFilterOperator(): GroupOperator;
    getFilterType(): FilterType;
    getInfiniteObjectType(): InfiniteObjectType;
    getLastError(): InfiniteError;
    getParentFilter(): FilterSetInterface;
    getParentFilterId(): string;
    hasEventListener(pType, pListener): boolean;
    hasEventListenerById(pId): boolean;
    hasNaValueAvailable(): boolean;
    isDisposed(): boolean;
    isEnabled(): boolean;
    isInContainValues(pValue): boolean;
    isInExactValues(pValue): boolean;
    isInverted(): boolean;
    isNaValueAvailable(): boolean;
    isNaValueChecked(): boolean;
    removeAllEventListeners(): boolean;
    removeContainValue(pValue): boolean;
    removeEventListener(pType, pListener, pObject): boolean;
    removeEventListener(pType, pListener): boolean;
    removeEventListenerById(pId): boolean;
    removeExactValue(pValue): boolean;
    setAttributeName(pAttributeName): boolean;
    setContainsValues(pValues): boolean;
    setEnabled(pEnabled): void;
    setExactValues(pValues): void;
    setFilterId(pFilterId): void;
    setFilterOperator(pFilterOperator): void;
    setInverted(pInverted): void;
    setNaValueChecked(pChecked): boolean;
    toJSON(pKey?): Object;
}

Hierarchy (view full)

Methods

  • Adds a value in the full text search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value that contains at least one of the values in the given string array.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    Parameters

    • pValue: string
      in
      The value to add in the full text search attribute set.

    Returns boolean

    true if the FilterAttributeInterface is updated.

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal. It is possible to add an object that will be included in the callback to avoid creating too many closures. Calling twice addEventListener with the same parameters results in the second call to be ignored, only unique pairs callback / object are allowed, in order to avoid calling multiple times the same thing.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.
    • pObject: Object
      in
      The optional object the callback will be called with when the given event fires.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Adds a value in the exact search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value in the exact search attribute set.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    Parameters

    • pValue: string
      in
      The exact value to add in the exact search attribute set.

    Returns void

  • Tells if signals sent by the object are blocked or not.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Returns boolean

    true if signals are blocked.

  • Blocks / Unblocks all signals sent by the object.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Parameters

    • pBlock: boolean
      in
      If set to true, all further signals will be silently discarded.

    Returns void

  • Forces a recomputation of the filter.

    The 3djuump infinite backend is using a cache system to speedup the computations. This call, in case a metadata is updated, forces the backend to recompute the content of the filter and may refresh the result, in case the metadata has been updated till the last call.

    If the data cached is older than the given time interval in seconds, then the cache will be invalidated, and the result of the filter will be computed again. This does not mean the result of the filter will be updated in any case.

    pCacheTimeIntervalInMSec MUST be superior or equal to 10000 (10 seconds).

    Parameters

    • pCacheTimeIntervalInMSec: number
      in
      The time interval in milliseconds the cache will be considered outdated.

    Returns boolean

    true if the call was successful.

  • Sets the content of the FilterItemInterface from a former call to toJSON.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterItemInterface internal data changed.

    {
    "$defs": {
    "all": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "all",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "id"
    ],
    "title": "Filter all definition",
    "type": "object"
    },
    "attribute": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "containsValues": {
    "description": "Elects all the `part instances` having the attribute whose name set with attribute in their `joined attribute set` that have a value that contains at least one of the values in the given string array",
    "items": {
    "type": "string"
    },
    "type": "array"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "exactValues": {
    "description": "Elects all the `part instances` having the attribute whose name set with `attribute` in their `joined attribute set` that have a value exactly included in the given string array.",
    "items": {
    "type": "string"
    },
    "type": "array"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "na": {
    "description": "Include `part instances` with the `N/A` value",
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "attribute",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "enabled",
    "operator",
    "inverted",
    "exactValues",
    "containsValues",
    "na",
    "attribute",
    "id"
    ],
    "title": "Filter attribute definition",
    "type": "object"
    },
    "boolean": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "boolean",
    "description": "Type of the filter",
    "type": "string"
    },
    "value": {
    "default": false,
    "description": "Boolean value of the filter",
    "example": false,
    "type": "boolean"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "value",
    "id"
    ],
    "title": "Filter boolean definition",
    "type": "object"
    },
    "box": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "max": {
    "description": "Define the coordinates [x,y,z] of the max point of the AABB",
    "items": {
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "type": "array"
    },
    "min": {
    "description": "Define the coordinates [x,y,z] of the min point of the AABB",
    "items": {
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "type": "array"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "overlap": {
    "description": "Specify if AABB test is included or overlap",
    "example": true,
    "type": "boolean"
    },
    "precision": {
    "description": "Numeric precision will be subtracted/added to min/max point of AABB",
    "type": "number"
    },
    "type": {
    "const": "box",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "inverted",
    "enabled",
    "min",
    "max",
    "overlap",
    "precision",
    "id"
    ],
    "title": "Filter box definition",
    "type": "object"
    },
    "compound": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "subfilters": {
    "description": "list of metadata sub filters",
    "items": {
    "$ref": "#/$defs/compoundfilters"
    },
    "type": "array"
    },
    "type": {
    "const": "compound",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "subfilters",
    "id"
    ],
    "title": "Filter compound definition",
    "type": "object"
    },
    "compoundfilters": {
    "oneOf": [
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/range"
    }
    ]
    },
    "diagonal": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "rangeitems": {
    "description": "List of range item",
    "items": {
    "$ref": "#/$defs/rangeitem"
    },
    "type": "array"
    },
    "type": {
    "const": "diagonal",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "rangeitems",
    "id"
    ],
    "title": "Filter diagonal definition",
    "type": "object"
    },
    "filter": {
    "oneOf": [
    {
    "$ref": "#/$defs/box"
    },
    {
    "$ref": "#/$defs/all"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/literal"
    },
    {
    "$ref": "#/$defs/compound"
    },
    {
    "$ref": "#/$defs/diagonal"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/partinstanceidlist"
    },
    {
    "$ref": "#/$defs/range"
    },
    {
    "$ref": "#/$defs/filterset"
    }
    ]
    },
    "filterset": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "subfilters": {
    "description": "List of sub filters",
    "items": {
    "oneOf": [
    {
    "$ref": "#/$defs/box"
    },
    {
    "$ref": "#/$defs/all"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/literal"
    },
    {
    "$ref": "#/$defs/compound"
    },
    {
    "$ref": "#/$defs/diagonal"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/partinstanceidlist"
    },
    {
    "$ref": "#/$defs/range"
    },
    {
    "$ref": "#/$defs/filterset"
    }
    ]
    },
    "type": "array"
    },
    "type": {
    "const": "set",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "enabled",
    "operator",
    "inverted",
    "subfilters",
    "id"
    ],
    "title": "Filter set definition",
    "type": "object"
    },
    "hasfield": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "hasfield",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "id"
    ],
    "title": "Filter Has field definition",
    "type": "object"
    },
    "literal": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "query": {
    "description": "Sets the query string in the 3djuump infinite literal and search query language",
    "example": ":PartNumber=='bolt'",
    "type": "string"
    },
    "type": {
    "const": "literal",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "query",
    "id"
    ],
    "title": "Filter literal definition",
    "type": "object"
    },
    "partinstanceidlist": {
    "additionalProperties": false,
    "properties": {
    "buildid": {
    "description": "Id of the build use to create the part list instance",
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "list": {
    "description": "List of part instance ids",
    "items": {
    "type": "number"
    },
    "type": "array"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "partinstanceidlist",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "buildid",
    "list",
    "id"
    ],
    "title": "Filter Part instance list definition",
    "type": "object"
    },
    "range": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "rangeitems": {
    "description": "List of range item",
    "items": {
    "$ref": "#/$defs/rangeitem"
    },
    "type": "array"
    },
    "type": {
    "const": "range",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "rangeitems",
    "id"
    ],
    "title": "Filter range definition",
    "type": "object"
    },
    "rangeitem": {
    "additionalProperties": false,
    "properties": {
    "includedLower": {
    "description": "Sets if the lower bound value should be included or excluded",
    "type": "boolean"
    },
    "includedUpper": {
    "description": "Sets if the upper bound value should be included or excluded",
    "type": "boolean"
    },
    "lower": {
    "description": "Lower bound of the range item",
    "type": "number"
    },
    "upper": {
    "description": "Upper bound of the range item",
    "type": "number"
    }
    },
    "required": [
    "includedLower",
    "includedUpper"
    ],
    "title": "Range item definition",
    "type": "object"
    }
    },
    "$ref": "#/$defs/filter",
    "$schema": "https://json-schema.org/draft-07/schema#"
    }

    This schema may evolve in the future.

    Parameters

    • pFilterData: string | Object
      in
      Internal FilterItemInterface data to set.

    Returns boolean

    true if the data is set.

    See

    toJSON

  • Gets the name of the attribute to filter with.

    Returns string

    The name of the attribute to use.

  • Gets a copy of the full text search attribute set.

    Parameters

    • pFullTextValuesOut: string[]
      out
      The array that will be the copy of the full text search attribute set.

    Returns void

  • Gets the depth contribution of the FilterItemInterface.

    This value is usually one.

    Returns number

    The depth contribution of the FilterItemInterface.

  • Gets a copy of the exact search attribute set.

    Parameters

    • pExactValuesOut: string[]
      out
      The array that will be the copy of the exact search attribute set.

    Returns void

  • Gets the identifier of the FilterItemInterface.

    Returns string

    The identifier of the FilterItemInterface.

  • Tells if the EventDispatcher has such a callback registered for the given event type.

    Parameters

    • pType: string
      in
      The type of the event to test.
    • pListener: tListenerCallback
      in
      The listener function that gets tested.

    Returns boolean

    true if such a listener is installed for the given type of event.

  • Tells if the EventDispatcher has such a callback registered for the given callback id.

    Parameters

    • pId: string
      in
      The id of the callback to test.

    Returns boolean

    true if such a listener is installed for the given callback id.

  • Tells if the N/A value is available (equivalent to isNaValueAvailable)..

    The N/A value is available if this FilterAttributeInterface is not included in a FilterCompoundInterface.

    Returns boolean

    true is the filter has the NA value available.

  • Tells if the FilterItemInterface is enabled.

    If disabled, this FilterItemInterface is completely ignored during all the computations (the behavior is the same as if it had not been created).

    A FilterItemInterface is enabled by default.

    Returns boolean

    true if the FilterItemInterface is enabled.

  • Tests if a value is in the full text search attribute set.

    Parameters

    • pValue: string
      in
      The value to query.

    Returns boolean

    true if pValue is in the full text search attribute set.

  • Tests if a value is in the exact search attribute set.

    Parameters

    • pValue: string
      in
      The value to query.

    Returns boolean

    true if pValue is in the exact search attribute set.

  • Tells if the FilterItemInterface is "inverted".

    When "inverted", a FilterItemInterface elects all the part instances that were not selected if it was not inverted.

    A FilterItemInterface is not "inverted" by default.

    Returns boolean

    true if such a FilterItemInterface is "inverted".

  • Tells if the N/A value is available (equivalent to hasNaValueAvailable)..

    The N/A value is available if this FilterAttributeInterface is not included in a FilterCompoundInterface.

    Returns boolean

    true is the filter has the NA value available.

  • Tells if the N/A value is included in the exact search attribute set.

    The FilterAttributeInterface has an internal property that tells to include part instances with the N/A value if if is available (setNaValueChecked), but isNaValueChecked will return true if and only if hasNaValueAvailable and this internal property are true.
    This internal property is not reset on a setAttributeName call.

    It is legal to make setNaValueChecked(true) but isNaValueChecked returns false.

    This internal property is true as default.

    Returns boolean

    true if the N/A value is included in the exact search attribute set.

  • Removes a value from the full text search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value that contains at least one of the values in the given string array.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    Parameters

    • pValue: string
      in
      The value to remove from the full text search attribute set.

    Returns boolean

    true if the call is legal and such a value was found in the full text search attribute set and therefore the FilterAttributeInterface was modified.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    • pObject: Object

      The listener object that was used when addEventListener was called.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener by its id.

    If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.

    Parameters

    • pId: string
      in
      The id returned by the call to addEventListener that you want to remove.

    Returns boolean

    true if the callback was removed else false.

  • Removes a value from the exact search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value exactly included in the exact search attribute set.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    Parameters

    • pValue: string
      in
      The exact value to remove from the search attribute set.

    Returns boolean

    true if such a value was found in the exact search attribute set and therefore the FilterAttributeInterface was modified.

  • Sets the name of the attribute to filter with.

    Calling this function with the same attribute name that was set previously does nothing and returns true. If the attribute name is changed and valid, this function will clear any values previously set by setExactValues, setContainsValues.
    Calling this function with an unknown attribute, or an attribute that does not have a string value is illegal. In that case, the FilterAttributeInterface is left unchanged and false is returned. Please refer to the AttributesDictionaryInterface.getDictionary to get the list of available attributes and their types.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    A FilterAttributeInterface has an empty (invalid) attribute name by default. An (invalid) empty attribute name can also bet set.

    Parameters

    • pAttributeName: string
      in
      The new name of the attribute to use.

    Returns boolean

    true if the new attribute name was set and legal.

  • Sets the full text search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value that contains at least one of the values in the given string array.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    If pValues is already the same as the full text search attribute set, this function does nothing.

    Parameters

    • pValues: string[]
      in
      The full text acceptable values.

    Returns boolean

    true if the FilterAttributeInterface is updated.

  • Sets the FilterItemInterface enabled/disabled status.

    If disabled, this FilterItemInterface is completely ignored during all the computations (the behavior is the same as if it had not been created). Use addEventListener on the event FilterItemInterfaceSignal.FilterEnabledChanged to know when the FilterItemInterface has changed its enabled status. Modifying a disabled FilterItemInterface will not trigger any change in the containing FilterSetInterface / WorkingSetInterface.

    A FilterItemInterface is enabled by default.

    Parameters

    • pEnabled: boolean
      in
      If true, the given FilterItemInterface is enabled.

    Returns void

  • Sets the exact search attribute set.

    Elects all the part instances having the attribute whose name set with setAttributeName in their joined attribute set that have a value exactly included in the given string array.

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterAttributeInterface data changed.

    Do not forget to call DataSessionInterface.update to trigger a recomputation of the changed filters when you have done all your changes.

    If pValues is already the same as the exact search attribute set, this function does nothing.

    Parameters

    • pValues: string[]
      in
      The exact acceptable values.

    Returns void

  • Sets the identifier of the FilterItemInterface.

    Make sure the id is unique across the application.

    Parameters

    • pFilterId: string
      in
      The new identifier of the FilterItemInterface.

    Returns void

  • Sets the "inverted" status of the FilterItemInterface.

    When "inverted", a FilterItemInterface elects all the part instances that were not selected if it was not inverted. Use addEventListener on the event FilterItemInterfaceSignal.FilterInvertedChanged to know when the FilterItemInterface has changed its "inverted" status.

    A FilterItemInterface is not "inverted" by default.

    Parameters

    • pInverted: boolean
      in
      If true, such a FilterItemInterface will be "inverted".

    Returns void

  • Includes/removes the N/A value in the exact search attribute set.

    Sets if part instances with the N/A value should be included in the FilterAttributeInterface.

    The FilterAttributeInterface has an internal property that tells to include part instances with the N/A value if if is available (hasNaValueAvailable returns true), this call updates this internal property.

    It is legal to make setNaValueChecked(true) but if hasNaValueAvailable is false, then the call will only change the internal property, without changing the filter.

    This internal property is true as default.

    Returns true if the call will change the content of the FilterAttributeInterface.

    Parameters

    • pChecked: boolean
      in
      Tells if the N/A value should be included/removed in the exact search attribute set.

    Returns boolean

    true if the FilterAttributeInterface is updated.

  • Gets a deep copy of the internal data of the FilterItemInterface.

    Please refer to JSON.stringify.

    Parameters

    • Optional pKey: any
      in
      Unused.

    Returns Object

    The internal FilterItemInterface data.