Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
ad093324
Commit
ad093324
authored
Oct 02, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testWorklist.py: add new workflow compatibility.
parent
ac8896f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
8 deletions
+35
-8
product/ERP5/tests/testWorklist.py
product/ERP5/tests/testWorklist.py
+35
-8
No files found.
product/ERP5/tests/testWorklist.py
View file @
ad093324
...
...
@@ -153,22 +153,49 @@ class TestWorklist(ERP5TypeTestCase):
self
.
_addPropertySheet
(
self
.
checked_portal_type
,
'SortIndex'
)
def
addWorkflowCataloguedVariable
(
self
,
workflow_id
,
variable_id
):
variables
=
self
.
getWorkflowTool
()[
workflow_id
].
variables
variables
.
addVariable
(
variable_id
)
assert
variables
[
variable_id
].
for_catalog
==
1
# add new workflow compatibility
workflow_value
=
self
.
getWorkflowTool
()[
workflow_id
]
if
workflow_value
.
__class__
.
__name__
==
'Workflow'
:
variable_value
=
workflow_value
.
newContent
(
id
=
'variable_'
+
variable_id
,
portal_type
=
'Variable'
)
variable_value
.
setReference
(
variable_id
)
else
:
variables
=
workflow_value
.
variables
variables
.
addVariable
(
variable_id
)
variable_value
=
variables
[
variable_id
]
assert
variable_value
.
for_catalog
==
1
def
createWorklist
(
self
,
workflow_id
,
worklist_id
,
actbox_name
,
actbox_url
=
None
,
**
kw
):
worklists
=
self
.
getWorkflowTool
()[
workflow_id
].
worklists
worklists
.
addWorklist
(
worklist_id
)
worklists
.
_getOb
(
worklist_id
).
setProperties
(
''
,
# add new workflow compatibility
workflow_value
=
self
.
getWorkflowTool
()[
workflow_id
]
if
workflow_value
.
__class__
.
__name__
==
'Workflow'
:
worklist_value
=
workflow_value
.
newContent
(
portal_type
=
'Worklist'
)
worklist_value
.
setReference
(
worklist_id
)
worklist_value
.
setProperties
(
''
,
actbox_name
=
'%s (%%(count)s)'
%
actbox_name
,
actbox_url
=
actbox_url
,
props
=
{
k
if
k
.
startswith
(
'guard_'
)
else
'variable_'
+
k
:
v
for
k
,
v
in
kw
.
iteritems
()})
worklist_value
.
updateDynamicVariable
()
else
:
worklists
=
workflow_value
.
worklists
worklists
.
addWorklist
(
worklist_id
)
worklist_value
=
worklists
.
_getOb
(
worklist_id
)
worklist_value
.
setProperties
(
''
,
actbox_name
=
'%s (%%(count)s)'
%
actbox_name
,
actbox_url
=
actbox_url
,
props
=
{
k
if
k
.
startswith
(
'guard_'
)
else
'var_match_'
+
k
:
v
for
k
,
v
in
kw
.
iteritems
()})
def
removeWorklist
(
self
,
workflow_id
,
worklist_id_list
):
worklists
=
self
.
getWorkflowTool
()[
workflow_id
].
worklists
worklists
.
deleteWorklists
(
worklist_id_list
)
# add new workflow compatibility
workflow_value
=
self
.
getWorkflowTool
()[
workflow_id
]
if
workflow_value
.
__class__
.
__name__
==
'Workflow'
:
for
worklist_id
in
worklist_id_list
:
workflow_value
.
_delObject
(
'worklist_'
+
worklist_id
)
else
:
worklists
=
self
.
getWorkflowTool
()[
workflow_id
].
worklists
worklists
.
deleteWorklists
(
worklist_id_list
)
def
createWorklists
(
self
):
for
worklist_id
,
actbox_name
,
role
,
expr
,
state
,
int_variable
in
[
...
...
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