Back to bricks list
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

ProtocolModel

Base abstract class for Process and Protocol

:param Viewable: [description] :type Viewable: [type]

Attributes
config: Configdata: Dict[str, Any]error_info: ProcessErrorInfolayout: ProtocolLayoutprogress_bar: ProgressBarscenario: Scenariostatus: ProcessStatusstyle: TypingStyle
Functions
__INIT__

Constructor

ADD_CONNECTOR

Adds a connector to the pfrotocol.

from_process_name : str
from_port_name : str
to_process_name : str
to_port_name : str
Return type : Connector
ADD_CONNECTORS
connectors : List
ADD_INTERFACE
Name : str
process_name : str
port_name : str
Return type : IOface
ADD_INTERFACES
interfaces : Dict
ADD_INTERFACES_FROM_DTO
interfaces : Dict
ADD_OUTERFACE
Name : str
process_name : str
port_name : str
Return type : IOface
ADD_OUTERFACES
outerfaces : Dict
ADD_OUTERFACES_FROM_DTO
outerfaces : Dict
ADD_PROCESS_MODEL

Adds a process to the protocol.

process_model : ProcessModel
instance_name : str
Unique name of the process. If none, the name is generated
ALL_PROCESSES_ARE_DRAFT

Return True if all the processes are in draft

Return type : bool
ALL_PROCESSES_ARE_SUCCESS

Return True if all the processes are in success

Return type : bool
ARCHIVE
CHECK_IS_UPDATABLE
error_if_finished : bool - True
CLONE
COERCE
_coerce : bool - True
DELETE_CONNECTOR_FROM_RIGHT

remove the connector which right side is connected to the specified port of the specified process return the list of deleted connectors

right_process_name : str
right_process_port_name : str
Return type : Optional
DELETE_CONNECTORS_FROM_LEFT

remove the connector which left side is connected to the specified port of the specified process It can remove multiple connectors if there are multiple connectors connected to the same port Return the list of deleted connectors

left_process_name : str
left_process_port_name : str
DELETE_INSTANCE
DEPENDENCIES
search_nullable : bool - False
GENERATE_INTERFACE_NAME

Generate a unique interface name

Return type : str
GENERATE_OUTERFACE_NAME

Generate a unique outerface name

Return type : str
GENERATE_UNIQUE_INSTANCE_NAME

Generate a unique instance name from an instance_name by adding _1 or _2... to the end of the instance name

instance_name : str
Return type : str
GET_ALL_NEXT_PROCESSES

Returns all the next processes of a process in this protocol and parent protocols.

process_name : str
check_parent_protocol : bool - True
If True, the next processes of the parent protocol are also returned
check_circular_connexion : bool - False
If True, check if there is a circular connexion and raise an exception
Return type : Set
GET_ALL_PROCESSES_FLATTEN_SORT_BY_START_DATE

Return all the processes of the protocol and its sub protocols, sorted by start date

Return type : List
GET_COMMUNITY_AGENT_VERSION_ID
Return type : str
GET_COMMUNITY_AGENT_VERSION_MODIFIED
Return type : bool
GET_CONNECTOR_FROM_RIGHT

Returns a connector by the destination process and port

right_process_name : str
right_process_port_name : str
Return type : Optional
GET_CONNECTORS_FROM_LEFT

Returns a connector by the destination process and port

left_process_name : str
left_process_port_name : str
Return type : List
GET_CURRENT_PROGRESS

Calculate the current progress of the protocol. It excludes the auto run processes and count finished processes as 100% and running processes as their progress

Return type : ScenarioProgressDTO
GET_DIRECT_NEXT_PROCESSES

Returns the next processes of a process.

process_name : str
Return type : Set
GET_DIRECT_PREVIOUS_PROCESSES

Returns the previous processes of a process.

process_name : str
Return type : Set
GET_ERROR_INFO
Return type : Optional[ProcessErrorInfo]
GET_ERROR_TASKS
Return type : List
GET_EXECUTION_TIME

Return the execution time of the process

Return type : float
GET_GRAPH

Return the graph json object

Return type : ProtocolMinimumDTO
GET_ID
GET_INPUT_RESOURCE_MODEL_IDS
Return type : Set
GET_INSTANCE_NAME_CONTEXT

return the instance name in the context

Return type : str
GET_INSTANCE_PATH

Return the instance path

Return type : str
GET_INTERFACES_LINKED_TO_PROCESS

Returns the interfaces linked to a process

process_instance_name : str
Return type : List
GET_LAST_MESSAGE

Return the last message of the process

Return type : Optional[ProgressBarMessageDTO]
GET_NAME

Return the name of the process

Return type : str
GET_OUTERFACE_LINKED_TO_PROCESS

Returns the outerface linked to the process with the given name

process_instance_name : str
Return type : List
GET_PROCESS

Returns a process by its name.

Name : str
Return type : ProcessModel
GET_PROCESS_BY_INSTANCE_PATH

Returns a process by its instance path.

instance_path : str
Return type : ProcessModel
GET_PROCESS_TYPE
Return type : Type[Process]
GET_PROCESS_TYPING
Return type : Typing
GET_PROGRESS_VALUE

Return the last message of the process

Return type : float
GET_PROTOCOL_CHAIN_INFO

return a string with the information up to the main protocol

Return type : str
GET_RUNNING_TASK

Return the running process, go through all the sub protocols

Return type : Optional
HAS_FINISHED_PROCESSES

Return True if the protocol has finished processes (except the auto run processes)

Return type : bool
IN_PORT

Returns the port of the inputs by its name.

port_name : str
Return type : InPort
INIT_CONNECTORS_FROM_GRAPH
links : List
check_compatiblity : bool - True
INIT_PROCESSES_FROM_GRAPH
sub_process_factory : ProtocolSubProcessBuilder
IS_ALIAS
IS_AUTO_RUN

Return true if the process is automatically run when added to a protocol

Return type : bool
IS_DIRTY
IS_ENABLE_IN_SUB_PROTOCOL

Return true if the process is enable in sub protocol

Return type : bool
IS_INPUT_TASK

return true if the process is of type InputTask

Return type : bool
IS_INTERFACED_WITH

Returns True if the input poort the process is an interface of the protocol

process_instance_name : str
Return type : bool
IS_OUTERFACED_WITH

Returns True if the input poort the process is an outerface of the protocol

process_instance_name : str
Return type : bool
IS_OUTPUT_TASK

return true if the process is of type OutputTask

Return type : bool
IS_PROTOCOL
Return type : bool
IS_ROOT_PROCESS
Return type : bool
IS_SAVED

Returns True if the model is saved in db, False otherwise

Return type : bool
MARK_AS_DRAFT
MARK_AS_ERROR
error_info : ProcessErrorInfo
MARK_AS_ERROR_AND_PARENT
process_error : ProcessRunException
context : str
MARK_AS_STARTED
MARK_AS_SUCCESS
MARK_AS_WAITING_FOR_CLI_PROCESS
OUT_PORT

Returns the port of the outputs by its name.

port_name : str
Return type : OutPort
PORT_IS_INTERFACE

Return True if the port of the process is an interface of the protocol

process_instance_name : str
port_name : Any
Return type : bool
PROCESS_IS_READY
process : ProcessModel
Return type : bool
PROPAGATE_RESOURCES
REFRESH
Return type : ModelType
REFRESH_GRAPH_FROM_DUMP

Refresh the graph json object inside the data from the dump method

REFRESH_STATUS

Refresh the status of the protocol based on the status of its processes

refresh_parent : bool - True
REMOVE_INTERFACE

Remove an interface

Name : str
_description_
REMOVE_INTERFACES_BY_PROCESS_NAME

Remove the interface linked the process with the given name

process_name : str
REMOVE_OUTERFACE
Name : str
REMOVE_OUTERFACES_BY_PROCESS_NAME

Remove the outerfaces linked to the process with the given name

process_instance_name : str
REMOVE_PROCESS
Name : str
REPLACE_IO_PROCESS_WITH_IOFACE

Method to replace each Input process with an interface and each Output process with an outerface. It does not replace on sub protocols

RESET
RUN

Run the process and save its state in the database.

RUN_AUTO_RUN_PROCESSES

Run all the auto run processes of the protocol

RUN_PROCESS

Method to run a single process of the protocol

process_instance_name : str
process to run
SAVE

Override save to save the inputs and outputs

Return type : 'ProcessModel'
SAVE_FULL
SAVE_GRAPH
Return type : ProtocolModel
SAVE_PROCESS_RUN_STAT

Save the process run stat. If it's a autorun process, it doesnt save.

SET_CONFIG

Set the config object

config : Config
[description]
SET_CONFIG_VALUE

Set a value of the config

param_name : str
[description]
value : Any
[description]
SET_CONFIG_VALUES

Set the config values

config_values : ConfigParamsDict
[description]
SET_ERROR_INFO
error_info : ProcessErrorInfo
SET_INPUTS_FROM_DTO

Set the inputs from a DTO

inputs_dto : IODTO
reset : bool - False
SET_INPUTS_FROM_SPECS

Set the inputs from specs

inputs_specs : IOSpecs
SET_INTERFACES
interfaces : Dict
SET_OUTERFACES
outerfaces : Dict
SET_OUTPUTS_FROM_DTO

Set the outputs from a DTO

outputs_dto : IODTO
reset : bool - False
SET_OUTPUTS_FROM_SPECS

Set the outputs from specs

outputs_specs : IOSpecs
SET_PARENT_PROTOCOL

Sets the parent protocol of the process

parent_protocol : ProtocolModel
SET_PROCESS_TYPE
process_type : Type[Process]
SET_SCENARIO
scenario : Any
TO_CONFIG_DTO

Return the config DTO

ignore_input_task_config : bool - False
if true, the config values of input task task is ignored
Return type : ProcessConfigDTO
TO_DTO
Return type : ProcessDTO
TO_MINIMUM_DTO

Return the minium json to recognize this process

Return type : ProcessMinimumDTO
TO_PROTOCOL_CONFIG_DTO
ignore_input_task_config : bool - False
Return type : ProtocolGraphConfigDTO
TO_PROTOCOL_DTO
Return type : ProtocolDTO
TO_PROTOCOL_FULL_DTO
Return type : ProtocolFullDTO
TO_PROTOCOL_MINIMUM_DTO
Return type : ProtocolMinimumDTO
UNWRAP
ADD_INDEX - @classmethod
fields : Any
AFTER_ALL_TABLES_INIT - @classmethod

Method call after all the table are inited

Useful when use DeferredForeignKey to create the foreign key manually latter

AFTER_TABLE_CREATION - @classmethod

Method call after the table is created

Usefull to create the full text indexes

ALIAS - @classmethod
Alias : Any
BIND - @classmethod
database : Any
bind_refs : bool - True
bind_backrefs : bool - True
_exclude : Any
BIND_CTX - @classmethod
database : Any
bind_refs : bool - True
bind_backrefs : bool - True
BULK_CREATE - @classmethod
model_list : Any
batch_size : Any
BULK_UPDATE - @classmethod
model_list : Any
fields : Any
batch_size : Any
CLASSNAME - @classmethod

Returns the name of the class

slugify : bool - False
True to slugify the class name if True
snakefy : bool - False
True to snakefy the class name if True
replace_uppercase : bool - False
Replace upper cases by "-" if True
Return type : str
COLUMN_EXISTS - @classmethod

Returns True if the column exists in the table

column_name : str
The column name
Return type : bool
CREATE - @classmethod
query : Any
CREATE_FOREIGN_KEY_IF_NOT_EXIST - @classmethod

Create a foreign key for a Foreign key field only if the foreign key does not exists

field : ForeignKeyField
[description]
CREATE_FULL_TEXT_INDEX - @classmethod

Method to create a full text index

columns : List
[description]
index_name : str
CREATE_TABLE - @classmethod

Create model table

DELETE - @classmethod
DELETE_BY_ID - @classmethod
pk : Any
DROP_TABLE - @classmethod

Drop model table

EXECUTE_SQL - @classmethod

Execute a raw SQL query. Can use the [TABLE_NAME] to replace by the table name

query : str
The query to execute
FILTER - @classmethod
dq_nodes : Any
filters : Any
FOREIGN_KEY_EXISTS - @classmethod
column_name : str
Return type : bool
FULL_CLASSNAME - @classmethod

Returns the full name of the class

slugify : bool - False
Slugify the returned class name if True
snakefy : bool - False
Snakefy the returned class name if True
Return type : str
GET - @classmethod
query : Any
filters : Any
GET_BY_ID - @classmethod
id : str
Return type : Optional
GET_BY_ID_AND_CHECK - @classmethod

Get by ID and throw 404 error if object not found

id : str
[description]
Return type : ModelType
GET_BY_IDS - @classmethod
ids : List
Return type : List
GET_DB - @classmethod
Return type : DatabaseProxy
GET_DB_MANAGER - @classmethod

Returns the (current) DbManager of this model

Return type : Type
GET_OR_CREATE - @classmethod
GET_OR_NONE - @classmethod
query : Any
filters : Any
GET_TABLE_NAME - @classmethod

Returns the table name of this class

Return type : str
INDEX - @classmethod
fields : Any
INDEX_EXISTS - @classmethod

Returns True if the index exists in the table

index_name : str
The index name
Return type : bool
INHERITORS - @classmethod

Get all the classes that inherit this class

Return type : List
INSERT - @classmethod
_Model__data : Any
insert : Any
INSERT_FROM - @classmethod
query : Any
fields : Any
INSERT_MANY - @classmethod
rows : Any
fields : Any
IS_MYSQL_ENGINE - @classmethod
NOOP - @classmethod
RAW - @classmethod
sql : Any
params : Any
REPLACE - @classmethod
_Model__data : Any
insert : Any
REPLACE_MANY - @classmethod
rows : Any
fields : Any
SAVE_ALL - @classmethod
SELECT - @classmethod
fields : Any
SET_BY_ID - @classmethod
key : Any
value : Any
TABLE_EXISTS - @classmethod
TRUNCATE_TABLE - @classmethod
options : Any
UPDATE - @classmethod
_Model__data : Any
update : Any
VALIDATE_MODEL - @classmethod
COPY - @staticmethod
method : Any