Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

16.2.3 Job Net Manipulation (Startup Parameter Specification) API

This section explains the job net manipulation (startup parameter specification) API (Mp_JobschControlParam).

Synopsis

[Windows]

#include "f3csbJobschControl.h"
int Mp_JobschControlParam (char *project,
               char *netname,
               char *parameter,
               int action,
               int rerunopt,) ;

[UNIX]

#include "jobschapi.h"
int Mp_JobschControlParam (char *project,
               char *netname,
               char *parameter,
               int action,
               int rerunopt,) ;

Description

This API is an interface to use the jobschcontrol command from the C interface. Using the API allows you to pass parameters to each job in the job net to start.

Only the job nets with the Job Execution Control attribute can be used.

Parameters

project

Specify the name of a project in which the job net to be manipulated exists. Note that you can only specify the project name of the projects that the API execution user can use.

This can be omitted if there is only one project registered in the job net that the API execution user can use. In this case, NULL must be specified.

netname

Specify the name of the job net to be manipulated. This cannot be omitted.

parameter

Specify a parameter to be passed to each job of the job net to be started by a string within 200 bytes for startup or restart.

Note that for a job net manipulation other than startup and restart, specify NULL (this value is ignored when a string is specified).

When a string is specified:

The parameter specified is appended to the end of job argument.

When NULL is specified:

At restart, the parameter specified when the job was started last is appended to the end of job argument. At startup, no parameter is specified.

action

Specify the job net manipulation method from the following:

1:

Start

2:

Cancel

3:

Restart

4:

Pause

5:

Continue

6:

Disable

7:

Enable

8:

Confirm

9:

Reinstate

10:

Revoke

rerunopt

Specify the option when 3 (Restart) is selected for action. If 3 (Restart) is not selected for action, 0 should be specified.

0:

Performs normal re-activation. Activates from an abended job. If the restart point is set at a job located before the abended job, restart is executed from that job.

1:

Restarts the job net from the top job.

2:

Re-activates a job net set in "Invalid at next restart" mode in relation to an abended job.

(Skips the abended job and activates the next job).

Jobs forcibly terminated are handled in the same way as abended jobs are handled.

Return Values

Return Value

Meaning

Action

0

Normal termination.

-

4

Mode in which job net cannot function.

Perform the operation again after the status of the job net has changed.

8

Jobscheduler service/daemon is not running.

Start the Jobsheduler service or daemon and perform the operation again.

12

One of the following:

  • Error in parameter setting or invalid user privilege.

  • Error in user access privileges setting

  • Either the specified project or job net does not exist, or the job net has been copied using "copy and startup" operation, or the job net does not have Job Execution Control attributes.

Take one of the following measures:

  • Set the correct parameter (project name, job net name, parameters passed to job, operation method or restart option).

  • Grant the executing user access privileges to operate the project or higher privileges.

  • Specify a job net that can be operated on.

16

Fatal error occurred.

A system error may have occurred. Check the event log or syslog for any system abnormalities. If an error occurs, collect Jobscheduler information using the Maintenance Information Collection Tool, and then contact a Fujitsu SE. If none are found, the problem may only have been temporary, so perform the operation again.

20

Job nets that have been started with variable parameters cannot be restarted using this API.

Use the job net manipulation API to restart the job net using the variable parameter specified when the job net was started.

Required Files

The following files are required for use of the job net manipulation API shown above:

[Windows x86]

LIB:

f3csbJobschControl.lib

INCLUDE:

f3csbJobschControl.h

[Windows x64]

LIB:

f3csbJobschControl_x64.lib

INCLUDE:

f3csbJobschControl_x64.h

[Common to Solaris 32-bit and Linux x86]

LIB:

libjobsch.so

INCLUDE:

jobschapi.h

[Solaris 64-bit]

LIB:

libjobsch_64.so

INCLUDE:

jobschapi_64.h

[Linux x64]

LIB:

libjobsch_x64.so

INCLUDE:

jobschapi_x64.h

The job net manipulation API is stored in the LIB file, and the definitions and structures used by the job net manipulation API are declared in the INCLUDE file. These files are stored under the following directories.

[Windows]

LIB:

Systemwalker Operation Manager installation directory: MpWalker.JM\lib

INCLUDE:

Systemwalker Operation Manager installation directory: MpWalker.JM\include

[Common to Solaris and Linux]

LIB:

/opt/FJSVJOBSC/usr/lib

INCLUDE:

/opt/FJSVJOBSC/usr/include

Caution

Program Example

Below is an example program of the job net manipulation API:

[Windows]

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "f3csbJobschControl.h" 

void main()
{
    int ret;

    ret = Mp_JobschControlParam("user1",               // project name
                                "net001",              // jobnet name
                                "param1",              // parameter 
                                1,                     // action : start
                                0);                    // rerun opt : none

    if (ret == 0) {
        printf("jobnet(net001) was normally controlled.\n");
    }
    else{
        printf("ERROR: return code = %d\n", ret); 
        exit(1);
    }
    exit(0);
}

[UNIX]

#include <stdio.h>
#include <stdlib.h>
#include "jobschapi.h" 

main()
{
    int ret;

    ret = Mp_JobschControlParam("user1",                /* project name*/
                                "net001",               /* jobnet name  */
                                "param1",               /* parameter    */
                                 1,                     /* action : start */
                                 0);                    /* rerun opt : none*/

    if (ret == 0) {
        printf("jobnet(net001) was normally controlled.\n");
    }
    else{
        printf("ERROR: return code = %d\n", ret);
        exit(1);
    }
    exit(0);
}