Program entities

ProgramInterface

class business_logic.models.ProgramInterface(*args, **kwargs)

Determines interface for business_logic.models.Program. Should be configured by adding one or more business_logic.models.ProgramArgument. Can hold link to business_logic.models.ExecutionEnvironment.

title

human-readable name

Type:str
code

machine-readable code for programmatic access

Type:str
environment

execution environment, can be empty

Type:business_logic.models.ExecutionEnvironment
programs

queryset of child Program

Type:business_logic.models.Program

ProgramArgument

class business_logic.models.ProgramArgument(id, program_interface, name, content_type, variable_definition)

ProgramArgumentField

class business_logic.models.ProgramArgumentField(*args, **kwargs)
program_argument

argument of business_logic.models.ProgramInterface

Type:business_logic.models.ProgramArgument
name

name of the field, can include dots for nested fields

Type:str
title

human-readable name

variable_definition

definition for variable

Type:business_logic.models.VariableDefinition

Program

class business_logic.models.Program(*args, **kwargs)

Implements business_logic.models.ProgramInterface. Can hold link to business_logic.models.ExecutionEnvironment.

title

human-readable name

Type:str
code

machine-readable code for programmatic access

Type:str
environment

execution environment, can be empty

Type:business_logic.models.ExecutionEnvironment
program_interface

implemented interface

Type:business_logic.models.ProgramInterface
versions

queryset of child ProgramVersion

Type:business_logic.models.ProgramVersion

ProgramVersion

class business_logic.models.ProgramVersion(*args, **kwargs)

Acts as version of business_logic.models.Program. Main holder of visually editable code. Can hold link to business_logic.models.ExecutionEnvironment.

title

human-readable name

Type:str
description

human-readable description

Type:str
environment

execution environment, can be empty

Type:business_logic.models.ExecutionEnvironment
is_default

default=False, can be used for choosing suitable ProgramVersion. Only one ProgramVersion for given :class:`business_logic.models.Program can have this field value as True

Type:bool
entry_point

entry point of visually editable code

Type:business_logic.models.Node
program

parent Program

Type:business_logic.models.Program
copy(new_title)

Creates a copy of self with given title. Suitable for “save as” actions.

Parameters:new_titlestr new title
Returns:new business_logic.models.ProgramVersion instance
execute(context=None, **kwargs)

Main function for program execution

Parameters:
Returns:

Context instance

Return type:

business_logic.models.Context

Raises:
  • KeyError – If any of program argument omitted
  • AssertionError – if any of program argument have incorrect type, if passed unregistered program argument

Todo

  • create own exceptions instead AssertionError/KeyError/etc
../_images/Program.svg