Set a Process Flow level condition to SKIP/CANCEL PROCESS FLOW when there is a copy in the Backlog.

Document ID : KB000089551
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Set a Process Flow level condition to SKIP/CANCEL PROCESS FLOW when there is a copy in the Backlog.
Resolution:
Symptoms

How do Iset a Process Flow condition to skip running the Process Flow if a copy of thesame  Process Flow is already in thebacklog?


Cause

While theSINGLE RUN feature prevents more than 1 copy of a job from RUNNING at any giventime, it does not prevent copies of these jobs from accumulating in thebacklog. This can create a largeaccumulation of copies of this job in the backlog.


Solution

In order to prevent this from happening we can use the following setup:

1. Create a subvar called #count_copies as follows:

Type: Numbers
Login: No selection

SQL Statement:

select to_char(count(*)) from so_job_queue where so_module='{job}'

2. Set a condition on the main Process Flow level as follows:

Before User Defined
If {#count_copies} > 1
Then Cancel Process Flow.