Commit 5c133e82 authored by Ivan Tyagov's avatar Ivan Tyagov

Remove transition scripts which will be properly replaced by interaction_workflow.

parent 1929c5c7
from Products.ZSQLCatalog.SQLCatalog import Query, SimpleQuery
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
object = state_change['object']
if object.getPortalType() == "Data Set":
data_set = object
data_set_prefix = data_set.getReference() + portal.getIngestionReferenceDictionary()["reference_separator"]
#context.logEntry("Invalidating data set '%s' and dependencies." % data_set.getReference())
reference_query = Query(**{'reference': data_set_prefix + '%'})
kw_dict = {"portal_type": "Data Stream",
"query": reference_query}
for data_stream in portal_catalog(**kw_dict):
if data_stream.getReference().startswith(data_set_prefix) and not portal.IsReferenceInvalidated(data_stream):
portal.ERP5Site_invalidateIngestionObjects(data_stream.getReference())
portal.InvalidateReference(data_set)
data_set.setVersion("000")
elif object.getPortalType() == "Data Stream":
data_stream = object
portal.ERP5Site_invalidateIngestionObjects(data_stream.getReference())
<?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>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Action_invalidateRelatedObjects</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -46,7 +46,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>Action_invalidateRelatedObjects</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
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