Commit 7e0a0fbb authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add an alarm for event_workflow migration.

parent ec95fa78
......@@ -28,6 +28,9 @@
from Products.ERP5Type.patches.WorkflowTool import WorkflowHistoryList
def migrateEventWorkflowHistory(self):
"""
Migrate event_workflow history to event_simulation_workflow history.
"""
portal_type = self.getPortalType()
portal = self.getPortalObject()
if portal_type not in portal.getPortalEventTypeList():
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>ERP5Site_migrateEventWorkflowHistory</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This alarm when triggered will migrate from event_workflow to event_simulation_workflow on all event-type portal types.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>upgrader_migrate_event_workflow_history</string> </value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1294012800.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Migration from event_workflow to event_simulation_workflow</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>active_process = context.getPortalObject().portal_activities.newActiveProcess()\n
context.ERP5Site_checkDataWithScript("Event_migrateEventWorkflowHistory",\n
tag="migrate",\n
active_process=active_process.getPath(),\n
method_kw=dict(force=1))\n
print "Migration started with process id: %s" %active_process.getPath()\n
return printed\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_migrateEventWorkflowHistory</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
576
\ No newline at end of file
577
\ No newline at end of file
portal_alarms/upgrader_migrate_event_workflow_history
portal_contribution_registry/crm_ingestion
\ No newline at end of file
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