I have the following issue:
I created a trigger which is activated when a row is inserted into the table.
The trigger then starts a procedure.
The procedure then starts a workflow.
When I start the procedure it works fine. But when I start the trigger by entering a new row I got the following error:
Zeile 12: ORA-20001: Task not found - Please check the Task Type, Name and Location are correct.
ORA-06512: in "OWBSYS.WB_RT_API_EXEC", Zeile 759
ORA-06512: in "OWB***.EXECUTE_WF_ABC", Zeile 10
ORA-06512: in "OWB***.START_EXECUTE_WF_ABC", Zeile 7
ORA-06512: in "OWB***.ABC_WORKFLOW", Zeile 2
This is my trigger:
create or replace
TRIGGER ABC_WORKFLOW
BEFORE INSERT
ON OWB***.STG_ABC
FOR EACH ROW
BEGIN
OWB***.EXECUTE_WF_ABC;
END ;
This is my procedure:
create or replace
PROCEDURE EXECUTE_WF_ABC
AS
status NUMBER;
-- paramlist VARCHAR2(30000 CHAR);
BEGIN
owbsys.wb_rt_script_util.set_workspace ('OWBREPOWN.OWB***');
status :=
owbsys.wb_rt_api_exec.run_task (
p_location_name => 'OWF_LOCATION',
p_task_type => 'PROCESS',
p_task_name => 'WF_ABC',
-- p_custom_params => paramlist ,
p_system_params => '',
p_oem_friendly => 0 ,
p_background => 1); -- execute in background
DBMS_OUTPUT.put_line (status);
COMMIT;
--- EXCEPTION
--- when others then
--- message;
--- null;
END;
Did I miss something here?
Thanks in advance.
if your table is the TASK table, then your trigger is firing BEFORE the row exists, so if that workflow is checking for data in the row you’re inserting then there is no wonder it’s failing.
also
COMMIT;in a trigger is really bad (and would fail if you inserted more than 1 row).