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
1
Issues
1
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
Roque
erp5
Commits
9c182c7b
Commit
9c182c7b
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
5039b6f4
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 @
9c182c7b
...
@@ -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