Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
wendelin
Commits
b5c0c55b
Commit
b5c0c55b
authored
May 19, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow multiple input lines per ingestion
parent
caaf87de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
52 deletions
+59
-52
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+59
-52
No files found.
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
b5c0c55b
...
...
@@ -16,6 +16,61 @@ data_ingestion = portal_catalog.getResultValue(
simulation_state
=
'started'
,
reference
=
data_ingestion_reference
)
def
init_input_line
(
input_line
,
operation_line
):
# copy device and configuration from operation line to input line
input_line
.
setAggregateSet
(
input_line
.
getAggregateList
()
+
operation_line
.
getAggregateList
())
# Check if we have a batch referece
data_ingestion_batch_reference
=
movement_dict
.
get
(
'aggregate_data_ingestion_batch_reference'
,
None
)
data_ingestion_batch_id
=
"%s-%s"
%
(
today_string
,
data_ingestion_batch_reference
)
data_sink
=
None
if
data_ingestion_batch_reference
is
not
None
:
data_ingestion_batch
=
portal_catalog
.
getResultValue
(
portal_type
=
"Data Ingestion Batch"
,
reference
=
data_ingestion_batch_reference
)
if
data_ingestion_batch
is
None
:
data_ingestion_batch
=
portal
.
data_ingestion_batch_module
.
get
(
data_ingestion_batch_id
)
if
data_ingestion_batch
is
None
:
data_ingestion_batch
=
portal
.
data_ingestion_batch_module
.
newContent
(
id
=
data_ingestion_batch_id
,
portal_type
=
"Data Ingestion Batch"
,
reference
=
data_ingestion_batch_reference
)
else
:
previous_data_ingestion_line
=
portal_catalog
.
getResultValue
(
portal_type
=
"Data Ingestion Line"
,
resource_reference
=
resource_reference
,
aggregate_uid
=
data_ingestion_batch
.
getUid
())
if
previous_data_ingestion_line
is
not
None
:
data_sink
=
previous_data_ingestion_line
\
.
getAggregateDataSinkValue
()
input_line
.
setDefaultAggregateValue
(
data_ingestion_batch
)
data_product
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Data Product"
,
reference
=
resource_reference
)
data_sink_type
=
data_product
.
getAggregatedPortalType
()
if
data_sink
is
None
:
data_sink
=
portal
.
getDefaultModule
(
data_sink_type
).
newContent
(
portal_type
=
data_sink_type
,
reference
=
"%s-%s"
%
(
data_ingestion_reference
,
resource_reference
))
data_sink
.
validate
()
input_line
.
setDefaultAggregateValue
(
data_sink
)
input_line
.
setQuantity
(
1
)
if
data_ingestion
is
None
:
document
=
portal
.
data_ingestion_module
.
get
(
data_ingestion_id
)
if
(
document
is
not
None
)
and
document
.
getSimulationState
()
==
'started'
:
...
...
@@ -78,58 +133,7 @@ if data_ingestion is None:
# we set quantity=0 for the empty line
current_line
.
setQuantity
(
0
)
# copy device and configuration from operation line to input line
input_line
.
setAggregateSet
(
input_line
.
getAggregateList
()
+
operation_line
.
getAggregateList
())
# Check if we have a batch referece
data_ingestion_batch_reference
=
movement_dict
.
get
(
'aggregate_data_ingestion_batch_reference'
,
None
)
data_ingestion_batch_id
=
"%s-%s"
%
(
today_string
,
data_ingestion_batch_reference
)
data_sink
=
None
if
data_ingestion_batch_reference
is
not
None
:
data_ingestion_batch
=
portal_catalog
.
getResultValue
(
portal_type
=
"Data Ingestion Batch"
,
reference
=
data_ingestion_batch_reference
)
if
data_ingestion_batch
is
None
:
data_ingestion_batch
=
portal
.
data_ingestion_batch_module
.
get
(
data_ingestion_batch_id
)
if
data_ingestion_batch
is
None
:
data_ingestion_batch
=
portal
.
data_ingestion_batch_module
.
newContent
(
id
=
data_ingestion_batch_id
,
portal_type
=
"Data Ingestion Batch"
,
reference
=
data_ingestion_batch_reference
)
else
:
previous_data_ingestion_line
=
portal_catalog
.
getResultValue
(
portal_type
=
"Data Ingestion Line"
,
resource_reference
=
resource_reference
,
aggregate_uid
=
data_ingestion_batch
.
getUid
())
if
previous_data_ingestion_line
is
not
None
:
data_sink
=
previous_data_ingestion_line
\
.
getAggregateDataSinkValue
()
input_line
.
setDefaultAggregateValue
(
data_ingestion_batch
)
data_product
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Data Product"
,
reference
=
resource_reference
)
data_sink_type
=
data_product
.
getAggregatedPortalType
()
if
data_sink
is
None
:
data_sink
=
portal
.
getDefaultModule
(
data_sink_type
).
newContent
(
portal_type
=
data_sink_type
,
reference
=
data_ingestion_reference
)
data_sink
.
validate
()
input_line
.
setDefaultAggregateValue
(
data_sink
)
init_input_line
(
input_line
,
operation_line
)
data_ingestion
.
start
()
else
:
...
...
@@ -139,6 +143,9 @@ else:
input_line
=
line
elif
line
.
getResourceValue
().
getPortalType
()
==
"Data Operation"
:
operation_line
=
line
if
input_line
.
getQuantity
()
==
0
:
init_input_line
(
input_line
,
operation_line
)
data_operation
=
operation_line
.
getResourceValue
()
parameter_dict
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment