Automic Workload Automation

 View Only
  • 1.  How to start Another UC4 JOB UC4 From PLSQL Code Block?

    Posted Feb 06, 2020 06:39 AM
    Hello,
    I want to start another UC4 job in PLSQL code block but I do not know how to do that. I would like to explain myselft with example script.

    SQL_SET_STATEMENT_TERMINATOR TERM='@';
    DECLARE
    plsqlVaraible NUMBER(1) := 1';

    BEGIN 

    IF plsqlVaraible  = 1 THEN
    :SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBS.ANOTHER_EXAMPLE_JOB)
    END IF;

    END;@


    I can not start another job from plsql code block. How can i do that? I have to start from inside of plsql code, this is must. Can you help me about that?

    Thanks.


  • 2.  RE: How to start Another UC4 JOB UC4 From PLSQL Code Block?

    Posted Feb 06, 2020 12:25 PM
    Edited by Pete Wirfs Feb 06, 2020 12:39 PM
    We've done this (Kick a UC4 job from Oracle), but it wasn't easy.  We deployed our solution back in 2012 and its still working fine today.

    We have legacy Oracle apps that write job requests to the Appworx table JOB_QUEUE to kick off batch executions.  When we replaced Appworx with UC4, we created our own JOB_QUEUE table with a trigger that kicks off the request in UC4, so none of these applications required any modifications.  The way we accomplished this is we built a homegrown webapp that uses the Windows CALLAPI to communicate with UC4.  The Oracle trigger does a SOAP call to this webapp.

    A major flaw of this solution is that if your unit of work needs to rollback, there is no way to rollback the CALLAPI request.

    Now UC4 supports RESP API calls that I suspect could solve this problem more gracefully(?)

    ------------------------------
    Pete
    ------------------------------



  • 3.  RE: How to start Another UC4 JOB UC4 From PLSQL Code Block?
    Best Answer

    Posted Feb 06, 2020 12:34 PM
    If you are running your PLSQL in a UC4 job, you could have it write a message to the report when it needs to run that other task, then a post-process script would detect that message with a PREP_PROCESS_REPORT() process and then execute the ACTIVATE_UC_OBJECT() function.

    ------------------------------
    Pete
    ------------------------------