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
Hamza
erp5
Commits
4a6b0cff
Commit
4a6b0cff
authored
Jun 09, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkflowTool.py: add script prefix and separate transition/script condictions in conversion.
parent
cb868732
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
product/ERP5/Tool/WorkflowTool.py
product/ERP5/Tool/WorkflowTool.py
+33
-7
No files found.
product/ERP5/Tool/WorkflowTool.py
View file @
4a6b0cff
...
@@ -322,8 +322,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -322,8 +322,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
transition
.
setActboxIcon
(
tdef
.
actbox_icon
)
transition
.
setActboxIcon
(
tdef
.
actbox_icon
)
transition
.
setActboxName
(
tdef
.
actbox_name
)
transition
.
setActboxName
(
tdef
.
actbox_name
)
transition
.
setActboxUrl
(
tdef
.
actbox_url
)
transition
.
setActboxUrl
(
tdef
.
actbox_url
)
transition
.
setAfterScriptId
(
tdef
.
after_script_name
)
if
tdef
.
after_script_name
is
not
None
:
transition
.
setBeforeScriptId
(
tdef
.
script_name
)
# check after script is a Transion or a Script:
if
tdef
.
after_script_name
in
dc_workflow
.
transitions
.
objectIds
():
transition
.
setAfterScriptId
(
'transition_'
+
tdef
.
after_script_name
)
else
:
transition
.
setAfterScriptId
(
'script_'
+
tdef
.
after_script_name
)
if
tdef
.
script_name
is
not
None
:
# check after script is a Transion or a Script:
if
tdef
.
script_name
in
dc_workflow
.
transitions
.
objectIds
():
transition
.
setAfterScriptId
(
'transition_'
+
tdef
.
script_name
)
else
:
transition
.
setAfterScriptId
(
'script_'
+
tdef
.
script_name
)
transition
.
guard
=
tdef
.
guard
transition
.
guard
=
tdef
.
guard
# create states (portal_type = State)
# create states (portal_type = State)
for
sid
in
dc_workflow
.
states
:
for
sid
in
dc_workflow
.
states
:
...
@@ -397,10 +407,26 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -397,10 +407,26 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
LOG
(
"2.4 Convert interaction '%s' of workflow '%s'"
%
(
tdef
.
id
,
workflow
.
getTitle
()),
WARNING
,
' in WorkflowTool.py'
)
LOG
(
"2.4 Convert interaction '%s' of workflow '%s'"
%
(
tdef
.
id
,
workflow
.
getTitle
()),
WARNING
,
' in WorkflowTool.py'
)
interaction
.
edit
(
title
=
tdef
.
title
)
interaction
.
edit
(
title
=
tdef
.
title
)
interaction
.
setReference
(
tdef
.
id
)
interaction
.
setReference
(
tdef
.
id
)
interaction
.
setActivateScriptName
(
tdef
.
activate_script_name
)
if
tdef
.
activate_script_name
is
not
None
:
interaction
.
setAfterScriptName
(
tdef
.
after_script_name
)
if
tdef
.
activate_script_name
in
dc_workflow
.
interactions
.
objectIds
():
interaction
.
setBeforeCommitScriptName
(
tdef
.
before_commit_script_name
)
interaction
.
setActivateScriptName
(
'interaction_'
+
tdef
.
activate_script_name
)
interaction
.
setBeforeScriptName
(
tdef
.
script_name
)
else
:
interaction
.
setActivateScriptName
(
'script_'
+
tdef
.
activate_script_name
)
if
tdef
.
after_script_name
is
not
None
:
if
tdef
.
after_script_name
in
tdef
.
interactions
.
objectIds
():
interaction
.
setAfterScriptName
(
'interaction_'
+
tdef
.
after_script_name
)
else
:
interaction
.
setAfterScriptName
(
'script_'
+
tdef
.
after_script_name
)
if
tdef
.
before_commit_script_name
is
not
None
:
if
tdef
.
before_commit_script_name
in
tdef
.
interactions
.
objectIds
():
interaction
.
setBeforeCommitScriptName
(
'interaction_'
+
tdef
.
before_commit_script_name
)
else
:
interaction
.
setBeforeCommitScriptName
(
'script_'
+
tdef
.
before_commit_script_name
)
if
tdef
.
script_name
is
not
None
:
if
tdef
.
script_name
in
tdef
.
interactions
.
objectIds
():
interaction
.
setBeforeScriptName
(
'interaction_'
+
tdef
.
script_name
)
else
:
interaction
.
setBeforeScriptName
(
'script_'
+
tdef
.
script_name
)
interaction
.
guard
=
tdef
.
guard
interaction
.
guard
=
tdef
.
guard
interaction
.
setPortalTypeFilter
(
tdef
.
portal_type_filter
)
interaction
.
setPortalTypeFilter
(
tdef
.
portal_type_filter
)
interaction
.
setPortalTypeGroupFilter
(
tdef
.
portal_type_group_filter
)
interaction
.
setPortalTypeGroupFilter
(
tdef
.
portal_type_group_filter
)
...
@@ -413,7 +439,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -413,7 +439,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# create scripts (portal_type = Workflow Script)
# create scripts (portal_type = Workflow Script)
for
script_id
in
dc_workflow
.
scripts
:
for
script_id
in
dc_workflow
.
scripts
:
script
=
dc_workflow
.
scripts
.
get
(
script_id
)
script
=
dc_workflow
.
scripts
.
get
(
script_id
)
workflow_script
=
workflow
.
newContent
(
id
=
script_id
,
portal_type
=
'Workflow Script'
,
temp_object
=
temp
)
workflow_script
=
workflow
.
newContent
(
id
=
'script_'
+
script_id
,
portal_type
=
'Workflow Script'
,
temp_object
=
temp
)
LOG
(
"2.5 Convert workflow script '%s' of workflow '%s'"
%
(
workflow_script
.
id
,
workflow
.
getTitle
()),
WARNING
,
' in WorkflowTool.py'
)
LOG
(
"2.5 Convert workflow script '%s' of workflow '%s'"
%
(
workflow_script
.
id
,
workflow
.
getTitle
()),
WARNING
,
' in WorkflowTool.py'
)
workflow_script
.
edit
(
title
=
script
.
title
)
workflow_script
.
edit
(
title
=
script
.
title
)
workflow_script
.
setParameterSignature
(
script
.
_params
)
workflow_script
.
setParameterSignature
(
script
.
_params
)
...
...
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