Oracle WebCenter Interaction Web Service Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Starting Portal Jobs Using Oracle WebCenter Interaction Development Kit (IDK) Remote APIs

To start an existing Oracle WebCenter Interaction job from a remote application, use the IJobManager interface in the Oracle WebCenter Interaction Development Kit (IDK).

A job is a collection of related portal operations. Each operation is one task, such as a crawl for documents, an import of users, or one of the system maintenance tasks. The return code from starting a job indicates whether or not the call was successful (whether or not the object is locked). See the Oracle WebCenter Interaction Development Kit (IDK) API documentation for LockStatus for more information on what each return value indicates.

To start a portal job, follow the steps below.

  1. Create a session with the portal. For details, see Initiating a PRC Session to Use Oracle WebCenter Interaction Development Kit (IDK) Remote APIs.
  2. Retrieve an IJobManager by calling IRemoteSession.getJobManager.
  3. Query for the objectID of the job. For details, see Querying Object Properties Using Oracle WebCenter Interaction Development Kit (IDK) Remote APIs.
  4. Create a new method to start a job and start the job as shown in the code below. It is a best practice to check the return code in the response and print out a description.
    Note: The startJob method does not technically start the portal job; it sets the start time for the job to the current time. If there are problems that prevent the job from running once it is rescheduled, they are not accessible from this call.
This example checks to see if the job object is locked. If it is unlocked, the code assumes that the job will start.

Java

public static voidstartJob(IJobManager jobManager, int jobID)
{
 int status = jobManager.startJob(jobID);

 if(status == LockStatus.UNLOCKED) //LockStatus.UNLOCKED = 0
 System.out.println("Job started successfully");
 else
 System.out.println("Job failed to start"); 
}

.NET (C#)

public static voidStartJob(IJobManager jobManager, int jobID)
{
 int status = jobManager.startJob(jobID);

 if(status == LockStatus.Unlocked) //LockStatus.Unlocked = 0
 Console.WriteLine("Job started successfully");
 else
 Console.WriteLine("Job failed to start"); 
}

.NET (VB)

Public Shared SubStartJob ByVal jobManager As IJobManager, ByVal jobID As Integer)

 Dim objectManager As Integer = jobManager.StartJob(jobID)

 If status = LockStatus.UnlockedThen 'LockStatus.Unlocked = 0
 Console.WriteLine "Job started successfully");
 Else
 Console.WriteLine("Job failed to start"); 
 End If
End Sub

  Back to Top      Previous Next