These batch operations are the kind that was being supported by LPT all along. 
These operations have an operation handler class that implements a 
run method and do everything inside that method. 
To define this kind of batch operations, you should select "Add Batch" from the pop-up menu.
Editor form of this kind of batch will be opened:

  • In this editor form, mandatory fields are marked with *.  Batch operation name is the unique identifier of the batch operation. Each batch operation should have a unique name that identifies it.
  • Operation ID field is the identifier of the batch operation, which defines the resource of this batch. Batch operations' language specific names are defined in resource list 12640. This operation ID field corresponds to the tag of the item in 12640 resource list. For instance, for operation ID equal to 10302, resource item with tag 10302 in 12640 resource list defines the batch's language specific name.
  • Workload defines the CPU load of the batch operation. It ranges from 1 to 5, from least CPU bound to most CPU bound. If the batch operation does a heavy calculation that uses CPU a lot, a high value such as 5 should be selected as the workload. 
  • Recoverable check box specifies whether this batch operation can be recovered from a server crash. If a server crash occurs while the operation was running, recoverable batches can recover themselves when the server is up and running again. Recovery should be implemented in batch operation handler class. For instance, if a batch operation saves each record it processed in database, then in case of a server crash, it can continue working from the last saved object. Not every batch operation can support this operation. Check this box if you are willing to implement a recoverable batch operation.

The bottom part of the editor, specifies the batch operation handler class. You can let LPT generate the batch handler class for you, or you can select an already existing class from your project. You can change the package in which auto generated class will reside. If you let LPT generate the class for you, the generated class will be similar to this: 

public class OrdinaryBatch extends BatchOperationBase
{
      public int run()
      {
            return 0;
      }
      public void setParams()
      {
      }
}
//Generated class have two methods, run is the main method to implement and return the status of the batch operation. setParams method should have your batch operation's parameters such as:
public void setParams(int start, int end)
{
      this.start = start;
      this.end = end;
}
//If your batch is a recoverable batch, then you should also implement recover method and perform recovery in that method:
public int recover()
{
      //TODOrecover
      return STATUS_COMPLETED;
}

Telif HakkıKullanım KoşullarıGizlilik
Copyright © 2018 Logo Yazılım