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
Leo Le Bouter
erp5
Commits
9f6ecc2e
Commit
9f6ecc2e
authored
Dec 05, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create business links when some connections are added in the graph editor
parent
4ddc5d73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
bt5/erp5_graph_editor/WorkflowTemplateItem/portal_workflow/business_process_graph_editor_interaction_workflow/scripts/afterEdit.xml
...s_graph_editor_interaction_workflow/scripts/afterEdit.xml
+24
-4
No files found.
bt5/erp5_graph_editor/WorkflowTemplateItem/portal_workflow/business_process_graph_editor_interaction_workflow/scripts/afterEdit.xml
View file @
9f6ecc2e
...
@@ -51,11 +51,31 @@
...
@@ -51,11 +51,31 @@
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
import json\n
<value>
<string>
import json\n
graph = sci[\'object\'].getProperty(\'jsplumb_graph\')\n
business_process = sci[\'object\']\n
graph = business_process.getProperty(\'jsplumb_graph\')\n
\n
\n
#if graph:\n
trade_state_dict = dict(start=None, end=None)\n
# graph = json.loads(graph)\n
for trade_state in business_process.getPortalObject().portal_categories.trade_state.getCategoryChildValueList():\n
context.log(graph)\n
# XXX I hope no duplicates\n
trade_state_dict[trade_state.getReference() or trade_state.getId()] = trade_state\n
\n
from pprint import pformat\n
\n
if graph:\n
graph = json.loads(graph)[\'graph\']\n
\n
for edge_id, edge_data in graph[\'edge\'].items():\n
# Create the business link if it does not exist yet.\n
if not edge_data.get(\'business_process_relative_url\'):\n
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
title=edge_data.get(\'name\'),\n
trade_phase=edge_data.get(\'trade_phase\'),\n
)\n
\n
if not graph: bam\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<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