Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Levin Zimmermann
erp5
Commits
f9510780
Commit
f9510780
authored
Dec 11, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit business link documents from the graph data
parent
ebb30221
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
bt5/erp5_graph_editor/WorkflowTemplateItem/portal_workflow/business_process_graph_editor_interaction_workflow/scripts/afterEdit.xml
...s_graph_editor_interaction_workflow/scripts/afterEdit.xml
+11
-5
No files found.
bt5/erp5_graph_editor/WorkflowTemplateItem/portal_workflow/business_process_graph_editor_interaction_workflow/scripts/afterEdit.xml
View file @
f9510780
...
...
@@ -56,22 +56,28 @@ graph = business_process.getProperty(\'jsplumb_graph\')\n
\n
\n
if graph:\n
portal = business_process.getPortalObject()\n
trade_state_dict = dict(start=None, end=None)\n
for trade_state in
business_process.getPortalObject()
.portal_categories.trade_state.getCategoryChildValueList():\n
for trade_state in
portal
.portal_categories.trade_state.getCategoryChildValueList():\n
# XXX I hope no duplicates\n
trade_state_dict[trade_state.getReference() or trade_state.getId()] = trade_state\n
\n
graph = json.loads(graph)[\'graph\']\n
\n
for edge_data in graph[\'edge\'].values():\n
# Create the business link if it does not exist yet.\n
if not edge_data.get(\'business_link_url\'):\n
business_process.newContent(\n
business_
link = business_
process.newContent(\n
portal_type=\'Business Link\',\n
predecessor_value=trade_state_dict[edge_data[\'source\']],\n
successor_value=trade_state_dict[edge_data[\'destination\']],\n
)\n
else:\n
# XXX Zope does not like to traverse unicode ...\n
business_link = portal.restrictedTraverse(str(edge_data[\'business_link_url\']))\n
business_link.edit(\n
title=edge_data.get(\'name\'),\n
trade_phase=edge_data.get(\'trade_phase\'),\n
# XXX Zope does not like to traverse unicode ...\n
trade_phase=str(edge_data.get(\'trade_phase\', \'\')),\n
)\n
</string>
</value>
</item>
...
...
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