Automic Workload Automation

 View Only
  • 1.  AWI -- Cancel created workflow

    Posted Nov 30, 2022 02:00 PM

    My current setup looks like this:
    where Watch_Job is a workflow that will run after a given time. I am stumped as to how I can communicate with the workflow to cancel it after a condition is met. I have tried ":SET &ACTOBJ# = ACTIVATE_UC_OBJECT(&WATCH_JOB#,,"DD.MM.YY:01.12.00") " to set the start time after a specific point, and I have tried to get the runId through various ways, however, none match the runId shown in the executions list. 

    My question is, is there a better way to activate the workflow while also being able to cancel it down the line? Is there something else that I could do?

    Thanks.


  • 2.  RE: AWI -- Cancel created workflow

    Posted Nov 30, 2022 04:17 PM
    So you're saying that &RET# (or &ACTJOB#) isn't properly obtaining the RunID of &WATCH_JOB# for you?


  • 3.  RE: AWI -- Cancel created workflow

    Posted Dec 02, 2022 02:21 PM
    One way i would do is get the run ID and pass it to the plan you are submitting
    :PSET &PID# = SYS_ACT_PARENT_NR()
    :SET &CHECK# = ACTIVATE_UC_OBJECT(&WATCH_JOB#,,,,,PASS_VALUES)

    and in the plan where you want ot cancel/terminate you put the below command which will cancel the run ID

    :SET &STATUS# = CANCEL_UC_OBJECT(&PID#, "ENDED_OK")

    There might be other ways, this is how i have used in my process