Commit 8508196f authored by iv's avatar iv

ERP5Workflow: script have automatically moved from .xml to .py (portal_skins)

parent 05c03d74
managed_permissions = sorted(context.getParent().getManagedPermissionList())
available_roles = context.getManagedRoleList()
ma_i = []
ma_j = []
if matrixbox:
for perms in managed_permissions:
ma_i.append([perms,perms])
for roles in available_roles:
ma_j.append([roles, roles])
return [ma_i, ma_j]
......@@ -48,22 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>managed_permissions = sorted(context.getParent().getManagedPermissionList())\n
available_roles = context.getManagedRoleList()\n
\n
ma_i = []\n
ma_j = []\n
\n
if matrixbox:\n
for perms in managed_permissions:\n
ma_i.append([perms,perms])\n
for roles in available_roles:\n
ma_j.append([roles, roles])\n
return [ma_i, ma_j]\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>matrixbox, base_id=\'cell\'</string> </value>
......
......@@ -48,11 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.absolute_url() + \'/view\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
......
from Products.PythonScripts.standard import url_quote
REQUEST = container.REQUEST
RESPONSE = REQUEST.RESPONSE
workflow_list = kw.get('workflow_list')
selected_workflow_list = []
selected_workflow_id_list = []
if batch_mode == False and workflow_id_list is None:
if workflow_list:
for workflow in workflow_list:
if workflow.get('listbox_selected'):
selected_workflow_list.append(context.getObjectFromPath(workflow.get('listbox_key')))
if len(selected_workflow_list) == 0:
return context.REQUEST.RESPONSE.redirect(
'%s/WorkflowTool_viewWorkflowConversion?'
'portal_status_message=%s' % ( context.absolute_url(),
url_quote('No Workflow Selected.')))
else:
for workflow_id in workflow_id_list:
selected_workflow_list.append(getattr(context, workflow_id))
for workflow in selected_workflow_list:
if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() == 'Workflow':
return context.REQUEST.RESPONSE.redirect(
'%s/WorkflowTool_viewWorkflowConversion?'
'portal_status_message=%s' % ( context.absolute_url(),
url_quote('workflow(s) is already exist.')))
if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() == 'Interaction Workflow':
return context.REQUEST.RESPONSE.redirect(
'%s/WorkflowTool_viewWorkflowConversion?'
'portal_status_message=%s' % ( context.absolute_url(),
url_quote('workflow(s) is already exist.')))
# conversion and reassignment
new_workflow = context.dc_workflow_asERP5Object(workflow, is_temporary=False)
context.reassignWorkflow(new_workflow.getId())
selected_workflow_id_list.append(new_workflow.getId())
# Synchronize _chain_by_type to TypeWorkflowList
context.reassignWorkflowWithoutConversion()
if batch_mode:
return
return RESPONSE.redirect("%s/view?portal_status_message=Workflow+%s+converted"
%(context.absolute_url(), ',+'.join(selected_workflow_id_list)))
......@@ -48,58 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import url_quote\n
\n
REQUEST = container.REQUEST\n
RESPONSE = REQUEST.RESPONSE\n
workflow_list = kw.get(\'workflow_list\')\n
selected_workflow_list = []\n
selected_workflow_id_list = []\n
\n
if batch_mode == False and workflow_id_list is None:\n
if workflow_list:\n
for workflow in workflow_list:\n
if workflow.get(\'listbox_selected\'):\n
selected_workflow_list.append(context.getObjectFromPath(workflow.get(\'listbox_key\')))\n
\n
if len(selected_workflow_list) == 0:\n
return context.REQUEST.RESPONSE.redirect(\n
\'%s/WorkflowTool_viewWorkflowConversion?\'\n
\'portal_status_message=%s\' % ( context.absolute_url(),\n
url_quote(\'No Workflow Selected.\')))\n
else:\n
for workflow_id in workflow_id_list:\n
selected_workflow_list.append(getattr(context, workflow_id))\n
\n
for workflow in selected_workflow_list:\n
if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() == \'Workflow\':\n
return context.REQUEST.RESPONSE.redirect(\n
\'%s/WorkflowTool_viewWorkflowConversion?\'\n
\'portal_status_message=%s\' % ( context.absolute_url(),\n
url_quote(\'workflow(s) is already exist.\')))\n
if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() == \'Interaction Workflow\':\n
return context.REQUEST.RESPONSE.redirect(\n
\'%s/WorkflowTool_viewWorkflowConversion?\'\n
\'portal_status_message=%s\' % ( context.absolute_url(),\n
url_quote(\'workflow(s) is already exist.\')))\n
\n
# conversion and reassignment\n
new_workflow = context.dc_workflow_asERP5Object(workflow, is_temporary=False)\n
context.reassignWorkflow(new_workflow.getId())\n
selected_workflow_id_list.append(new_workflow.getId())\n
\n
# Synchronize _chain_by_type to TypeWorkflowList\n
context.reassignWorkflowWithoutConversion()\n
\n
if batch_mode:\n
return\n
\n
return RESPONSE.redirect("%s/view?portal_status_message=Workflow+%s+converted"\n
%(context.absolute_url(), \',+\'.join(selected_workflow_id_list)))\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>batch_mode=False, workflow_id_list=None, **kw</string> </value>
......
workflow_list = context.getWorkflowTempObjectList()
return workflow_list
......@@ -48,12 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>workflow_list = context.getWorkflowTempObjectList()\n
return workflow_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
......
......@@ -48,11 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.showAsXML()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......
"""Sets up an Workflow with defaults variables needed by ERP5.
"""
for state_id, state_title in (('draft', 'Draft'),):
state = context.newContent(portal_type='State')
state.setReference(state_id)
state.setTitle(state_title)
context.setSourceValue(state)
for v, property_dict in (
('action', {
'description': 'Transition id',
'variable_expression': 'transition/getReference|nothing',
'for_status': 1,
'automatic_update': 1,
}),
('actor', {
'description': 'Name of the user who performed transition',
'variable_expression': 'user/getUserName',
'for_status': 1,
'automatic_update': 1,
}),
('comment', {
'description': 'Comment about transition',
'variable_expression': "python:state_change.kwargs.get('comment', '')",
'for_status': 1,
'automatic_update': 1,
}),
('history', {
'description': 'Provides access to workflow history',
'variable_expression': 'state_change/getHistory',
}),
('time', {
'description': 'Transition timestamp',
'variable_expression': 'state_change/getDateTime',
'for_status': 1,
'automatic_update': 1,
}),
('error_message', {
'description': 'Error message if validation failed',
'for_status': 1,
'automatic_update': 1,
}),
('portal_type', {
'description': 'Portal type (used as filter for worklists)',
'for_catalog': 1,
}),
):
variable = context.newContent(portal_type='Variable')
variable.setReference(v)
variable.edit(**property_dict)
context.setStateVariable('simulation_state')
......@@ -48,60 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Sets up an Workflow with defaults variables needed by ERP5.\n
"""\n
for state_id, state_title in ((\'draft\', \'Draft\'),):\n
state = context.newContent(portal_type=\'State\')\n
state.setReference(state_id)\n
state.setTitle(state_title)\n
context.setSourceValue(state)\n
for v, property_dict in (\n
(\'action\', {\n
\'description\': \'Transition id\',\n
\'variable_expression\': \'transition/getReference|nothing\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'actor\', {\n
\'description\': \'Name of the user who performed transition\',\n
\'variable_expression\': \'user/getUserName\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'comment\', {\n
\'description\': \'Comment about transition\',\n
\'variable_expression\': "python:state_change.kwargs.get(\'comment\', \'\')",\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'history\', {\n
\'description\': \'Provides access to workflow history\',\n
\'variable_expression\': \'state_change/getHistory\',\n
}),\n
(\'time\', {\n
\'description\': \'Transition timestamp\',\n
\'variable_expression\': \'state_change/getDateTime\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'error_message\', {\n
\'description\': \'Error message if validation failed\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'portal_type\', {\n
\'description\': \'Portal type (used as filter for worklists)\',\n
\'for_catalog\': 1,\n
}),\n
):\n
variable = context.newContent(portal_type=\'Workflow Variable\')\n
variable.setReference(v)\n
variable.edit(**property_dict)\n
context.setStateVariable(\'simulation_state\')\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
......
"""
This script should be called in following case:
- new business installation after workflow conversion;
- workflow assignement in _chain_by_type with converted workflows' id coming with this new installed bt.
"""
workflow_tool = context.getPortalObject().portal_workflow
type_workflow_dict = workflow_tool.getChainsByType()
for ptype_id in type_workflow_dict:
ptype = getattr(context.getPortalObject().portal_types, ptype_id, None)
if ptype is not None:
for workflow_id in type_workflow_dict[ptype_id]:
workflow = getattr(workflow_tool, workflow_id, None)
if workflow and workflow.getPortalType() in ['Workflow', 'Interaction Workflow']:
# 1. clean DC workflow assignement:
workflow_tool.delTypeCBT(ptype.id, workflow.id)
# 2. assign ERP5 Workflow to portal type:
type_workflow_list = ptype.getTypeWorkflowList()
if workflow_id not in type_workflow_list:
ptype.setTypeWorkflowList(ptype.getTypeWorkflowList() + [workflow_id])
......@@ -48,31 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script should be called in following case:\n
- new business installation after workflow conversion;\n
- workflow assignement in _chain_by_type with converted workflows\' id coming with this new installed bt.\n
"""\n
\n
workflow_tool = context.getPortalObject().portal_workflow\n
type_workflow_dict = workflow_tool.getChainsByType()\n
\n
for ptype_id in type_workflow_dict:\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id, None)\n
if ptype is not None:\n
for workflow_id in type_workflow_dict[ptype_id]:\n
workflow = getattr(workflow_tool, workflow_id, None)\n
if workflow and workflow.getPortalType() in [\'Workflow\', \'Interaction Workflow\']:\n
# 1. clean DC workflow assignement:\n
workflow_tool.delTypeCBT(ptype.id, workflow.id)\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow_id not in type_workflow_list:\n
ptype.setTypeWorkflowList(ptype.getTypeWorkflowList() + [workflow_id])\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......
"""
for ptype in context.getPortalObject().portal_types.objectValues():
for workflow_id in ['interactionworkflow_testing_interaction_workflow', 'workflow_testing_workflow']:
ptype.delTypeWorkflowList(workflow_id)
"""
# rapair _chains_by_type
type_workflow_dict = {'Category': ('edit_workflow',), 'Dynamic Category Property': ('dynamic_class_generation_interaction_workflow',), 'System Preference': ('edit_workflow', 'preference_workflow'), 'Bug Line': ('edit_workflow', 'bug_event_workflow'), 'Embedded Folder': ('edit_workflow', 'embedded_workflow'), 'Test Component': ('edit_workflow', 'dynamic_class_generation_interaction_workflow', 'component_validation_workflow'), 'Base Category': ('edit_workflow', 'dynamic_class_generation_interaction_workflow'), 'Organisation': ('validation_workflow', 'edit_workflow'), 'Property Type Validity Constraint': ('dynamic_class_generation_interaction_workflow',), 'Property Existence Constraint': ('dynamic_class_generation_interaction_workflow',), 'Action Information': ('base_type_interaction_workflow',), 'ERP5Workflow Test Document': ('testing_workflow', 'testing_interaction_workflow', 'edit_workflow'), 'Document': ('edit_workflow',), 'Email': ('edit_workflow',), 'Career': ('career_workflow',), 'Document Component': ('edit_workflow', 'dynamic_class_generation_interaction_workflow', 'component_validation_workflow'), 'Category Acquired Membership State Constraint': ('dynamic_class_generation_interaction_workflow',), 'Predicate': ('rule_interaction_workflow', 'edit_workflow'), 'Category Tool': ('dynamic_class_generation_interaction_workflow',), 'Attribute Unicity Constraint': ('dynamic_class_generation_interaction_workflow',), 'Role Definition': ('edit_workflow', 'local_permission_interaction_workflow'), 'Category Membership State Constraint': ('dynamic_class_generation_interaction_workflow',), 'Assignment': ('edit_workflow', 'assignment_workflow'), 'Distributed Ram Cache': ('distributed_ram_cache_interaction_workflow',), 'Rounding Model': ('validation_workflow',), 'Component': ('validation_workflow', 'edit_workflow'), 'Configuration Save': ('edit_workflow',), 'Link': ('edit_workflow',), 'Preference': ('edit_workflow', 'preference_workflow'), 'Address': ('edit_workflow',), 'TALES Constraint': ('dynamic_class_generation_interaction_workflow',), 'Category Property': ('dynamic_class_generation_interaction_workflow',), 'Category Related Membership Arity Constraint': ('dynamic_class_generation_interaction_workflow',), 'Content Existence Constraint': ('dynamic_class_generation_interaction_workflow',), 'Notification Message': ('document_security_interaction_workflow', 'notification_message_workflow', 'processing_status_workflow', 'document_conversion_interaction_workflow', 'edit_workflow'), 'Acquired Property': ('dynamic_class_generation_interaction_workflow',), 'Property Sheet': ('dynamic_class_generation_interaction_workflow',), 'Embedded File': ('edit_workflow', 'embedded_workflow', 'document_conversion_interaction_workflow'), 'Category Membership Arity Constraint': ('dynamic_class_generation_interaction_workflow',), 'Category Related Membership State Constraint': ('dynamic_class_generation_interaction_workflow',), 'Alarm': ('edit_workflow',), 'Bank Account': ('validation_workflow', 'edit_workflow'), 'Fax': ('edit_workflow',), 'Mapped Value': ('edit_workflow',), 'Business Template': ('business_template_building_workflow', 'business_template_installation_workflow'), 'Memcached Plugin': ('memcached_plugin_interaction_workflow',), 'Attribute Blacklisted Constraint': ('dynamic_class_generation_interaction_workflow',), 'Category Existence Constraint': ('dynamic_class_generation_interaction_workflow',), 'Query': ('edit_workflow', 'query_workflow'), 'Attribute Equality Constraint': ('dynamic_class_generation_interaction_workflow',), 'Simulation Movement': ('simulation_movement_causality_interaction_workflow',), 'Person': ('validation_workflow', 'edit_workflow', 'person_interaction_workflow', 'user_account_workflow'), 'File': ('document_security_interaction_workflow', 'document_conversion_interaction_workflow', 'edit_workflow'), 'ERP5Workflow Test Object': ('dc_test_workflow',), 'Glossary Term': ('validation_workflow', 'edit_workflow'), 'Telephone': ('edit_workflow',), 'Agent': ('edit_workflow',), 'Bug': ('edit_workflow', 'bug_workflow'), 'String Attribute Match Constraint': ('dynamic_class_generation_interaction_workflow',), 'Currency': ('validation_workflow', 'edit_workflow'), 'Base Type': ('dynamic_class_generation_interaction_workflow', 'base_type_interaction_workflow'), 'Extension Component': ('edit_workflow', 'dynamic_class_generation_interaction_workflow', 'component_validation_workflow'), 'Chat Address': ('edit_workflow',), 'Credit Card': ('validation_workflow', 'edit_workflow'), 'Currency Exchange Line': ('currency_exchange_line_interaction_workflow', 'edit_workflow', 'validation_workflow'), 'Business Configuration': ('validation_workflow', 'edit_workflow', 'business_configuration_simulation_workflow'), 'Standard Property': ('dynamic_class_generation_interaction_workflow',), 'Image': ('document_security_interaction_workflow', 'document_conversion_interaction_workflow', 'edit_workflow'), 'Property Sheet Tool': ('dynamic_class_generation_interaction_workflow',)}
chains_by_type = context.getChainsByType()
# the workflow_id to repair
workflow_id_to_repair_list = ['edit_workflow', 'validation_workflow']
# repair process
for workflow_id in workflow_id_to_repair_list:
for type_id in chains_by_type:
type_ob = getattr(context.getPortalObject().portal_types, type_id, None)
if type_ob is not None:
if workflow_id in type_workflow_dict[type_id] and workflow_id not in chains_by_type[type_id]:
#raise NotImplementedError(type_id, type_workflow_dict[type_id], chains_by_type[type_id])
context.addTypeCBT(type_id, workflow_id)
if type_ob is not None:
type_ob.delTypeWorkflowList('workflow_'+workflow_id)
type_ob.delTypeWorkflowList('interactionworkflow_'+workflow_id)
......@@ -48,34 +48,6 @@
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
for ptype in context.getPortalObject().portal_types.objectValues():\n
for workflow_id in [\'interactionworkflow_testing_interaction_workflow\', \'workflow_testing_workflow\']:\n
ptype.delTypeWorkflowList(workflow_id)\n
\n
"""\n
# rapair _chains_by_type\n
type_workflow_dict = {\'Category\': (\'edit_workflow\',), \'Dynamic Category Property\': (\'dynamic_class_generation_interaction_workflow\',), \'System Preference\': (\'edit_workflow\', \'preference_workflow\'), \'Bug Line\': (\'edit_workflow\', \'bug_event_workflow\'), \'Embedded Folder\': (\'edit_workflow\', \'embedded_workflow\'), \'Test Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Base Category\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\'), \'Organisation\': (\'validation_workflow\', \'edit_workflow\'), \'Property Type Validity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Action Information\': (\'base_type_interaction_workflow\',), \'ERP5Workflow Test Document\': (\'testing_workflow\', \'testing_interaction_workflow\', \'edit_workflow\'), \'Document\': (\'edit_workflow\',), \'Email\': (\'edit_workflow\',), \'Career\': (\'career_workflow\',), \'Document Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Category Acquired Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Predicate\': (\'rule_interaction_workflow\', \'edit_workflow\'), \'Category Tool\': (\'dynamic_class_generation_interaction_workflow\',), \'Attribute Unicity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Role Definition\': (\'edit_workflow\', \'local_permission_interaction_workflow\'), \'Category Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Assignment\': (\'edit_workflow\', \'assignment_workflow\'), \'Distributed Ram Cache\': (\'distributed_ram_cache_interaction_workflow\',), \'Rounding Model\': (\'validation_workflow\',), \'Component\': (\'validation_workflow\', \'edit_workflow\'), \'Configuration Save\': (\'edit_workflow\',), \'Link\': (\'edit_workflow\',), \'Preference\': (\'edit_workflow\', \'preference_workflow\'), \'Address\': (\'edit_workflow\',), \'TALES Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Content Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Notification Message\': (\'document_security_interaction_workflow\', \'notification_message_workflow\', \'processing_status_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Acquired Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Sheet\': (\'dynamic_class_generation_interaction_workflow\',), \'Embedded File\': (\'edit_workflow\', \'embedded_workflow\', \'document_conversion_interaction_workflow\'), \'Category Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Alarm\': (\'edit_workflow\',), \'Bank Account\': (\'validation_workflow\', \'edit_workflow\'), \'Fax\': (\'edit_workflow\',), \'Mapped Value\': (\'edit_workflow\',), \'Business Template\': (\'business_template_building_workflow\', \'business_template_installation_workflow\'), \'Memcached Plugin\': (\'memcached_plugin_interaction_workflow\',), \'Attribute Blacklisted Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Query\': (\'edit_workflow\', \'query_workflow\'), \'Attribute Equality Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Simulation Movement\': (\'simulation_movement_causality_interaction_workflow\',), \'Person\': (\'validation_workflow\', \'edit_workflow\', \'person_interaction_workflow\', \'user_account_workflow\'), \'File\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'ERP5Workflow Test Object\': (\'dc_test_workflow\',), \'Glossary Term\': (\'validation_workflow\', \'edit_workflow\'), \'Telephone\': (\'edit_workflow\',), \'Agent\': (\'edit_workflow\',), \'Bug\': (\'edit_workflow\', \'bug_workflow\'), \'String Attribute Match Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Currency\': (\'validation_workflow\', \'edit_workflow\'), \'Base Type\': (\'dynamic_class_generation_interaction_workflow\', \'base_type_interaction_workflow\'), \'Extension Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Chat Address\': (\'edit_workflow\',), \'Credit Card\': (\'validation_workflow\', \'edit_workflow\'), \'Currency Exchange Line\': (\'currency_exchange_line_interaction_workflow\', \'edit_workflow\', \'validation_workflow\'), \'Business Configuration\': (\'validation_workflow\', \'edit_workflow\', \'business_configuration_simulation_workflow\'), \'Standard Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Image\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Property Sheet Tool\': (\'dynamic_class_generation_interaction_workflow\',)}\n
chains_by_type = context.getChainsByType()\n
\n
# the workflow_id to repair\n
workflow_id_to_repair_list = [\'edit_workflow\', \'validation_workflow\']\n
\n
# repair process\n
for workflow_id in workflow_id_to_repair_list:\n
for type_id in chains_by_type:\n
type_ob = getattr(context.getPortalObject().portal_types, type_id, None)\n
if type_ob is not None:\n
if workflow_id in type_workflow_dict[type_id] and workflow_id not in chains_by_type[type_id]:\n
#raise NotImplementedError(type_id, type_workflow_dict[type_id], chains_by_type[type_id])\n
context.addTypeCBT(type_id, workflow_id)\n
if type_ob is not None:\n
type_ob.delTypeWorkflowList(\'workflow_\'+workflow_id)\n
type_ob.delTypeWorkflowList(\'interactionworkflow_\'+workflow_id)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......
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