Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-workflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-workflow
Commits
f60de344
Commit
f60de344
authored
Aug 25, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosine #5599: assign_to_owner now assigns to owner of BizObject rather then WF case
parent
d38d4b97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
intranet-workflow-callbacks.sql
sql/postgresql/intranet-workflow-callbacks.sql
+10
-2
upgrade-5.1.0.0.0-5.1.0.0.1.sql
sql/postgresql/upgrade/upgrade-5.1.0.0.0-5.1.0.0.1.sql
+55
-0
No files found.
sql/postgresql/intranet-workflow-callbacks.sql
View file @
f60de344
...
...
@@ -211,7 +211,7 @@ declare
v_creation_user
integer
;
v_creation_ip
varchar
;
v_journal_id
integer
;
v_object_type
varchar
;
v_transition_key
varchar
;
v_owner_id
integer
;
v_owner_name
varchar
;
row
RECORD
;
v_owner_name
varchar
;
begin
-- Get information about the transition and the "environment"
select
t
.
case_id
,
c
.
object_id
,
o
.
creation_user
,
o
.
creation_ip
,
o
.
object_type
,
tr
.
transition_key
...
...
@@ -223,7 +223,15 @@ begin
and
t
.
workflow_key
=
tr
.
workflow_key
and
t
.
transition_key
=
tr
.
transition_key
;
select
v_creation_user
,
im_name_from_user_id
(
v_creation_user
)
into
v_owner_id
,
v_owner_name
;
IF
v_object_id
is
not
null
THEN
-- Use the real creation_user of the underlying BizObject if present
select
bizobj
.
creation_user
,
im_name_from_user_id
(
bizobj
.
creation_user
)
into
v_owner_id
,
v_owner_name
from
acs_objects
bizobj
where
bizobj
.
object_id
=
v_object_id
;
ELSE
-- Use the creation_user of the WF as a default
select
v_creation_user
,
im_name_from_user_id
(
v_creation_user
)
into
v_owner_id
,
v_owner_name
;
END
IF
;
IF
v_owner_id
is
not
null
THEN
v_journal_id
:
=
journal_entry__new
(
...
...
sql/postgresql/upgrade/upgrade-5.1.0.0.0-5.1.0.0.1.sql
0 → 100644
View file @
f60de344
-- 5.1.0.0.0-5.1.0.0.1.sql
SELECT
acs_log__debug
(
'/packages/intranet-workflow/sql/postgresql/upgrade/upgrade-5.1.0.0.0-5.1.0.0.1.sql'
,
''
);
-- ------------------------------------------------------
-- Unassigned callback that assigns the transition to the owner of the underlying object.
--
create
or
replace
function
im_workflow__assign_to_owner
(
integer
,
text
)
returns
integer
as
$$
declare
p_task_id
alias
for
$
1
;
p_custom_arg
alias
for
$
2
;
v_case_id
integer
;
v_object_id
integer
;
v_creation_user
integer
;
v_creation_ip
varchar
;
v_journal_id
integer
;
v_object_type
varchar
;
v_transition_key
varchar
;
v_owner_id
integer
;
v_owner_name
varchar
;
begin
-- Get information about the transition and the "environment"
select
t
.
case_id
,
c
.
object_id
,
o
.
creation_user
,
o
.
creation_ip
,
o
.
object_type
,
tr
.
transition_key
into
v_case_id
,
v_object_id
,
v_creation_user
,
v_creation_ip
,
v_object_type
,
v_transition_key
from
wf_tasks
t
,
wf_cases
c
,
wf_transitions
tr
,
acs_objects
o
where
t
.
task_id
=
p_task_id
and
t
.
case_id
=
c
.
case_id
and
o
.
object_id
=
t
.
case_id
and
t
.
workflow_key
=
tr
.
workflow_key
and
t
.
transition_key
=
tr
.
transition_key
;
IF
v_object_id
is
not
null
THEN
-- Use the real creation_user of the underlying BizObject if present
select
bizobj
.
creation_user
,
im_name_from_user_id
(
bizobj
.
creation_user
)
into
v_owner_id
,
v_owner_name
from
acs_objects
bizobj
where
bizobj
.
object_id
=
v_object_id
;
ELSE
-- Use the creation_user of the WF as a default
select
v_creation_user
,
im_name_from_user_id
(
v_creation_user
)
into
v_owner_id
,
v_owner_name
;
END
IF
;
IF
v_owner_id
is
not
null
THEN
v_journal_id
:
=
journal_entry__new
(
null
,
v_case_id
,
v_transition_key
||
' assign_to_owner '
||
v_owner_name
,
v_transition_key
||
' assign_to_owner '
||
v_owner_name
,
now
(),
v_creation_user
,
v_creation_ip
,
'Assigning to '
||
v_owner_name
||
', the owner of '
||
acs_object__name
(
v_object_id
)
||
'.'
);
PERFORM
workflow_case__add_task_assignment
(
p_task_id
,
v_owner_id
,
'f'
);
RAISE
NOTICE
'im_workflow__assign_to_owner: workflow_case__notify_assignee (%,%,%)'
,
p_task_id
,
v_owner_id
,
'wf_'
||
v_object_type
||
'_assignment_notif'
;
PERFORM
workflow_case__notify_assignee
(
p_task_id
,
v_owner_id
,
null
,
null
,
'wf_'
||
v_object_type
||
'_assignment_notif'
);
END
IF
;
return
0
;
end
;
$$
language
'plpgsql'
;
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