Skip to content
Snippets Groups Projects
Commit 77da098c authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-1144: skip non-finished and/or obsolete subtasks, as they are not part of...

TMSS-1144: skip non-finished and/or obsolete subtasks, as they are not part of the successfull provenance chain
parent be2bec32
No related branches found
No related tags found
1 merge request!635Resolve TMSS-1144
......@@ -114,6 +114,12 @@ def add_subbtask_and_input_dataproducts_to_sip(subtask: Subtask, sip: siplib.Sip
:param subtask: the Subtask object to add to the sip
:param sip: the Sip object to add to
"""
if subtask.state.value != SubtaskState.Choices.FINISHED.value:
logger.info("Skipping addition of subtask id %s of type %s to sip because it is not finished but %s." % (subtask.id, subtask.specifications_template.type.value, subtask.state.value))
if subtask.state.value != SubtaskState.Choices.FINISHED.value:
logger.info("Skipping addition of subtask id %s of type %s to sip because it is obsolete." % (subtask.id, subtask.specifications_template.type.value))
logger.info("Adding subtask id %s of type %s to sip." % (subtask.id, subtask.specifications_template.type.value))
sip_subtask = create_sip_representation_for_subtask(subtask)
if isinstance(sip_subtask, siplib.Observation):
......@@ -545,7 +551,7 @@ def recursively_add_subbtask_and_input_dataproducts_to_sip(subtask: Subtask, sip
:param sip: the Sip object to add to
:return:
"""
if subtask is not None:
if subtask is not None and subtask.state.value==SubtaskState.Choices.FINISHED.value and not subtask.is_obsolete:
add_subbtask_and_input_dataproducts_to_sip(subtask, sip)
for predecessor in subtask.predecessors.all():
recursively_add_subbtask_and_input_dataproducts_to_sip(predecessor, sip)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment