Commit 59369322 authored by Klaus Wölfel's avatar Klaus Wölfel

reuse existing item for new analysis

parent d681144c
...@@ -105,20 +105,30 @@ for movement in portal_catalog(query): ...@@ -105,20 +105,30 @@ for movement in portal_catalog(query):
# Except if it is a Data Array Line, then it is currently created by # Except if it is a Data Array Line, then it is currently created by
# data operation itself (probably this exception is inconsistent) # data operation itself (probably this exception is inconsistent)
if item_type not in aggregate_type_set and item_type != "Data Array Line": if item_type not in aggregate_type_set and item_type != "Data Array Line":
module = portal.getDefaultModule(item_type) item = portal.portal_catalog.getResultValue(
item = module.newContent(portal_type = item_type, portal_type=item_type,
title = transformation.getTitle(), validation_state="validated",
reference = "%s-%s" %(transformation.getTitle(), item_variation_text=transformation_line.getVariationText(),
delivery.getReference()), item_device_relative_url=movement.getAggregateDevice(),
version = '001') item_project_relative_url=data_analysis.getDestinationProject(),
try: item_resource_uid=resource.getUid(),
item.validate() item_source_relative_url=data_analysis.getSource())
except AttributeError: if item is None:
pass module = portal.getDefaultModule(item_type)
item = module.newContent(portal_type = item_type,
title = transformation.getTitle(),
reference = "%s-%s" %(transformation.getTitle(),
delivery.getReference()),
version = '001')
try:
item.validate()
except AttributeError:
pass
aggregate_set.add(item.getRelativeUrl()) aggregate_set.add(item.getRelativeUrl())
# find other items such as device configuration and data configuration # find other items such as device configuration and data configuration
# from data ingestion and data supply # from data ingestion and data supply
composed = data_analysis.asComposedDocument() composed = data_analysis.asComposedDocument()
data_analysis.checkConsistency(fixit=True)
line_list = [l for l in delivery.objectValues(portal_type="Data Ingestion Line")] line_list = [l for l in delivery.objectValues(portal_type="Data Ingestion Line")]
line_list += [l for l in composed.objectValues(portal_type="Data Supply Line")] line_list += [l for l in composed.objectValues(portal_type="Data Supply Line")]
for line in line_list: for line in line_list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment