Event Based Chain Step?

For a couple days now I've been trying to come up with a working example of a Job Chain w/ an Inline Event for a Chain Step.
Would anyone happen to have a fairly simple example of this, or be able to point me in the right direction?
Thanks,
James

Hi James,
An inline event in a chain allows the chain to wait until an event is received before continuing with one or more branches of the chain. The way this works is that one of the chain steps is an event step which does nothing but wait for an event and completes successfully as soon as that event is received.
In a database events are represented by AQ messages to the chain event step waits until a message is received into a certain queue. Here is a simple complete example with comments. First step1 runs, then step 2 waits for an event . After the message is received, the final step3 runs and the chain completes. If you have any more questions, please reply.
Hope this helps,
Ravi.
-- ================= simple complete chain with event step example ==============
-- grant necessary privileges to scott
grant create job to scott ;
grant execute on dbms_aq to scott;
grant execute on dbms_aqadm to scott;
begin
dbms_rule_adm.grant_system_privilege
(dbms_rule_adm.CREATE_EVALUATION_CONTEXT_OBJ, 'scott', FALSE);
dbms_rule_adm.grant_system_privilege
(dbms_rule_adm.CREATE_RULE_SET_OBJ, 'scott', FALSE);
dbms_rule_adm.grant_system_privilege
(dbms_rule_adm.CREATE_RULE_OBJ, 'scott', FALSE);
end ;
connect scott/tiger
-- setup a multiple consumers queue for event messages
create or replace type msg_type as object ( col1 varchar2(20) ) ;
begin
dbms_aqadm.create_queue_table('qt1','msg_type',multiple_consumers => TRUE);
dbms_aqadm.create_queue ( queue_name => 'Q1', queue_table => 'QT1');
dbms_aqadm.start_queue ( queue_name => 'Q1' ) ;
end ;
-- create a scheduler program and chain
exec dbms_scheduler.create_program('prog1','plsql_block','null;',0,true);
begin
dbms_scheduler.create_chain('chain1');
dbms_scheduler.define_chain_step('chain1','step1','prog1');
dbms_scheduler.define_chain_event_step('chain1','step2',
'tab.user_data.col1 is not null', 'Q1');
dbms_scheduler.define_chain_step('chain1','step3','prog1');
dbms_scheduler.define_chain_rule('chain1','true','START step1');
dbms_scheduler.define_chain_rule('chain1','step1 completed', 'start step2');
dbms_scheduler.define_chain_rule('chain1','step2 completed','start step3');
dbms_scheduler.define_chain_rule('chain1','step3 completed','end');
dbms_scheduler.enable('chain1');
end;
-- now create the master chain job, and enable it so it runs immediately
exec dbms_scheduler.create_job('job1','chain','chain1',0,enabled=>true);
-- wait a second or two to let first step complete
select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
-- observe that only first step has completed
-- now enqueue message to complete second step
declare
msg msg_type;
my_msgid RAW(16);
props dbms_aq.message_properties_t;
enqopts dbms_aq.enqueue_options_t;
begin
msg := msg_type('test');
dbms_aq.enqueue('q1', enqopts, props, msg, my_msgid);
end;
commit;
-- now check that chain has completed successfully
select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
-- ======= end of complete inline event step example

Similar Messages

  • Execute process chain step based on value in a custom table

    HI,
    I have a requirement where i need to execute a process chain step based in the value of a field in a custom table.
    e.g. If ztable-zflag = 'X' then execute next step else stop.
    I am trying to use the decision between multiple alternatives process type, but i guess we can only use formulas in it.
    Also, i created a custom method and called it through the badi RSAR_CONNECTOR, but the same isnt working as expected.
    Would appreciate inputs from the experts.

    Hi,
    Thank you for your response.
    I followed exactly what is written in the document. But when I execute the process chain with the Decision between Multiple Alternatives process type, it fails with an exception message.
    Below is what I have done:
    Below is the code that I entered in the method (Please note that ZPC_CONTROL is the table from which I need to check the value. This table contains 2 fields: Process Chain Name and Flag. My requirement is that when a particular process chain has the flag checked, then the process chain should move ahead):
    Below is the GET method:
    Finally, here is the formula that I have written in the Decision Between Multiple Alternatives process type:
    And the event is Option 2 (which I assume will move the process chain forward if the flag is checked for the process chain ‘TEMP_TEST’)
    Please note that the flag for process chain ‘TEMP_TEST’ is checked in the table ZPC_CONTROL.
    Below is the error in the process chain:
    Please let me know where am I going wrong here. Appreciate your help.

  • How to create event based process chains

    Hi All,
    I would like to know about event based process chains. In connection to this, could you please answer the following queries,
    1. How to create events
    2. How to link created event to the process chain in the same BI or BW system and as well as from  
        externel BI system.
    3. How link one process chain with other process chain (i.e, After completion of one process chain, it
        should trigger other dependent process chain)
    Thanks and Regards,
    Kotesh.

    1). Doubt regarding first question.
    For example, i would like to create time based event (it should be trigger daily at specified time),
    where we have to maintain scheduling options while creating event.
    When i checked SM62 there i found only two options a). Event name and b). Description.
    Could please send any doucument link if you have.
    Ans : You can use function modules like "BP_EVENT_RAISE" in a program and schedule the program to trigger.
    2). For externel BIW system also same procedure we need to follow or any difference.
    Ans : Externally you need to trigger the same event.
    3). i found dependent process chain also had scheduling options as direct scheduling insted of start using meta chain or API. As you said dependent process chain should be mata chain. it seems dependent process chain may be Meta chain or Direct scheduilg.
    Ans : Its your choice how you want to schedule it.You can either make that dependent chain a metachain or schedule it separately.
    I found at the end of first process chain they kept one process like Raise event and second process chain connected with the help of raise event process event name. If you have any idea about this process could explain a bit more.
    Ans : May be they are raising the event in the main chain and triggering the dependent chain using this event.
    But Metachain is preferred for such thing.Though it does similar thing.
    Hope this helps.

  • Missing chain step name in events raised by the scheduler

    I use events raised by the scheduler (SYS.SCHEDULER$_EVENT_QUEUE) to monitor scheduler chains processing.
    For event_type = "JOB_STARTED" (chain step started in case of chains) in event message (sys.scheduler$_event_info) there is no log_id (log_id is null).
    In user_scheduler_job_log view there is column job_subname that contains chain step name but this column is missing in the event message.
    Is there any way to get chain step name for event_type = "JOB_STARTED"?
    Job configuration:
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'logging_level',
    value => dbms_scheduler.logging_full
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'raise_events',
    value => dbms_scheduler.job_all_events
    Database:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    OS:
    CentOS - redhat-4
    Regards
    Mariusz

    I want to track chain processing by dequeue messages from SCHEDULER$_EVENT_QUEUE.
    Examples of messages automatically inserted by scheduler into SCHEDULER$_EVENT_QUEUE (user_data column from SCHEDULER$_EVENT_QTAB)
    SYS.SCHEDULER$_EVENT_INFO('JOB_SUCCEEDED','CDWMAIN','JOB_NAME','2011-07-27 16:19:11.191969',0,NULL,0,340374,1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_STARTED','CDWMAIN','JOB_NAME','2011-07-27 16:19:10.947994',0,NULL,1,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_CHAIN_STALLED','CDWMAIN','JOB_NAME','2011-07-27 15:45:13.727127',0,NULL,0,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    For event JOB_SUCCEEDED there is log_id = 340374 so we can find job_subname (chain step name) in log table.
    For JOB_STARTED and JOB_CHAIN_STALLED there is no log_id so we do not know wich chain step in this case was started and wich chain was stalled.
    JOB_NAME is the same for all steps in case of chain processing

  • Event based Process chain issue

    Hi,
    I have a PC which is event triggered through a program. when i'm trying to run it i'm getting following msg
    "Process chain is not responding to the event trigger."
    Can someone help me in fixing it and triggering thr PC ?

    Hi,
    Refer the nice article from SDN and verify if you have followed the process to write the event based PC.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0a41bc6-a7f6-2b10-b3bf-804e1c45ae6c
    Regards
    Dinesh
    Edited by: Jason Lax on May 16, 2011 8:27 PM - Added preferred URL

  • Scheduler - Event Based Jobs

    Hi,
    I've been trying to create an event based job dependent on multiple jobs. I tried queuing, but it seems like it can only hand one Job at a time. Also, chains were recommended to me, but I want the Job to run on the dependence on the Job that ran on specific program at the specific time. I currently know that chains can only handle, programs, other chains and/or events.
    In my mind chains wouldn't work, because If I wanted to run Job3 dependent on the outcome of Job1 running Program1 and Job2 running Program2, chains wouldn't be able to accomdate that. For it to happen in chains I would have to attach Program1 and Program2 to the new chain Job and that is not exactly what I would want.
    Can anyone help/clarify this situation for me. Thank you.
    Tony

    Hi Tony,
    So the requirement is to run a job after 2 prior jobs have completed.
    There are two ways I can think of to do this, both using events. In both cases you need to set job A and job B to raise events on completion (succeeded, failed or stopped) and setup an agent for the Scheduler event queue in the schema in which you are working
    dbms_scheduler.add_event_queue_subscriber('myagent')
    In order to get Job C to start after jobs A and B have completed there are 2 options.
    1) Let job C point to a chain and start running whenever job A has completed. The chain will have 2 steps, one event step waiting on B and one that runs your task C. An event step does nothing but wait for a particular event and complete successfully when the event is received. The second step will run when the event step waiting on job B has completed.
    So your chain would look something like
    begin
    dbms_scheduler.create_chain('chain1');
    dbms_scheduler.define_chain_event_step('chain1','stepB',
    'tab.user_data.object_name = ''JOB_B'' and
    tab.user_data.event_type IN(''JOB_SUCCEEDED'',''JOB_FAILED'',''JOB_STOPPED''',
    'sys.scheduler$_event_queue,myagent');
    dbms_scheduler.define_chain_step('chain1','stepC','finalTaskProg');
    dbms_scheduler.define_chain_rule('chain1','true','start stepB');
    dbms_scheduler.define_chain_rule('chain1', 'stepB completed', 'start stepC');
    dbms_scheduler.define_chain_rule('chain1', 'stepC completed', 'end');
    dbms_scheduler.enable('chain1');
    end;
    And your job would point to the chain and run whenever job_A completes (similar condition and queue_spec). It would keep waiting till job_B runs and then the final task would run and it would complete.
    2) The second way is to require job_A to insert a row into a table somewhere. Rule conditions can access table data so you could have job_C have an event condition which checks for a completion event for job_B and checks the table to see whether job_A has completed. Then the code you run should then remove the row in the table
    e.g.
    queue_spec=>'sys.scheduler$_event_queue,myagent'
    event_condition=>'tab.user_data.object_name = ''JOB_B'' and
    tab.user_data.event_type IN(''JOB_SUCCEEDED'',''JOB_FAILED'',''JOB_STOPPED''' and
    (select count(*) from mytab where col='job_A')>0'
    Then when running C do - delete from mytab where col='job_a';
    Both of these assume that job_A always completes before job_B but both of these will then run job_C after job_B completes. Modifying either of these so that either job A or B runs first is also possible by having another job that waits on A rather than B.
    Hope this helps, if you have any more questions, let me know.
    -Ravi

  • Process chain step by step documentation

    Hi friends,
    I am looking step by step documentation for process chains,please  send me documents.
    thanks for advace
    bye
    habeeb
    [email protected]

    Hi Habeeb,
    look at www.service.sap.com/bi --> SAP BW old release --> BI Infoindex --> P: you will find 5 documents on Process Chains.
    Go through this help documents and downloads.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/content.htm
    SAP help Creating process chains..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    ..http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    Process Chains
    Steps for Creating Process chain!
    http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/sap-teched-03/using%20process%20chains%20in%20sap%20business%20information%20warehouse
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    and also check this.
    http://help.sap.com/saphelp_nw04s/helpdata/en/58/9c6c4251e4c153e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/60c800738d311de10000000a155369/content.htm
    /people/sap.user72/blog/2005/12/27/the-new-sap-netweaver-job-scheduler-a-redwood-oem-tool
    http://help.sap.com/saphelp_nw2004s/helpdata/en/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    ***Pls assign the points , if info is useful**
    Regards
    CSM Reddy

  • Scheduled Chained Steps

    I've been trying to create a Scheduler Chain in Oracle 11.2 to kick off steps based off of a schedule.  Below is an example script I used to attempt this, what I would like is Step1 to execute with the start of the chain, then Step2 to execute on a schedule, then Step3 to execute once Step1 and Step2 are complete.  This is for a nightly process where Step1 would execute at midnight, then Step2 would execute at 1AM.  The step I'm having issues with is defining the start of Step2 is at line 134.
    I also couldn't find an example of using DBMS_SCHEDULER.DEFINE_CHAIN_EVENT_STEP using the event_schedule_name overload, so if anyone has come across one please share.
    /* CREATE TABLE */
    Create table chain_table
        chain_ts timestamp default current_timestamp,
        chain_step varchar2(100)
    /* CREATE PROCEDURE */
    create procedure chain_test_proc
        step_name in varchar2
    ) as
    begin
        execute immediate 'insert into chain_table (chain_step) values (:1)'
        using step_name;
        commit;
    end chain_test_proc;
    /* CREATE SCHEDULE */
    begin
        dbms_scheduler.create_schedule
            repeat_interval  => 'FREQ=MINUTELY;',   
            start_date => to_timestamp_tz('2014-03-17 12:14:00.000000000 AMERICA/CHICAGO','YYYY-MM-DD HH24:MI:SS.FF TZR'),
            comments => 'Runs minutely for testing',
            schedule_name  => '"STEP2_SCHEDULE"');
    end;
    /* CREATE PROGRAMS */
    begin
        dbms_scheduler.create_program
            program_name => 'STEP1_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP1_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP1',
            out_argument => false
        dbms_scheduler.create_program
            program_name => 'STEP2_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP2_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP2',
            out_argument => false
        dbms_scheduler.create_program
            program_name => 'STEP3_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP3_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP3',
            out_argument => false
        dbms_scheduler.enable ('STEP1_PROGRAM');
        dbms_scheduler.enable ('STEP2_PROGRAM');
        dbms_scheduler.enable ('STEP3_PROGRAM');
    end;
    begin
    /* CREATE CHAIN */
        sys.dbms_scheduler.create_chain
            chain_name          => 'MY_CHAIN',
            rule_set_name       => null,
            evaluation_interval => null,
            comments            => null
    /* CREATE CHAIN STEPS */
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP1_PROG',
            program_name        => 'STEP1_PROGRAM'
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP2_PROG',
            program_name        => 'STEP2_PROGRAM'
        sys.dbms_scheduler.define_chain_event_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP2_SCHED',
            event_schedule_name => 'STEP2_START_SCHEDULE'
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP3_PROG',
            program_name        => 'STEP3_PROGRAM'
    /* CREATE CHAIN RULES */
        -- Start of Chain
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'TRUE',
            action              => 'START STEP1_PROG',
            rule_name           => 'STEP1',
            comments            => null
        -- Step having issues with
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP2_SCHED COMPLETED',
            action              => 'START STEP2_PROG',
            rule_name           => 'STEP2',
            comments            => 'Runs on a schedule'
        -- Last step
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP1_PROG COMPLETED AND STEP2_PROG COMPLETED',
            action              => 'START STEP3_PROG',
            rule_name           => 'STEP3',
            comments            => null
        -- End Chain
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP3_PROG COMPLETED',
            action              => 'END',
            rule_name           => 'END_CHAIN',
            comments            => null
    /* ENABLE CHAIN */
        dbms_scheduler.enable (name => 'MY_CHAIN');
    end;
    /* RUN CHAIN */
    -- exec dbms_scheduler.run_chain (chain_name => 'MY_CHAIN', start_steps => null, job_name => null);
    /* ROLLBACK
        -- Drop Chain
        exec dbms_scheduler.drop_chain ('MY_CHAIN');
        -- Drop Programs
        exec dbms_scheduler.drop_program ('STEP1_PROGRAM, STEP2_PROGRAM, STEP3_PROGRAM');
        -- Drop Schedule
        exec dbms_scheduler.drop_schedule ('STEP2_SCHEDULE');
        -- Drop table
        drop table chain_table;
        -- Drop procedure
        drop procedure chain_test_proc;

    Hi,
    Another possible workaround I thought about: play with the PAUSE attribute of the chain.
    When your chain starts, alter it inside program1 to pause Step2:
    DBMS_SCHEDULER.ALTER_CHAIN(chain_name =>'MY_CHAIN',
                               step_name  => 'STEP2_PROG',
                               attribute  => 'PAUSE',
                               value      => TRUE
    Create an independant scheduler job to alter the PAUSE attribute of the chain:
    DBMS_SCHEDULER.CREATE_JOB(job_name       => 'ALTER_MY_CHAIN_JOB',
                              job_type       => 'PLSQL_BLOCK',
                              job_action     => 'BEGIN
                                                      DBMS_SCHEDULER.ALTER_CHAIN(chain_name =>''MY_CHAIN'',
                                                                                 step_name  => ''STEP2_PROG'',
                                                                                 attribute  => ''PAUSE'',
                                                                                 value      => FALSE
                                                 END;',
                              repeat_interval => 'FREQ=DAILY;BYHOUR=1',
                              enabled         => TRUE,
                              auto_drop       => FALSE
    This job will run everyday at 1am to set the PAUSE attribute to FALSE for the chain. This way the chain should restart.   
    Again, it's a suggestion, needs to be tested!

  • 2 event-based mediators (in 2 separate composites) are triggered instead of

    Hi,
    I followed steps in http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bp_hwfmodel.htm#BABDBAJJ to create an SOA composite with event based mediator to be executed when a task is assigned to users. I created two separate composites (each one has an event mediator) but at runtime we noticed that whenever we execute a composite, both mediators in both composites are triggered !!

    I have the same problem. It would be great to see a solution. This is what I am trying to do:
    My xml document:
    <document>
    <person>
    <name>Jasmina</name>
    </person>
    <person>
    <name>Tajib</name>
    </person>
    <person>
    <name>Serif</name>
    </person>
    </document>
    Statement:
    select extract(doc, '/document/person/name/text()').getStringVal() as Names
    from xml_test
    Returns:
    NAMES
    JasminaTajibSerif
    I would like to get:
    NAMES
    Jasmina
    Tajib
    Serif

  • Events Based Scheduling

    Database Ver. 11gR2 (11.2.0.2.0)
    Hi Guys,
    How do you run jobs in oracle scheduler based on events? I have a job that needs to run after the successful completion of another job. I don't want to use chains. I have searched on the web, but all the examples I see are where a temp table is created and a row is inserted and then another PL/SQL block is run to manually pass a 'GO' value. I am looking for the a job to raise the JOB_SUCCEEDED event and then another job kicks in based on this event.
    Any detailed examples would be greatly appreciated. Also if using any other PL/SQL package, what necessary privileges would be required to execute that package.
    Thanks in advance.
    VB

    Here is a simple example. You create a job, MY_JOB, that raises the job_succeeded event. You also create an event-based job, MY_JOB_CONSUMER, that consumes event messages from sys.scheduler$_event_queue but only for job_succeeded events raised by MY_JOB.
    First you let the user subscribe to the Scheduler event queue using the ADD_EVENT_QUEUE_SUBSCRIBER procedure. “my_agent”, or whatever name you use, is the name of the Oracle Streams Advanced Queuing (AQ) agent to be used to subscribe to the Scheduler event queue. This call both creates a subscription to the Scheduler event queue and grants the user permission to dequeue using the designated agent. The subscription is rule-based. The rule permits the user to see only events raised by jobs that the user owns, and filters out all other messages:
    DECLARE
       agent_already_subscribed_exp   EXCEPTION;
       PRAGMA EXCEPTION_INIT (agent_already_subscribed_exp, -24034);
    BEGIN
       sys.DBMS_SCHEDULER.add_event_queue_subscriber ('my_agent');
    EXCEPTION
       WHEN agent_already_subscribed_exp
       THEN
          NULL;
    END;
    /Then you create MY_JOB_CONSUMER:
    BEGIN
       sys.DBMS_SCHEDULER.create_job (
          job_name          => 'MY_JOB_CONSUMER',
          job_type          => 'PLSQL_BLOCK',
          job_action        => '/* Add you code here */ NULL;',
          event_condition   => 'tab.user_data.event_type = ''JOB_SUCCEEDED'' and tab.user_data.object_name = ''MY_JOB''',
          queue_spec        => 'sys.scheduler$_event_queue,my_agent',
          enabled           => TRUE);
    END;
    /Now, MY_JOB_CONSUMER is waiting for a message to arrive in sys.scheduler$_event_queue. It will dequeue it only if the condition in event_condition is true.
    Create a one time job, MY_JOB, set its raise_events attribute to job_succeeded and enable it:
    BEGIN
       sys.DBMS_SCHEDULER.create_job (job_name     => 'MY_JOB',
                                      job_type     => 'PLSQL_BLOCK',
                                      job_action   => '/* Add you code here */ NULL;',
                                      start_date   => SYSTIMESTAMP AT TIME ZONE 'US/Pacific',
                                      auto_drop    => TRUE,
                                      enabled      => FALSE);
       DBMS_SCHEDULER.set_attribute ('MY_JOB', 'raise_events', DBMS_SCHEDULER.job_succeeded);
       sys.DBMS_SCHEDULER.enable ('MY_JOB');
    END;
    /When MY_JOB executes, it will enqueue a message in sys.scheduler$_event_queue. MY_JOB_CONSUMER will then pick it up and consume it.
    Hope that simple demonstration helps.

  • Export scheduler job but chain step and chain rule failed with ORA-24150 ORA-06512 during executed sql script.

    Hi Folks,
    I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
    Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
    My env: Oracle 11g + Oracle Linux 5.5
    My steps as below:
    1. export(expdp) oracle scheduler job(chain)
    2. generate sql script by impdp.
    3. remove orginal scheduler job(chain)
    4. execute sql script
    5. job with no chain well but job with chain failed
    [oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
    > name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\"  schemas=scott
    Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
      /u03/database/usbo/BNR/dump/scott_job.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
    [oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
    scott_job.dmp  scott_job.sql 
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
    END;
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for first link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for last link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for second link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
    , rule_set_name=>'"SCHED_RULESET$1"   '
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
    job_type=>'CHAIN', job_action=>
    'test_chain_1'
    , number_of_arguments=>0,
    start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
    'freq=minutely; interval=2'
    , end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
    job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
    NULL
    COMMIT;
    END;
    [oracle@linux1 ~]$ export ORACLE_SID=usbo
    [oracle@linux1 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    sys@USBO> show parameter db_name
    NAME                                 TYPE                              VALUE
    db_name                              string                            usbo
    sys@USBO> conn scott/tiger;
    Connected.
    --remove job and chain.
    scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
    EXEC DBMS_SCHEDULER.drop_chain (chain_name  => 'test_chain_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_2');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_3');
    PL/SQL procedure successfully completed.
    scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
    ORA-06512: at line 3
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    PL/SQL procedure successfully completed.

    Thanks all of you!
    Hi DK2010,
    I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
    So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
    ---->no any returned
    scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';       
    no rows selected
    scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
    no rows selected
    -->add new EVALUATION CONTEXT
    scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
    PL/SQL procedure successfully completed.
    --->now it looks fine
    scott@USBO> BEGIN
      2  BEGIN
      3  dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
      4  END;
      5 
      6  COMMIT;
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    --->add new rule set, it prompt aleady exists
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1') 
    BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
    ERROR at line 1:
    ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
    ORA-06512: at line 1
    -->chain rule still could not find.
    scott@USBO> @job_chain_rules.sql
    no rows selected
    -->rerun
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists 
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    -->drop chain
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
    BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
    ERROR at line 1:
    ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
    ORA-06512: at "SYS.DBMS_ISCHED", line 1319
    ORA-06512: at "SYS.DBMS_ISCHED", line 1222
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
    ORA-06512: at line 1
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist   --->still returned no rule set
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    Would you like to give me more clue?
    Thanks again.

  • How to set a default start and/or end date for New Events based on trigger date.

    I'm using the CalendarActivityListener to get current row when clicking on an existing event. As per previous posts this listener gives you access to event detail including Start Date, End Date, etc.
    However, what I want to do is to default the start (and end) dates for New Events based on the trigger date.
    I've tried the CalendarListener and can grab the Trigger Date from it - however, I can't see a way to pass this directly to the popup/dialog I'm using to create the new event.
    At present I'm putting the TriggerDate into the ADFContext session scope e.g. ADFContext.getCurrent().getSessionScope().put("TriggerDate",calendarEvent.getTriggerDate());
    Then, I've tried multiple approaches to try and "get" the TriggerDate from session scope to drop it into my new Calendar Event basically, I'm trying to default the InputField(s) associated with the Start Date using the value from the session - I've tried
    1. setting the default value for the InputField in the jspx using a binding expression i.e. value="#{sessionScope.TriggerDate}" - this actually sets the value appropriately when the jspx is rendered but, when I go to create I get a NPE and I can't debug. I assumed that it might be a Date type issue - it would appear that CalendarListener provides a date of type java.util.Date and that the StartDate attribute of my VO/EO/table is a DATE and therefore requires oracle.jbo.domain.Date so I tried casting it - to no effect
    2. Using a Groovy expression *(StartDate==null?adf.context.sessionScope.TriggerDate:StartDate)* in my calendar's EventVO to default the Start Date to the same result
    Any thoughts or ideas?

    John,
    Thanks for that suggestion - could not get it to work. However, I did manage a different approach. I finally determined the sequence of events in terms of how the various events and listeners fire (I think).
    Basically, the CalendarActivityListener fires, followed by the listener associated with the Calendar object's Create facet, followed finally by the CalendarEventListener - the final is where the TriggerEvent is available and then finally, control is passed to the popup/dialog in the Create facet. So, my approach of trying to set/get the TriggerDate in the user's HTTP session was doomed to failure because it was being get before it had been set :(
    Anyway, I ended up adding a bit of code to the CalendarEvent listener - it grabs the current BindingContext, navigates through the DCBindingContainer to derive an Iterator for the ViewObject which drives the calendar and then grabs the currently active row. I then do a few tests to make sure we're working with a "new" row because I don't want to alter start & end dates associated with an existing calendar entry and then I define the Start and End dates to be the Trigger Date.
    Works just fine. Snippet from the listener follows
    BindingContext bindingContext = BindingContext.getCurrent();+
    *if ( bindingContext != null )    {*+
    DCBindingContainer dcBindings = (DCBindingContainer) bindingContext.getCurrentBindingsEntry();+
    DCIteratorBinding iterator = dcBindings.findIteratorBinding("EventsView1Iterator");+
    Row currentRow = iterator.getCurrentRow();+
    if ( currentRow.getAttribute("StartDate") == null)+
    currentRow.setAttribute("StartDate", calendarEvent.getTriggerDate());+
    if (currentRow.getAttribute("EndDate")==null)+
    currentRow.setAttribute("EndDate", calendarEvent.getTriggerDate());+
    *}*

  • Terminating Event with Decision Step

    Hi,
    In our purchase requisition approval workflow, I need to have a decision step in which to prompt approver to either approve the req. or reject the requisition.  In this decision step, I need for it to have terminating events for "SIGNIFICANTLYCHANGED", "RELEASE", "REJECT" and "RESET".
    First, I copy the generic decision task 8267 to my my own custom decision task.  Then I added a BUS2009 in the container, releasecode and other needed elements.  In this custom decision task, I was able to add these terminating events that has been defined in the BUS2009.  I was able to setup binding, except the one binding
    Terminating Event  ->   Task
    &_EVT_OBJECT&      ->   &_WI_OBJECT_ID&
    Since the &_EVT_OBJECT& for the terminating event is BUS2009.  And the custom decision task &_WI_OBJECT_ID& is DECISION business object. They're incompatable business object.  So I replaced that binding with
    Terminating Event     ->  Task
    &_EVT_OBJECT&    ->   &PURCHASE_REQ&
    After all the configuration has been setup.  I created a new purchase requisition.  Upon the RELEASESTEPCREATED event, it create a custom decision workitem in my agent's inbox.  When I triggered the "RELEASE" event, it is however not terminating my custom decision workitem.  The workitem still sits in the agent's inbox waiting to be execute.
    Is it possible to setup terminating events for decision step?  Any kind of suggestions or inputs would be greatly appreciated.
    Thank you.
    Jennifer Tran
    System Analyst

    I will suggest you to create a fork with 2 parallel branch and 1 necessary branch. Put the approval step in 1 branch and the wait for Release step event in another branch in this way you can suffice your requirment.
    Thanks
    Arghadip

  • I need help with my event-based cue points with audio

    Im having trouble with my video game project for my action script 3 class at school. Here is what i did, i made a game called Tailgate toss up. I filmed my character and rendered it in Adobe Premiere. I than brought my .mov file into After Effects and I put event-based cue points-
    my first cue point at 0:00:03:13 called "loop"
    my second cue point at 00:00:03:27 called "draw"
    my third cue point at 00:00:05:24 called "bang"
    my fourth cue point at 00:00:13:29 called "dead"
    my fifth cue point at 00:00:14:29 called "You Lose"
    my last cue point at 00:00:19:14 called "End"
    Here is my action script 3 code
    ///first frame:
    start_btn.addEventListener(MouseEvent.CLICK, startGame);
    function startGame(event:MouseEvent){
    gotoAndStop(2);
    SoundMixer.stopAll()
    stop();
    ///second frame:
    stop();
    var loopTime
    var hitHim:Boolean = false;
    var vConnection:NetConnection = new NetConnection();
    vConnection.connect(null);
    var vStream:NetStream = new NetStream(vConnection);
    var client:Object = new Object();
    client.onCuePoint = onCuePoint;
    vStream.client = client;
    var myVideo:Video = new Video(418, 480);
    myVideo.y = 0;  ///this adjusts where the video is, right now it is the size of the canvas which is 418,480
    addChild(myVideo);
    myVideo.attachNetStream(vStream);
    vStream.play("michelle.flv");
    var throw_bottle:Sound
    throw_bottle = new Sound(new URLRequest("audio/throw_bottle.mp3")); //change to button noise, will add sound into ae file
    target_mc.addEventListener(MouseEvent.CLICK, shoot);
    target_mc.buttonMode = true;
    target_mc.visible = false;
    draw_mc.visible = false;
    function onCuePoint(cuePoint:Object):void {
       if(cuePoint.name == "loop"){
    loopTime = cuePoint.time;
        if(cuePoint.name == "draw"){
    var randomLoop:Number = Math.random()*10;
    if(randomLoop > 2){
    vStream.seek(loopTime);
    }else{
    setChildIndex(target_mc, numChildren - 1);  
    setChildIndex(draw_mc, numChildren - 1);    
    target_mc.visible = true;
    draw_mc.visible = true;
    if(cuePoint.time == "5:24"){
    draw_mc.visible = false;
    target_mc.visible = false;
    if(!hitHim){
    vStream.seek(15);    
    if(cuePoint.name == "dead"){
    vStream.close();
    myVideo.clear();
    gotoAndStop(3);
    if(cuePoint.name == "end"){
    gotoAndStop(3);
    function shoot(event:MouseEvent){
    throw_bottle.play();
    hitHim = true;
    ///my third and last frame
    playAgain_btn.addEventListener(MouseEvent.CLICK, playAgain);
    function playAgain(event:MouseEvent){
    gotoAndStop(2);
    SoundMixer.stopAll()
    stop();
    When I have no audio it works perfectly, no problems. When I bring audio in i re-render it as a .mov file and bring it back into After Effects and add the cue points to it. Than i re-render it out again as a flv file. When i bring it into my flash project it will work when the looping variable does just one loop and my target will appear so you can click on it or not. But when the looping variable makes it loop 2 to 10 times it skips over the catching (the part of the clip if you clip the button) and goes directly to the dropping of the can, not giving you the option of clicking the button. So basically it skips the "draw" or second cue point of my game and goes to "You Lose" cue point.
    Any suggestions?

    Hi,
    The latest audio driver for your machine is on the following link.
    http://ftp.hp.com/pub/softpaq/sp59501-60000/sp59649.exe
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Question about the chain step name in DEFINE_CHAIN_STEP

    I have questions about the chain step name in DEFINE_CHAIN_STEP:
    1. Can the step name be a number (e.g. "8")?
    2. Should the step name be unique within a chain or across all chains?
    I am having this exception:
    ORA-25448: rule DMUSER.RULE_6_3707 has errors
    ORA-22806: not an object or REF
    After I changed the step names (in DEFINE_CHAIN_STEP), the chain seems to run fine.
    Thanks,
    Denny

    The reason I asked about the step name is to confirm it can handle numbers (it looks it can handle it from the doc).
    Why I changed the step names say from "11" to "21", the error goes away, that puzzled me. Because the way I defined steps and the rules for the steps were exactly the same. Just changing the step names made the error goes away?!
    Thanks.

Maybe you are looking for