Run test uut entry point only once

Hi,
I want to avoid that users can run test uuts entry point more than once. I use an operator interface written in CVI 7.1.1 and netry point button is deactivated when run state changes. But after loading the application sometimes is too slow so the user can press this button twice before it is deactivated.
So is there any possibility to avoid running this entry point more than one time?
Regards
Steffen

Steffen,
Thank you so much for the help.  You recommendations worked perfectly.  Both of us implemented more or less the same behavior in our operator interfaces, although we used slightly different methods.  Here is what I did:
I established a count variable in my operator interface that is initially set to 0.  Each time the Test UUTs or Single Pass button is pressed, I increment the count by 1.  I determine that the Test UUTs or Single Pass button is pressed by registering for and handling the Application Manager PreCommandExecute event.  In my callback for this event, I examine the returned Command and look at its EntryPointIndex property to see if the index is 0 (Test UUTs) or 1 (Single Pass).  If it is, I increment the count variable count by 1.  If the index is not 0 or 1, I do nothing.  Once execution has stopped, I reset the count variable back to 0.  I do this by registering for and handling the ExecutionView Manager RunStateChanged event (as you recommended).  In my callback for this event, I examine the returned newRunState to see if it stopped (numerical value of 3).  If it is, I set the value of the count variable back to 0.  If it isn't stopped, I do nothing.
This method is basically the same as the one you propose.  This method allows you to use the built in TestStand buttons instead of having to use those found in your development environment.  The only drawback is that they don't disable and gray out during execution; they just do nothing when an execution is in progress and the operator presses them.

Similar Messages

  • How to "Run Test UUTs" from ParallelSeq?

    Hello,
    i´m starting a parallel-sequence in Seq-file load in the model when starting TestStand. How can i execute a "Run Test UUTs (F5)" from wthis parallelsequence to run the currrently loaded sequence?
    Thx
    Regards

    Hello,
    I don't understand your problem. Could you explain it a bit more detailed?
    Could you post your sequence file?
    Thanks and regards,
    Wolfgang Z

  • Hide Test UUT button during execution

    Is there an easy way to hide the entry point button "Test UUTs" once it is clicked?  I want to prevent an operator from starting up duplicate test executions.
    I am using TestStand 3.5
    Solved!
    Go to Solution.

    Thanks for the help,
    What I ended up doing was using the PostUI message in the custom user message range (above 10000).  Then I created a callback vi to handle user messages.  I passed a reference to the Test UUT entry point button and enable or disable it.  Basicly I can have my sequence handle the state of this button.  The Post UI messages happen in the process setup and cleanup of my sequence files.
    I attached a snapshot of the callback vi.
    Paul
    Attachments:
    UIMessageCallback.jpg ‏56 KB

  • Model entry point 'test uuts' could not be executed error -18002

    Hi,
    I am running a testand(2.0.1f1) sequence of labview (7.0) steps and it is working perferctly in my computer , but when installing testand and labview in another computer and I try to run my sequence the next message appears. "model entry point 'test uuts' could not be executed error -18002"
    Is anyone that has an idea of what is happening here?
    Thanks =)
    Eren

    Hi Eren,
    You might try mass compiling the TestStand folders so that all VI's are at the same Version. TestStand 2.0.1f1 installs VI's that are at ver5.1.1
    When you run from the Entry Point eg "Test UUTs", before the sequence executions all VI's in all the sequence contained in the sequence file are loaded in to memory.
    Look at the error message again, it should be telling you which step in which sequence of the sequence file is not executable.
    Hope this helps
    Ray Farmer
    Regards
    Ray Farmer

  • In LabVIEW OI the Run Selected Step Using Test UUTs does not work

    TestStand LabVIEW Operator Interface (old style) - TestStand Version 2.0.1 & 3.0
    The Interactive option was enabled for the Process Model Entry Point - Test UUTs in the SequentialModel.seq.
    When selective steps were selected to run within the LV OI using the menu item 'Run Selected Step Using - Test UUTs' it was found not to work.
    The reason for it not working was because the main event string was "Run Selected Step 0" but this isn't available in the case statement. Changing the "Run Selected Step 1".."Run Selected Step 9999" to "Run Selected Step 0".. didn't produced the desired result. Instead of the selected steps running using the entry point Test UUTs, the steps ran without the process model.
    The Case Statement string was retored back to "Run Selected Step 1".
    The changes that are required to make the "Run Selected Step 1".."Run Selected Step 9999" work with either of the Entry Points are as follow.
    In the VI TestStand - Create Entry Point Menus for Interactive Exec.vi
    Insert an Increment from the iteration terminal of the FOR loop. This ensures the Message Queue string generated is in the range 1 - 9999 not 0 - 9999.
    In the TestStand - Sequence Display.vi
    For the Main Message Event "Run Selected Steps", "Run Selected Step 1".."Run Selected Step 9999"
    In the case "1, Default", decrement the input 'Entry Point Index' to the VI TestStand - Start Interactive Entry Point Execution.vi. This ensures the Entry Point Index starts from the value 0.
    Now when the selected steps are run using a Pocess Model Entry Point, they run correctly.
    This problem only appears to affect the LabVIEW Operator Interface and only the old style. The new style that comes with TestStand 3.0 runs correctly.
    There is one other problem. When an Operator is logged in to TestStand, the Entry Point - 'Single Pass' is disabled. But this is not reflected to the menu item 'Run Selected Step Using'. Both 'Test UUTs' and 'Single Pass' are available to the operator.
    The reason for this is because in the VI 'TestStand - Create Entry Point Menus for Interactive Exec.vi' the sub menu item is enabled as a result from the property Sequence.AllowInteractiveExecutionOfEntryPoint. This is not enough to disable the 'Single Pass'. The Engine.CurrentUserHasPrivilege needs to be checked as well. Which means modications to the VI 'TestStand - Create Entry Point Menus for Interactive Exec.vi'.
    Hope is maybe of help to anyone that may need to use this option.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    In_Labview_OI_-_Run_Selected_Steps_Using_Test_UUTs_doesnt_work.txt ‏3 KB

    Thanks Ray for the "heads-up". )
    I am about to implement a vi which calls TestStand functions. This vi will allow to select tests and permits test re-entry (loops) if the user has supervisor privileges.
    I will consider what you recommend in this string.
    I will also provide feedback on this thread if I discover anything .... let's say "unusual"..
    On another note, I am using TestStand 3.0 I have not observed any problems when running selected steps or run selected steps using single pass. I have also within TestStand set privileges for certain Operators to do the same. They have not reported any problems.
    Thanks,
    JLV

  • Entry point 'Test Batch' does not exist

    Hi Forum
     I am in the process of upgrading one of our testsystems from TestStand version 3.1 to version 4.1.
    The system is started up by a Labview app which calls TS by a command line call (-runEntryPoint  "Test Batch"  "C:\..."). However, TS 4.1 doesn't recognize the "Test Batch" entry point (worked fine in 3.1), and I get an error box with the message "entry point 'Test Batch' does not exist". I have checked that the entry point exist in the sequence model file, and if I go to the "Execute" menu, I get the choice to run "Test Batch".
    I am able to se the -run command, but then I, for some reason, don't get the entire sequence.
    Any suggestions to what I am doing wrong? I am logged in to TS automatically with my windows login.
    B.R.
    Martin
    Solved!
    Go to Solution.

    Hi,
    There should be a document in \Conponents\NI\Models\... which should give you the basics for the various process models.
    here is some other references that may help
    http://zone.ni.com/devzone/cda/tut/p/id/7958
    http://digital.ni.com/public.nsf/allkb/D9E7A0BDDDA​2A87886256FD9007598D2
    Check out some of the related links
    http://zone.ni.com/devzone/cda/tut/p/id/3819
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 09-24-2009 11:00 AM
    Regards
    Ray Farmer

  • How do I get a case to run only once

    I am using an e-series DAQ board to bring a pwm signal, then I use labview to use that signal to pick one of three cases. depending on the case picked a finite pulse stream is sent out. Currently the finite pulse vi keeps repeating because the the program stays in the case. I need a way to get labview to run the finite pulse output only once, and not run again until a new case is picked. I don't have the case in a while loop.
    Thanks For The Help

    I am still haveing problems so I will try and attach my program and see if you can help a little more that. It will probably be easier for you to look at this way. When you look at the diagram sequence 0 is the one the problem is in. In that sequence you will see a case structure and that is where the finite pulse train vi is. When case 1 is selected the finite pulse train will run again and again until I leave case 1. I need to have the program run the finite pulse train once and then wait and do nothing until the case is changed. The finite pulse train will be in all cases inside the case structure I just haven't done that yet, I am waiting until it works. The pulse train is used to move a stepper motor that is why running only once is im
    portant because the stepper motor is used to position something.
    Attachments:
    AMC_Eagle_Both_Inputs_Working_2.vi ‏266 KB

  • Run same install scripts only once

    I recently found the install script mechanism quite inefficient (and I'm sure many other people have noticed it as well).
    for example,if I install the texlive-most group, after every package installed, mktexlsr would run once. But actually, the only one that is necessary is the last one.
    So I think if pacman could run every same install script only once, this would speed pacman up a lot (especially when you haven't upgrade for two months!)
    Last edited by darkraven (2011-01-23 03:25:03)

    Get coding:
    http://projects.archlinux.org/pacman.git/
    http://mailman.archlinux.org/mailman/listinfo/
    https://wiki.archlinux.org/index.php/Us … cman_Hooks

  • GetCommand does not return my configuration entry points?

    If I'm in a client sequence file and I want to dynamically execute my own configuration entry point in the process model what is the best way to accomplish that?
    I am trying to get the application manager through an activex step using Engine.GetInternalOption(InternalOption_ApplicationmManager) and then I choose the GetCommand method with CommandKind_ConfigurationEntryPoints_Set.  It will only use an index for one of the 3 default configuration entry points (Report Options, Model Options or Database Options).  It throws an index out of range if I try to get my own.  This is from James Grey's post here: http://forums.ni.com/t5/NI-TestStand/Calling-a-Configuration-Entry-Point-from-a-C-code-module/td-p/1... (I'm not in .NET though.  I just want to use activex steps in TS).  The 3 default ones work perfectly.  It's only when I try my own that I've added.
    Any thoughts?
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Solved!
    Go to Solution.

    I can call it directly as well but it doesn't exhibit the behavior I want.
    Basically we have a process model with a Configuration Entry point called About Test.  This calls a sub sequence which has 2 steps in it. The first step is a callback and the second is a VI call.  The VI displays a splash screen with our company logo, disclosure and the text (usually a software part number) returned by the callback.
    What I want to do is put the SequenceFileLoad callback in our clients and have a step in there that will invoke the About Test entry point upon sequence load.
    The series would look like this:
    SequenceFileLoad(client)>>About Test Configuration Entry Point(model)>>SubSequence(model)>>About Test Model Callback (client)>>VI Splash Screen(model)
    All of this would be a lot easier with a (ProcessModelFileLoad): http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/ProcessModelFileLoad-Engine-Callback/idi-p/225016...
    So back to my point about it not working correctly.  It doesn't seem to be invoking the model callback when I use New Execution or call the sequence directly.
    Also, what is the explanation for my config entry points not showing up at all in the list?  it seems that function should grab all config entry points in the model..... 
    Thanks a bunch,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Entry Point Customization

    My requirement is to enable end user to choose any particular workset or page as the default entry point. In other words, that workset or page should be the first to focus when the user hits the portal. Can this functionality be made personalized?
    Thx for your help.
    Tridib

    Hi Tridib,
    I don't quite get what you are trying to do.
    If you set entry point to true for a workset, it won;t have any effect, since the role will still be the entry point (unless you change it).
    Entry points only determine if the current role appears in the user's initial nodes, and which of the nodes in the role is displayed as the root. It does not determine priority.
    If you have all the info you need, great. Forget about this post. If not, can you explain the functionality you want to provide?
    Daniel

  • Programmatically selecting Test UUT as entry point from LabVIEW

    Hi,
    Anne here. I am currently develping a user interface in LabVIEW that call the TestStand sequence. Is there a way for me to programaticallys set the entry point to be Test UUT? I used the Run method from the IseequenceFileViewMgr class but it says there that it runs the sequence without a process model entry point. My sequence will always run as Test UUT mode. Is there a way for me to do this? I saw in the help files that there is a EntryPoint Class in Teststand with a Run Method, but I can't seem to find this method in LabVIEW. 
    How can I automatically execute my sequence to run in Test UUT once I call and run the sequence in LabVIEW? 
    Thanks for the help!
    Cheers! 
    Anne
    Solved!
    Go to Solution.

    Hi Roderic,
    Thanks so much for the help! It worked.
    Cheers!
    Anne

  • How to prevent running a sequence two times by using "Test UUTs or F5"?

    How can prevent that a user can press "F5 or Test UUTs" more than one time???
    Greets
    Matthias

    Hi Matthias,
    If you haven't made any changes to your SequentialModel.seq then before you start make a copy of the SequentialModel.seq found in C:\TestStand\Components\NI\Models\TestStandModels and copy this to C:\TestStand\Components\USER\Models\TestStandModel​s.
    Now launch the SeqEditor.
    If you open the SequentialModel.seq file found in the C:\TestStand\Components\USER\Models\TestStandModel​s folder. With the
    Test UUTs sequence active. Select the Menu Item Edit | Sequence Properties.
    You should have the Test UUTs Properties dialog visible. Select the Model Tab. Enable the Hide Entry Point Execution control. Ok the changes and save the SequentialModel.seq file.
    Now when you run your Sequence you will only beable to run one execution.
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Help: I want to auto schedule a load using file watcher but it runs only once for the first time and after that it is not running at all

    Hi All,
    I am trying  to execute the below code as provided from one of the blogs. i am able to run the job only once based on a file watcher object(i.e. for very first time) and after that the job is not running at all and if  i schedule the job to run automatically based on interval of 10 or more minutes it is executing properly). Please let me know or guide me if i have missed any step or configuration.that is needed.
    Version of Oracle 11.2.0.1.0
    OS : Windows 7 Prof
    Given all the necessary privileges
    BEGIN
      DBMS_SCHEDULER.CREATE_CREDENTIAL(
         credential_name => 'cred',
         username        => 'XXXX',
         password        => 'XXXX');
    END;
    CREATE TABLE ZZZZ (WHEN timestamp, file_name varchar2(100),
       file_size number, processed char(1));
    CREATE OR REPLACE PROCEDURE YYYY
      (payload IN sys.scheduler_filewatcher_result) AS
    BEGIN
      INSERT INTO ZZZZ VALUES
         (payload.file_timestamp,
          payload.directory_path || '/' || payload.actual_file_name,
          payload.file_size,
          'N');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_PROGRAM(
        program_name        => 'prog1',
        program_type        => 'stored_procedure',
        program_action      => 'YYYY',
        number_of_arguments => 1,
        enabled             => FALSE);
      DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
        program_name        => 'prog1',
        metadata_attribute  => 'event_message',
        argument_position   => 1);
      DBMS_SCHEDULER.ENABLE('prog1');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_FILE_WATCHER(
        file_watcher_name => 'file_watcher1',
        directory_path    => 'D:\AAAA',
        file_name         => '*.txt',
        credential_name   => 'cred',
        destination       => NULL,
        enabled           => FALSE);
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_JOB(
        job_name        => 'job1',
        program_name    => 'prog1',
        queue_spec      => 'file_watcher1',
        auto_drop       => FALSE,
        enabled         => FALSE);
      DBMS_SCHEDULER.SET_ATTRIBUTE('job1','PARALLEL_INSTANCES',TRUE);
    END;
    EXEC DBMS_SCHEDULER.ENABLE('file_watcher1,job1');
    Regards,
    kumar.

    Please post a copy and paste of a complete run of a test case, similar to what I have shown below.
    SCOTT@orcl12c> SELECT banner FROM v$version
      2  /
    BANNER
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    PL/SQL Release 12.1.0.1.0 - Production
    CORE    12.1.0.1.0    Production
    TNS for 64-bit Windows: Version 12.1.0.1.0 - Production
    NLSRTL Version 12.1.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl12c> CONN / AS SYSDBA
    Connected.
    SYS@orcl12c> -- set file watcher interval to one minute:
    SYS@orcl12c> BEGIN
      2    DBMS_SCHEDULER.SET_ATTRIBUTE
      3       ('file_watcher_schedule',
      4        'repeat_interval',
      5        'freq=minutely; interval=1');
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SYS@orcl12c> CONNECT scott/tiger
    Connected.
    SCOTT@orcl12c> BEGIN
      2    -- create credential using operating system user and password (fill in your own):
      3    DBMS_SCHEDULER.CREATE_CREDENTIAL
      4       (credential_name     => 'cred',
      5        username          => '...',
      6        password          => '...');
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- create table to insert results into:
    SCOTT@orcl12c> CREATE TABLE ZZZZ
      2    (WHEN      timestamp,
      3      file_name varchar2(100),
      4      file_size number,
      5      processed char(1))
      6  /
    Table created.
    SCOTT@orcl12c> -- create procedure to insert results:
    SCOTT@orcl12c> CREATE OR REPLACE PROCEDURE YYYY
      2    (payload IN sys.scheduler_filewatcher_result)
      3  AS
      4  BEGIN
      5    INSERT INTO ZZZZ VALUES
      6        (payload.file_timestamp,
      7         payload.directory_path || '/' || payload.actual_file_name,
      8         payload.file_size,
      9         'N');
    10  END;
    11  /
    Procedure created.
    SCOTT@orcl12c> -- create program, define metadata, and enable:
    SCOTT@orcl12c> BEGIN
      2    DBMS_SCHEDULER.CREATE_PROGRAM
      3       (program_name          => 'prog1',
      4        program_type          => 'stored_procedure',
      5        program_action      => 'YYYY',
      6        number_of_arguments => 1,
      7        enabled          => FALSE);
      8    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
      9       program_name         => 'prog1',
    10       metadata_attribute  => 'event_message',
    11       argument_position   => 1);
    12    DBMS_SCHEDULER.ENABLE ('prog1');
    13  END;
    14  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create file watcher:
      3    DBMS_SCHEDULER.CREATE_FILE_WATCHER
      4       (file_watcher_name   => 'file_watcher1',
      5        directory_path      => 'c:\my_oracle_files',
      6        file_name          => 'f*.txt',
      7        credential_name     => 'cred',
      8        destination          => NULL,
      9        enabled          => FALSE);
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create job:
      3    DBMS_SCHEDULER.CREATE_JOB
      4       (job_name          => 'job1',
      5        program_name          => 'prog1',
      6        queue_spec          => 'file_watcher1',
      7        auto_drop          => FALSE,
      8        enabled          => FALSE);
      9    -- set attributes:
    10    DBMS_SCHEDULER.SET_ATTRIBUTE ('job1', 'PARALLEL_INSTANCES', TRUE);
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- enable:
    SCOTT@orcl12c> EXEC DBMS_SCHEDULER.enable ('file_watcher1, job1');
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- write file (file must not exist previously):
    SCOTT@orcl12c> CREATE OR REPLACE DIRECTORY upncommon_dir AS 'c:\my_oracle_files'
      2  /
    Directory created.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file1.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    1 row selected.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file2.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    22-OCT-13 10.14.08.580000 PM
    c:\my_oracle_files/file2.txt
            57 N
    2 rows selected.

  • Step post action works only in 'Test UUts' mode

    Hi,
    My main sequence file has a list of  steps, all sequence type.  I specify a post action on each one to jump to end if the seq fails and if a flag is set:
    FileGlobals.StopOnFail == True && RunState.SequenceFailed == True 
    I found out that it only works if I run my test in 'Test UUTs' mode.  If I select 'Run Selected tests using Single Pass', then, it igonre this.
    Is this how it supposed to be?
    How can i fix it?
    Thanks
    Rafi
    TS4.1
    Solved!
    Go to Solution.

    Rafi2003 wrote:
    [...]Why do you need a previous step?[...]
    Rafi,
    you are correct that you do not need a previous step; it is sufficient if the step itself fails and sets the RunState.SequenceFailed flag.
    On my machine, this test also works as expected so i asume that either your step itself does not set the RunState.SequenceFailed flag or you have another issue in your Run Selected Steps using Single Pass execution....
    Norbert 
    [EDIT] Added small example sequence 
    Message Edited by Norbert B on 05-13-2009 06:26 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    PostAction.seq ‏5 KB

  • Dbms_scheduler - dbms_aq - dbms_aqadm - event driven job runs only once/sec

    hi, i tried here to process events with 2 jobs... surprisingly i had to call dbms_lock.sleep(1) to be able to enqueue events
    at inserts in a row ... even more surprisingly the enqueuing doesn't function if the processing (prc_evsched) lasts some seconds...
    how must the code be changed to be able to enqueue all events after the inserts without any sleep()?
    and how must the code be changed to be able to enqueue all events with a proc (prc_evsched) running longer?
    thanx in advance for your help!
    --evsched
    h4.
    --to remove all test-objects
    h4.
    --test table
    h4.
    --define the object type to act as the payload for the queue
    h4.
    --creating the event queue
    h4.
    --creating the proc for the prog/job
    h4.
    --creating the proc for the prog/job
    h4.
    --creating the program
    h4.
    --creating the first job (for parallel execution)
    h4.
    --creating the second job (for parallel execution)
    h4.
    --test block
    h4.
    --test scenarios/results
    h4.
    --to remove all test-objects
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    exc_ora_27476 EXCEPTION; --ora-27476: <program_name> ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_27476, -27476);
    exc_ora_24010 EXCEPTION; --ORA-24010: QUEUE SYSGIS.EVENT_QUEUE ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_24010, -24010);
    exc_ora_24002 EXCEPTION; --ORA-24002: QUEUE_TABLE SYSGIS.EVENT_QUEUE_TAB ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_24002, -24002);
    exc_ora_4043 EXCEPTION; --ORA-04043: Objekt T_EVENT_QUEUE_PAYLOAD ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_4043, -4043);
    exc_ora_942 EXCEPTION; --ORA-00942: Tabelle oder View nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_942, -942);
    exc_ora_2289 EXCEPTION; --ORA-02289: Sequence ist nicht vorhanden.
    PRAGMA EXCEPTION_INIT (exc_ora_2289, -2289);
    v_fpos PLS_INTEGER := 1;
    BEGIN
    v_fpos := 10;
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    v_fpos := 12;
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched_2', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    v_fpos := 20;
    BEGIN
    --remove program
    SYS.DBMS_SCHEDULER.DROP_PROGRAM(program_name=>'prg_evsched',FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27476 THEN NULL;
    END;
    v_fpos := 30;
    BEGIN
    -- stop the event queue.
    DBMS_AQADM.stop_queue (queue_name => 'evsched_event_queue');
    EXCEPTION WHEN exc_ora_24010 THEN NULL;
    END;
    v_fpos := 40;
    BEGIN
    -- drop the event queue.
    DBMS_AQADM.drop_queue (queue_name => 'evsched_event_queue');
    EXCEPTION WHEN exc_ora_24010 THEN NULL;
    END;
    v_fpos := 50;
    BEGIN
    -- Remove the queue table.
    DBMS_AQADM.drop_queue_table(queue_table => 'tab_evsched_event_queue');
    EXCEPTION WHEN exc_ora_24002 THEN NULL;
    END;
    v_fpos := 60;
    BEGIN
    -- remove type
    EXECUTE IMMEDIATE 'DROP TYPE typ_evsched_payload';
    EXCEPTION WHEN exc_ora_4043 THEN NULL;
    END;
    v_fpos := 70;
    BEGIN
    -- remove table
    EXECUTE IMMEDIATE 'DROP TABLE tab_evsched';
    EXCEPTION WHEN exc_ora_942 THEN NULL;
    END;
    v_fpos := 80;
    BEGIN
    -- remove sequence
    EXECUTE IMMEDIATE 'DROP SEQUENCE seq_evsched';
    EXCEPTION WHEN exc_ora_2289 THEN NULL;
    END;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('v_fpos='||v_fpos);
    END;
    h4.
    --test table
    CREATE TABLE tab_evsched
    ( id NUMBER
    , sys_date DATE
    , status VARCHAR2(1)
    , processed VARCHAR2(1) DEFAULT 'N'
    , processed_by varchar2(128)
    GRANT DELETE, INSERT, SELECT, UPDATE ON tab_evsched TO PUBLIC
    CREATE SEQUENCE seq_evsched
    h4.
    --define the object type to act as the payload for the queue
    CREATE OR REPLACE TYPE typ_evsched_payload AS OBJECT
    ( event_name VARCHAR2(30)
    , tab_evsched_id NUMBER
    , daterf DATE
    h4.
    --creating the event queue
    BEGIN
    -- Create a queue table to hold the event queue.
    DBMS_AQADM.create_queue_table
    ( queue_table => 'tab_evsched_event_queue'
    , queue_payload_type => 'typ_evsched_payload'
    , multiple_consumers => TRUE
    , COMMENT => 'Queue Table For Event Messages'
    -- Create the event queue.
    DBMS_AQADM.create_queue
    ( queue_name => 'evsched_event_queue'
    , queue_table => 'tab_evsched_event_queue'
    , queue_type => DBMS_AQADM.NORMAL_QUEUE
    , max_retries => 0
    , retry_delay => 0
    , dependency_tracking => FALSE
    , comment => 'Test Object Type Queue'
    , auto_commit => FALSE
    -- Start the event queue.
    DBMS_AQADM.start_queue
    ( queue_name => 'evsched_event_queue'
    END;
    h4.
    --creating the proc for the prog/job
    CREATE OR REPLACE PROCEDURE prc_evsched
    ( p_message IN typ_evsched_payload
    , p_job_name IN VARCHAR2
    IS
    BEGIN
    UPDATE tab_evsched
    SET processed = 'J'
    , processed_by = p_job_name
    , sys_date = p_message.daterf
    WHERE 1=1
    AND id = p_message.tab_evsched_id
    dbms_lock.sleep(5); --#sleep-1#
    COMMIT;
    END prc_evsched;
    h4.
    --creating the program
    DECLARE
    exc_ora_27476 EXCEPTION; --ora-27476: <program_name> ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_27476, -27476);
    BEGIN
    BEGIN
    SYS.DBMS_SCHEDULER.DROP_PROGRAM(program_name=>'prg_evsched',FORCE=>TRUE);
    EXCEPTION
    WHEN exc_ora_27476 THEN
    NULL;
    END;
    SYS.DBMS_SCHEDULER.CREATE_PROGRAM
    ( program_name => 'prg_evsched'
    , program_type => 'STORED_PROCEDURE'
    , program_action => '"SYSGIS"."PRC_EVSCHED"'
    , number_of_arguments => 2
    , enabled => FALSE
    , comments => 'Program-Komponent für den Test von DBMS_SCHEDULER'
    --event message as the first param to prc_evsched 
    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT
    ( program_name => 'prg_evsched'
    , argument_position => 1
    , metadata_attribute => 'EVENT_MESSAGE'
    --name of the job as the second param to prc_evsched 
    SYS.DBMS_SCHEDULER.define_program_argument
    ( program_name => 'prg_evsched'
    , argument_name => 'p_job_name'
    , argument_position => 2
    , argument_type => 'VARCHAR2'
    , default_value => 'dummy'
    --enable program   
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'prg_evsched');
    END;
    h4.
    --creating the first job (for parallel execution)
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    BEGIN
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    DBMS_SCHEDULER.create_job
    ( job_name => 'job_evsched'
    , program_name => 'prg_evsched'
    , start_date => SYSTIMESTAMP
    , event_condition => 'tab.user_data.event_name = ''MYEVENT'''
    , queue_spec => 'evsched_event_queue'
    , auto_drop => FALSE
    , enabled => FALSE
    SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE
    ( job_name => 'job_evsched'
    , argument_name => 'p_job_name'
    , argument_value => 'job_evsched'
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'job_evsched');
    END;
    h4.
    --creating the second job (for parallel execution)
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    BEGIN
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched_2', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    DBMS_SCHEDULER.create_job
    ( job_name => 'job_evsched_2'
    , program_name => 'prg_evsched'
    , start_date => SYSTIMESTAMP
    , event_condition => 'tab.user_data.event_name = ''MYEVENT'''
    , queue_spec => 'evsched_event_queue'
    , auto_drop => FALSE
    , enabled => FALSE
    SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE
    ( job_name => 'job_evsched_2'
    , argument_name => 'p_job_name'
    , argument_value => 'job_evsched_2'
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'job_evsched_2');
    END;
    h4.
    --test block
    DECLARE
    PROCEDURE pr_ins_tab_evsched
    ( p_id IN NUMBER
    , p_status IN VARCHAR2
    IS
    BEGIN
    INSERT INTO tab_evsched(id,status) VALUES (p_id, p_status);
    COMMIT;
    --enqueue the MYEVENT-event
    IF p_status = 'M' THEN
    --enqueue works in 1sekunden-taktung.... !?
    dbms_lock.sleep(1); --#sleep-2#
    DECLARE
    v_enqueue_options DBMS_AQ.enqueue_options_t;
    v_message_properties DBMS_AQ.message_properties_t;
    v_message_handle RAW(16);
    v_queue_msg typ_evsched_payload;
    BEGIN
    v_queue_msg := typ_evsched_payload
    ( event_name => 'MYEVENT'
    , tab_evsched_id => p_id
    , daterf => SYSDATE
    v_enqueue_options.VISIBILITY := DBMS_AQ.ON_COMMIT;
    v_enqueue_options.delivery_mode := DBMS_AQ.PERSISTENT;
    v_message_properties.PRIORITY := 1;
    v_message_properties.DELAY := DBMS_AQ.NO_DELAY;
    v_message_properties.EXPIRATION := DBMS_AQ.NEVER;
    v_message_properties.CORRELATION := 'TEST MESSAGE';
    DBMS_AQ.enqueue
    ( queue_name => 'evsched_event_queue'
    , enqueue_options => v_enqueue_options
    , message_properties => v_message_properties
    , payload => v_queue_msg
    , msgid => v_message_handle
    END;
    END IF;
    COMMIT;
    END pr_ins_tab_evsched;
    BEGIN
    DELETE tab_evsched;
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    END;
    SELECT * FROM tab_evsched ORDER BY id;
    SELECT * FROM sysgis.tab_evsched_event_queue;
    h4.
    --test scenarios/resultsh
    h5.
    --test results #sleep-1#=5, #sleep-2#=0
    --job (job_evsched) runs only once, only the first event is enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    9 22.03.2012 17:00:41 M J job_evsched
    10 (Null) M N (Null)
    11 (Null) M N (Null)
    12 (Null) M N (Null)
    13 (Null) M N (Null)
    14 (Null) M N (Null)
    15 (Null) M N (Null)
    16 (Null) M N (Null)
    h5.
    --test results #sleep-1#=0, #sleep-2#=1
    --jobs (job_evsched/job_evsched2) run alternately, every events are enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    25 22.03.2012 17:04:31 M J job_evsched_2
    26 22.03.2012 17:04:32 M J job_evsched_2
    27 22.03.2012 17:04:33 M J job_evsched
    28 22.03.2012 17:04:34 M J job_evsched_2
    29 22.03.2012 17:04:35 M J job_evsched_2
    30 22.03.2012 17:04:36 M J job_evsched_2
    31 22.03.2012 17:04:37 M J job_evsched
    32 22.03.2012 17:04:38 M J job_evsched_2
    h5.
    --test results #sleep-1#=5, #sleep-2#=1
    --jobs (job_evsched/job_evsched2) run alternately, only two events are enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    41 22.03.2012 17:07:42 M J job_evsched_2
    42 (Null) M N (Null)
    43 (Null) M N (Null)
    44 (Null) M N (Null)
    45 (Null) M N (Null)
    46 (Null) M N (Null)
    47 22.03.2012 17:07:48 M J job_evsched
    48 (Null) M N (Null)
    */

    hi, thank you for your (fast) answer! that is the solution to my problem!
    now i have a follow-up question:
    i've got a procedure, that runs between 1 and 2 minutes long. unlimited running lightweight jobs
    would freeze the db...
    how can the count of the parallel running lightweight-jobs be limited?
    according to the documentation it is not possible:
    There is no explicit limit to the number of lightweight jobs that can run simultaneously to process multiple instances of the event.
    However, limitations may be imposed by available system resources.
    could you explain to me, what it (...available system recources...) means?
    eventually what i would like to have: max. two parallel running (lightweight) jobs....
    thank you in advance, bye, á
    ps: can i attach a file to the post anyway?
    Edited by: user4786904 on 23.03.2012 07:22

Maybe you are looking for

  • Toolbar using word in office 2011 disappear

    Since installing Lion Word in Office 2011 will not show Tool bars. Can anyone give me a clue? Can restore by deleting Toolbars and then reinstating, but disapperar when exit Word.

  • N95 8GB cannot view gallery photos/ uploads photos...

    Hiya, I have had the same problem with my N95 8GB with viewing photos in my gallery! I have now got my 5th replacement handset (Orange) since August 29th due to various faults and issues. The main one being trying to transfer photos from my PC to my

  • Why Design View will be removed?

    My question is that: why Design View will be removed from Flash Builder? Will it be substituted by another way of doing the things visually? Will adobe provide other visual tool to design applications? Disabling Design view and extinguing Catalyst se

  • タスクバーのアイコンを消すには

    PhotoShop Album Mini 3.0 を.Windows XP HE SP2 にて使っております. インストール後.Windows 起動毎.タスクバーに「Photo Downloader」の起動アイコンが表示されるようになりました.スタートアップには該当する項目はありませんでした. この「Photo Downloader」を起動させないようにるにはどうしたら良いのでしょうか?

  • WRT54G no internet default gateway

    My WRT54G was working fine until my TiVo couldn't find my router anymore.  I got the message "Unable to locate gateway".  I logged onto 192.168.1.1 and my internet default gateway was 0.0.0.0.  I have reset the router many times, but the gateway addr