The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CA::WAAE - Interface to CA's Workflow Automation AE (AutoSys Edition) job control.

SYNOPSIS

    use CA::WAAE;

    my $hdl = CA::WAAE->new( [OPT] ) ;
    my $jobs = $hdl->find_jobs($jobname) ;
    while (my $job = $jobs->next_job()) {
        :
    }
    my $status = $job->status() ;
    my $children = $job->find_children() ;
    while (my $child = $children->next_child()) {
        :
    }

CLASS METHODS

new()

    my $hdl = CA::WAAE->new( [OPT] ) ;

Creates a new CA::WAAE object.

Below is a list of valid options:

dbh

Pass in a database handle. If this is specified, then dsn, user, and password are not required.

dsn

Specify the DSN of the AutoSys' database server to connect to. If nothing is specified, Sybase will be assumed: dbi:Sybase:server=<your_server> With this option you should be able to connect to databases other than Sybase.

user

Specify the database user. With an out-of-the-box AutoSys installation, the default user should work.

password

Specify the database password. With an out-of-the-box AutoSys installation, the default password should work.

schema

For Oracle, the schema that your AutoSys tables are in. Defaults to 'aedbadmin' for an Oracle database.

table_prefix

Specify a prefix to add to table names. E.g. 'ujo_' will make sql refer to table 'ujo_job' instead of 'job'. 'ujo_' is the default for an Oracle database.

Example:

    my $hdl = CA::WAAE->new(server => "AUTOSYS_DEV");

INSTANCE METHODS

find_jobs()

    my $jobs = $hdl->find_jobs($jobname) ;

Finds jobs with a given name. When you have the wildcard character '%' somewhere in the job name, it will return all matching jobs, i.e.:

To find all jobs starting with the string 'MY_JOB':

    $jobs = $hdl->find_jobs('MY_JOB%');

To find all jobs that have the string 'JOB' somewhere in the name:

    $jobs = $hdl->find_jobs('%JOB%');

To find a job with an exact name:

    $jobs = $hdl->find_jobs('JOB_42');

See also CA::WAAE::Job

job_list()

Same as find_jobs, but returns an array of CA::WAAE::Job objects.

send_event()

    my $rc = $hdl->send_event( [OPT] ) ;

Sends an event to the given job. Returns 1 on success, 0 otherwise. At least the event name should be given. Depending on the event, more options may be necessary (see below). For details, consult your AutoSys' User Guide.

Below is a list of valid options:

job_name

The name of the job - no wildcards allowed.

event

Event name. The following list contains all available event names in alphabetical order:

    ALARM                  CHANGE_PRIORITY        CHANGE_STATUS
    CHECK_HEARTBEAT        CHK_BOX_TERM           CHK_MAX_ALARM
    CHK_N_START            CHK_RUN_WINDOW         COMMENT
    DELETEJOB              EXTERNAL_DEPENDENCY    FORCE_STARTJOB
    HEARTBEAT              JOB_OFF_HOLD           JOB_OFF_ICE
    JOB_ON_HOLD            JOB_ON_ICE             KILLJOB
    QUE_RECOVERY           REFRESH_BROKER         RESEND_EXTERNAL_STATUS
    SEND_SIGNAL            SET_GLOBAL             STARTJOB
status

The job status when the event is CHANGE_STATUS. The following list contains all possible states for the CHANGE_STATUS event in alphabetical order:

    ACTIVATED              FAILURE                INACTIVE
    ON_HOLD                ON_ICE                 QUE_WAIT
    REFRESH_DEPENDENCIES   REFRESH_FILEWATCHER    RESTART
    RUNNING                STARTING               SUCCESS
    TERMINATED
event_time

Use this when you want to schedule an event at a given time. The argument should have the format 'YYYY/MM/DD HH:MM:SS'.

To force a job start at a given time:

    my $rc = $hdl->send_event(job_name => 'HAPPY_NEW_YEAR', event => 'FORCE_STARTJOB',
                              event_time => '2007/12/31 23:59:59');

To mark an job as inactive:

    my $rc = $hdl->send_event(job_name => 'JOB_42', event => 'CHANGE_STATUS', status => 'INACTIVE');

TODOs

Make the interface more "OO", e.g. allow the user to send an event directly from an CA::WAAE::Job object to the underlying job instead of having to use CA::WAAE->send_event().

Due to changes in the underlying database, different attributes of different types of jobs are stored in separate tables. We currently only get those attributes for command and sql job types.

There are lots of missing AutoSys features, e.g. "alarms".

SEE ALSO

CA::WAAE::Job

AUTHOR

Original CA::AutoSys code by Sinisa Susnjar <sini@cpan.org>

Updates by Douglas Wilson <dougw@cpan.org>

MODIFICATION HISTORY

See the CHANGES file.

COPYRIGHT AND LICENSE

Original CA::AutoSys code: Copyright (c) 2007 Sinisa Susnjar. All rights reserved.

This program is free software; you can use and redistribute it under the terms of the L-GPL. See the LICENSE file for details.