Skip to content

input_variable

Module to interact with Knowledge Model input variables.

This module contains class to interact with Package Manager input variables of a Knowledge Model.

Typical usage example:

input_variables = knowledge_model.get_variables()
input_variable = knowledge_model.get_variable(
    "INPUT_VARIABLE_KEY"
)
input_variable.value_or_default

InputVariable

Bases: InputVariableDefinitionTransportWithValue

Input variable object to interact with input variables of a knowledge model.

client class-attribute instance-attribute

client = Field(..., exclude=True)

key instance-attribute

key

Key of input variable.

value instance-attribute

value

Value assigned to input variable. None if no value is assigned.

default_value instance-attribute

default_value

Default value of input variable. None if no default value is defined.

knowledge_model_id instance-attribute

knowledge_model_id

Id of knowledge model where input variable is located.

data_type class-attribute instance-attribute

data_type = Field(None, alias='dataType')

description class-attribute instance-attribute

description = Field(None, alias='description')

display_name class-attribute instance-attribute

display_name = Field(None, alias='displayName')

propagate class-attribute instance-attribute

propagate = Field(None, alias='propagate')

scope class-attribute instance-attribute

scope = Field(None, alias='scope')

value_or_default class-attribute instance-attribute

value_or_default = Field(None, alias='valueOrDefault')

from_transport classmethod

from_transport(
    client, knowledge_model_id, input_variable_transport
)

Creates high-level InputVariable object from given InputVariableDefinitionTransportWithValue.

Parameters:

  • client (Client) –

    Client to use to make API calls for given input variable.

  • knowledge_model_id (str) –

    Id of knowledge model where input variable is located.

  • input_variable_transport (InputVariableDefinitionTransportWithValue) –

    InputVariableDefinitionTransportWithValue object containing properties of input variable.

Returns:

  • InputVariable –

    An InputVariable object with properties from transport and given client.

sync

sync()

Syncs input variable properties with EMS.

Raises: