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

add support for refresh in analysis execution

parent 1e271579
...@@ -44,5 +44,8 @@ else: ...@@ -44,5 +44,8 @@ else:
# only stop batch ingestions # only stop batch ingestions
if use == "big_data/ingestion/batch": if use == "big_data/ingestion/batch":
context.stop() context.stop()
# stop refresh
if context.getRefreshState() == "refresh_started":
context.stopRefresh()
return out return out
data_analysis = context.getPortalObject().restrictedTraverse(
data_analysis_relative_url)
data_analysis\
.activate(serialization_tag=str(data_analysis.getUid()))\
.DataAnalysis_executeDataOperation()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>data_analysis_relative_url</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataSupply_executeDataAnalysis</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -15,7 +15,7 @@ portal = context.getPortalObject() ...@@ -15,7 +15,7 @@ portal = context.getPortalObject()
#} #}
#portal.portal_catalog.searchAndActivate( #portal.portal_catalog.searchAndActivate(
# method_id='DataAnalysis_executeDataOperation', # method_id='DataAnalysis_executeDataOperation',
# method_kw=method_kw, # method_kw=method_kw,
# activate_kw=activate_kw, # activate_kw=activate_kw,
# **search_kw) # **search_kw)
...@@ -23,5 +23,13 @@ portal = context.getPortalObject() ...@@ -23,5 +23,13 @@ portal = context.getPortalObject()
for data_analysis in portal.portal_catalog(portal_type = "Data Analysis", for data_analysis in portal.portal_catalog(portal_type = "Data Analysis",
simulation_state = "started"): simulation_state = "started"):
if not data_analysis.hasActivity(): if not data_analysis.hasActivity():
data_analysis.activate(serialization_tag=str(data_analysis.getUid()))\ if data_analysis.getRefreshState() == "current":
.DataAnalysis_executeDataOperation() data_analysis.activate(serialization_tag=str(data_analysis.getUid()))\
.DataAnalysis_executeDataOperation()
for data_analysis in portal.portal_catalog(portal_type = "Data Analysis",
refresh_state = "refresh_planned"):
if data_analysis.getRefreshState() == "refresh_planned":
if not data_analysis.hasActivity():
data_analysis.activate(serialization_tag=str(data_analysis.getUid()))\
.DataAnalysis_clearAndReprocessFromScratch()
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