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
775bab2d
Commit
775bab2d
authored
Nov 12, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InteractionWorkflow.py: deploy property accessors as many as possible.
parent
e8215657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+14
-12
No files found.
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
775bab2d
...
...
@@ -140,14 +140,15 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
getSecurityManager
(),
self
,
ob
):
return
default
status
=
self
.
_getStatusOf
(
ob
)
default_expr
=
vdef
.
getDefaultExpr
()
if
status
is
not
None
and
name
in
status
:
value
=
status
[
name
]
# Not set yet. Use a default.
elif
vdef
.
default_expr
is
not
None
:
elif
default_expr
is
not
None
:
ec
=
createExprContext
(
StateChangeInfo
(
ob
,
self
,
status
))
value
=
Expression
(
vdef
.
default_expr
)(
ec
)
value
=
Expression
(
default_expr
)(
ec
)
else
:
value
=
vdef
.
default_value
value
=
vdef
.
getInitialValue
()
return
value
...
...
@@ -161,7 +162,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
return
tdef
is
not
None
and
self
.
_checkTransitionGuard
(
tdef
,
ob
)
def
_checkTransitionGuard
(
self
,
tdef
,
document
,
**
kw
):
if
tdef
.
temporary_document_disallowed
:
if
tdef
.
getTemporaryDocumentDisallowed
()
:
isTempDocument
=
getattr
(
document
,
'isTempDocument'
,
None
)
if
isTempDocument
is
not
None
:
if
isTempDocument
():
...
...
@@ -253,7 +254,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
for
t_id
in
transition_list
:
tdef
=
self
.
_getOb
(
'interaction_'
+
t_id
)
assert
tdef
.
trigger_type
==
TRIGGER_WORKFLOW_METHOD
assert
tdef
.
getTriggerType
()
==
TRIGGER_WORKFLOW_METHOD
filtered_transition_list
.
append
(
tdef
.
getId
())
former_status
=
{}
...
...
@@ -284,7 +285,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
for
t_id
in
transition_list
:
tdef
=
self
.
_getOb
(
'interaction_'
+
t_id
)
assert
tdef
.
trigger_type
==
TRIGGER_WORKFLOW_METHOD
assert
tdef
.
getTriggerType
()
==
TRIGGER_WORKFLOW_METHOD
former_status
=
{}
econtext
=
None
sci
=
None
...
...
@@ -296,19 +297,20 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
for
vdef
in
self
.
objectValues
(
portal_type
=
'Variable'
):
id
=
vdef
.
getId
()
if
not
vdef
.
for_status
:
if
not
vdef
.
getForStatus
()
:
continue
expr
=
None
if
id
in
tdef_exprs
:
expr
=
tdef_exprs
[
id
]
elif
not
vdef
.
update_always
and
id
in
former_status
:
elif
not
vdef
.
getAutomaticUpdate
()
and
id
in
former_status
:
# Preserve former value
value
=
former_status
[
id
]
else
:
if
vdef
.
default_expr
is
not
None
:
expr
=
vdef
.
default_expr
default_expr
=
vdef
.
getDefaultExpr
()
if
default_expr
is
not
None
:
expr
=
Expression
(
default_expr
)
else
:
value
=
vdef
.
default_value
value
=
vdef
.
getInitialValue
()
if
expr
is
not
None
:
# Evaluate an expression.
if
econtext
is
None
:
...
...
@@ -386,7 +388,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
if
action
in
sdef
.
getDestinationIdList
():
tdef
=
self
.
_getOb
(
action
,
None
)
if
(
tdef
is
not
None
and
tdef
.
trigger_type
==
TRIGGER_USER_ACTION
and
tdef
.
getTriggerType
()
==
TRIGGER_USER_ACTION
and
self
.
_checkTransitionGuard
(
tdef
,
document
,
**
kw
)):
return
1
return
0
...
...
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