gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

TaskModel

Task model class.

:property input_specs: The specs of the input :type input_specs: dict :property output_specs: The specs of the output :type output_specs: dict :property config_specs: The specs of the config :type config_specs: dict

Attributes
community_agent_version_id: strcommunity_agent_version_modified: boolconfig: Configdata: Dict[str, Any]error_info: ProcessErrorInfoprogress_bar: ProgressBarscenario: Scenariosource_config_id: strstatus: ProcessStatusstyle: TypingStyle
Functions
__init__

Constructor

archive
check_is_updatable
error_if_finished : bool - True
clone
coerce
_coerce : bool - True
delete_instance
dependencies
search_nullable : bool - False
get_community_agent_version_id
Return type : str
get_community_agent_version_modified
Return type : bool
get_error_info
Return type : Optional[ProcessErrorInfo]
get_execution_time

Return the execution time of the process

Return type : float
get_id
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_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_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
in_port

Returns the port of the inputs by its name.

port_name : str
Return type : InPort
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_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
refresh
Return type : ModelType
reset
run

Run the process and save its state in the database.

save

Override save to save the inputs and outputs

Return type : 'ProcessModel'
save_full

Function to run overrided by the sub classes

Return type : TaskModel
save_input_resources

Method run just before the task run to save the input resource for this task. this will allow to know what resource this task uses as input

save_process_run_stat

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

set_config

Set the config

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 : Dict
[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_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

Method used when creating a new task model, it init the input and output from task specs

process_type : Type
set_scenario
scenario : Scenario
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
to_minimum_dto

Return the minium json to recognize this process

Return type : ProcessMinimumDTO
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_scenario_input_tasks @classmethod

Return all the Input task Model of the scenario

scenario_ids : List
Return type : ModelSelect
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