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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
5a49fc10
Commit
5a49fc10
authored
Dec 11, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export a class_definition so that we can edit edges properties
parent
c75bb7ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/BusinessProcess_getGraph.xml
...rtal_skins/erp5_graph_editor/BusinessProcess_getGraph.xml
+19
-5
No files found.
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/BusinessProcess_getGraph.xml
View file @
5a49fc10
...
@@ -64,12 +64,12 @@ visited_business_process_set = set() # prevent infinite recurisions\n
...
@@ -64,12 +64,12 @@ visited_business_process_set = set() # prevent infinite recurisions\n
def getBusinessProcessGraph(business_process):\n
def getBusinessProcessGraph(business_process):\n
graph = dict(node=dict(start=dict(_class=\'erp5.business_process.start\',\n
graph = dict(node=dict(start=dict(_class=\'erp5.business_process.start\',\n
name=str(translateString(\'Start\'))),\n
name=str(translateString(\'Start\'))),\n
end=dict(_class=\'erp5.business_process.end\',\n
end=dict(_class=\'erp5.business_process.end\',
# XXX is there an implicit end state ???
\n
name=str(translateString(\'End\'))),),\n
name=str(translateString(\'End\'))),),\n
edge=dict())\n
edge=dict())\n
\n
\n
\n
\n
for trade_state in portal.portal_categories.trade_state.getCategoryChildValueList(): # XXX
all
\n
for trade_state in portal.portal_categories.trade_state.getCategoryChildValueList(): # XXX
do we really want to display all trade states ?
\n
state_id = trade_state.getReference() or trade_state.getId()\n
state_id = trade_state.getReference() or trade_state.getId()\n
graph[\'node\'][state_id] = dict(\n
graph[\'node\'][state_id] = dict(\n
_class=\'erp5.business_process.trade_state\',\n
_class=\'erp5.business_process.trade_state\',\n
...
@@ -97,7 +97,7 @@ def getBusinessProcessGraph(business_process):\n
...
@@ -97,7 +97,7 @@ def getBusinessProcessGraph(business_process):\n
destination=successor,\n
destination=successor,\n
name=link.getTranslatedTitle(),\n
name=link.getTranslatedTitle(),\n
business_link_url=link.getRelativeUrl(),\n
business_link_url=link.getRelativeUrl(),\n
trade_phase=link.getTradePhase())\n
trade_phase=link.getTradePhase()
or \'\'
)\n
\n
\n
for specialise in [context] + business_process.getSpecialiseValueList(portal_type=\'Business Process\'):\n
for specialise in [context] + business_process.getSpecialiseValueList(portal_type=\'Business Process\'):\n
specialise_graph = getBusinessProcessGraph(specialise)\n
specialise_graph = getBusinessProcessGraph(specialise)\n
...
@@ -106,8 +106,22 @@ def getBusinessProcessGraph(business_process):\n
...
@@ -106,8 +106,22 @@ def getBusinessProcessGraph(business_process):\n
for node_id, node_data in specialise_graph[\'edge\'].items():\n
for node_id, node_data in specialise_graph[\'edge\'].items():\n
graph[\'edge\'].setdefault(node_id, node_data)\n
graph[\'edge\'].setdefault(node_id, node_data)\n
return graph\n
return graph\n
\n
\n
return json.dumps(dict(graph=getBusinessProcessGraph(context), class_definition=[]), indent=2)\n
\n
class_definition = {\n
\'erp5.business_process.business_link\': {\n
\'_class\': \'edge\',\n
\'type\': \'object\',\n
\'description\': \'An ERP5 Business Link\',\n
\'properties\': {\n
\'name\': {\'type\': \'string\'}, \n
\'trade_phase\': {\'type\': \'string\', \'enum\': [\'\'] + [\n
trade_phase.getId() for trade_phase in portal.portal_categories.trade_phase.getCategoryChildValueList(local_sort_on=(\'int_index\', \'title\'))]}, \n
}\n
}\n
}\n
\n
return json.dumps(dict(graph=getBusinessProcessGraph(context), class_definition=class_definition), indent=2)\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