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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
f3ca30fe
Commit
f3ca30fe
authored
Dec 12, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Base.py:Add early version(concept) of isWorkflow5MethodSupported.
parent
cf598640
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+11
-6
No files found.
product/ERP5Type/Base.py
View file @
f3ca30fe
...
...
@@ -201,22 +201,27 @@ class WorkflowMethod(Method):
#=============== Workflow5 Project, Wenjie, Dec 2014 =====================
### Access the ERP5Type workflow_list
if
instance
.
getTypeInfo
().
getTypeWorkflowList
()
!=
[]:
wf5_module
=
instance
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"Workflow"
)
### Build the list of method which is call and will be invoked.
valid_transition_item_list
=
[]
for
wf_id
,
transition_list
in
candidate_transition_item_list
:
valid_list
=
[]
for
transition_id
in
transition_list
:
### early version of isWorkflow5Supported()
if
wf5_module
.
_getOb
(
wf_id
).
_getOb
(
transition_id
)
in
instance
.
getCategoryStateValue
().
getDestinationValueList
():
valid_list
.
append
(
transition_id
)
once_transition_key
=
once_transition_dict
.
get
((
wf_id
,
transition_id
))
transactional_variable
[
once_transition_key
]
=
1
else
:
raise
UnsupportedWorkflowMethod
(
instance
,
wf_id
,
transition_id
)
if
valid_list
:
valid_transition_item_list
.
append
((
wf_id
,
valid_list
))
### Execute method
for
wf_id
,
transition_list
in
valid_transition_item_list
:
for
tr
in
transition_list
:
#raise NotImplementedError (tr)
method5
=
instance
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"Workflow"
)
.
_getOb
(
wf_id
).
_getOb
(
tr
)
method5
=
wf5_module
.
_getOb
(
wf_id
).
_getOb
(
tr
)
method5
.
execute
(
instance
)
#=================================== wf5 =================================
...
...
@@ -533,7 +538,7 @@ def intializePortalTypeERP5WorkflowMethod(ptype_klass, portal_workflow5):
for
workflow5
in
pt
.
workflow_list
:
for
tr
in
wf5_module
.
_getOb
(
workflow5
).
objectValues
(
portal_type
=
"Transition"
):
tr_id
=
tr
.
id
method_id
=
tr_id
method_id
=
convertToMixedCase
(
tr_id
)
wf_id
=
workflow5
ptype_klass
.
registerWorkflowMethod
(
method_id
,
wf_id
,
tr_id
,
0
)
#ptype_klass.security.declareProtected(Permissions.AccessContentsInformation,
...
...
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