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
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
Laurent S
erp5
Commits
eee71126
Commit
eee71126
authored
Apr 28, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transition.py: add property Reference and varable default _reference.
parent
93212158
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
product/ERP5Workflow/Document/Transition.py
product/ERP5Workflow/Document/Transition.py
+10
-15
No files found.
product/ERP5Workflow/Document/Transition.py
View file @
eee71126
...
...
@@ -50,7 +50,7 @@ TRIGGER_AUTOMATIC = 0
TRIGGER_USER_ACTION
=
1
TRIGGER_WORKFLOW_METHOD
=
2
class
Transition
(
IdAsReferenceMixin
(
'
transition_
'
),
XMLObject
):
class
Transition
(
IdAsReferenceMixin
(
'
_transition
'
),
XMLObject
):
"""
A ERP5 Transition.
"""
...
...
@@ -67,7 +67,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
actbox_icon
=
''
actbox_category
=
'workflow'
var_exprs
=
None
# A mapping.
default_reference
=
''
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
...
...
@@ -78,15 +78,10 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
PropertySheet
.
XMLObject
,
PropertySheet
.
CategoryCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
Reference
,
PropertySheet
.
Transition
,
)
def
_getObjectByRef
(
self
,
ref
):
for
ob
in
self
:
if
wf
.
getRef
()
==
ref
:
return
ob
return
None
def
getGuardSummary
(
self
):
res
=
None
if
self
.
guard
is
not
None
:
...
...
@@ -149,7 +144,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
if
state_object
==
None
:
state_object
=
workflow
.
getSourceValue
()
old_state
=
state_object
.
getId
()
### getRef
old_state
=
state_object
.
getId
()
old_sdef
=
state_object
new_state
=
self
.
getDestinationId
()
...
...
@@ -163,7 +158,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
return
former_status
=
{}
else
:
former_status
=
state_object
.
getId
()
### getRef
former_status
=
state_object
.
getId
()
try
:
new_sdef
=
self
.
getDestinationValue
()
...
...
@@ -174,7 +169,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
before_script_success
=
1
script_id
=
self
.
getBeforeScriptId
()
if
script_id
:
script
=
self
.
getParent
().
_getOb
(
script_id
)
### _getObjectByRef
script
=
self
.
getParent
().
_getOb
(
script_id
)
# Pass lots of info to the script in a single parameter.
kwargs
=
form_kw
sci
=
StateChangeInfo
(
...
...
@@ -193,7 +188,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
# Do not proceed in case of failure of before script
if
not
before_script_success
:
former_status
=
old_state
# Remain in state
tool
.
setStatusOf
(
workflow
.
getId
(),
document
,
status_dict
)
### getRef
tool
.
setStatusOf
(
workflow
.
getId
(),
document
,
status_dict
)
sci
=
StateChangeInfo
(
document
,
workflow
,
former_status
,
self
,
old_sdef
,
new_sdef
,
kwargs
)
# put the error message in the workflow history
...
...
@@ -229,7 +224,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
tdef_exprs
=
{}
for
vdef
in
workflow
.
objectValues
(
portal_type
=
'Variable'
):
id
=
vdef
.
getId
()
### getRef
id
=
vdef
.
getId
()
if
vdef
.
for_status
==
0
:
continue
expr
=
None
...
...
@@ -267,7 +262,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
status_dict
[
variable
.
getCausalityTitle
()]
=
variable
.
getInitialValue
(
object
=
object
)
# Generate Workflow History List
tool
.
setStatusOf
(
workflow
.
getId
(),
document
,
status_dict
)
### getRef
tool
.
setStatusOf
(
workflow
.
getId
(),
document
,
status_dict
)
### zwj: update Role mapping, also in Workflow, initialiseDocument()
workflow
.
updateRoleMappingsFor
(
document
)
...
...
@@ -280,7 +275,7 @@ class Transition(IdAsReferenceMixin('transition_'), XMLObject):
if
script_id
in
old_sdef
.
getDestinationIdList
():
getattr
(
workflow
,
convertToMixedCase
(
script_id
)).
execute
(
document
)
else
:
script
=
self
.
getParent
().
_getOb
(
script_id
)
### _getObjectByRef
script
=
self
.
getParent
().
_getOb
(
script_id
)
# Pass lots of info to the script in a single parameter.
if
script
.
getTypeInfo
().
getId
()
==
'Workflow Script'
:
sci
=
StateChangeInfo
(
...
...
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