Tuesday, August 16, 2016

Add SysOperation Batch Job through code

static void addSysOperationBatch(Args _args) 
 { 
   #define.recurrenceStartTime('11:00') 
   #define.recurrenceInterval(1) 
   #define.noOfRetriesOnFailure(2) 
   BatchHeader                                 batchHeader; 
   BatchInfo                                   batchInfo; 
   SysRecurrenceData                           sysRecurrenceData; 
   utcDateTime                                 batchStartTime; 
   Batch                                       batch; 
   PurchReqAuthorizationBatchService        PurchReqAuthorizationBatchService; 
   PurchReqAuthorizationTaskDataContract    PurchReqAuthorizationTaskDataContract; 
   SysOperationServiceController               PurchReqAuthorizationBatchServiceController;
   ; 
   select firstOnly RecId from batch 
     where batch.ClassNumber == classNum(PurchReqAuthorizationBatchService) && 
       batch.Company == curext() && 
       batch.DataPartition == getcurrentpartition(); 
   if (!batch.RecId) 
   { 
     PurchReqAuthorizationBatchServiceController = new SysOperationServiceController(classStr(PurchReqAuthorizationBatchService), methodStr(PurchReqAuthorizationBatchService, process), SysOperationExecutionMode::Synchronous); 
     PurchReqAuthorizationTaskDataContract = PurchReqAuthorizationBatchServiceController.getDataContractObject(classStr(PurchReqAuthorizationTaskDataContract)); 
     batchInfo = PurchReqAuthorizationBatchServiceController.batchInfo(); 
     batchInfo.parmRetriesOnFailure(#noOfRetriesOnFailure); 
     // Create the batch job 
     batchHeader = BatchHeader::construct(); 
     batchHeader.addTask(PurchReqAuthorizationBatchServiceController);  
     
     batchStartTime = DateTimeUtil::newDateTime(systemDateGet(), str2time(#recurrenceStartTime), DateTimeUtil::getUserPreferredTimeZone()); 
     // Set the recurrence data 
     sysRecurrenceData = SysRecurrence::defaultRecurrence(); 
     sysRecurrenceData = SysRecurrence::setRecurrenceStartDateTime(sysRecurrenceData, batchStartTime); 
     sysRecurrenceData = SysRecurrence::setRecurrenceNoEnd(sysRecurrenceData); 
     sysRecurrenceData = SysRecurrence::setRecurrenceUnit(sysRecurrenceData, SysRecurrenceUnit::Day, #recurrenceInterval); 
     batchHeader.parmRecurrenceData(sysRecurrenceData); 
     // Set the batch alert configurations 
     batchHeader.parmAlerts(NoYes::No, NoYes::Yes, NoYes::No, NoYes::Yes, NoYes::Yes); 
     batchHeader.parmStartDateTime(batchStartTime); 
     // Save the batch job 
     batchHeader.save(); 
   } 
 } 

3 comments:

  1. I was diagnosed as HEPATITIS B carrier in 2013 with fibrosis of the
    liver already present. I started on antiviral medications which
    reduced the viral load initially. After a couple of years the virus
    became resistant. I started on HEPATITIS B Herbal treatment from
    ULTIMATE LIFE CLINIC(www.ultimatelifeclinic. com) in March, 2020. Their
    treatment totally reversed the virus. I did another blood test after
    the 6 months long treatment and tested negative to the virus. Amazing
    treatment! This treatment is a breakthrough for all HBV carriers.

    ReplyDelete
  2. My name is Olisa Blessing, I am so happy. I never believe I will be this happy again in life. I have worked as an air hostess ( cabin crew ) for 3years but early this year, I lost my job because of this deadly disease called Herpes virus (HSV). I never felt sick or notice any symptoms. Not until the day all workers were asked to bring their doctors report card, that was how I got tested and I found out that I'm HSV positive and that made me lose my job because it was considered as an STD and is an incurable disease. I was so depressed that I started thinking of suicide.
    I explained my situation to an older friend of mine, who often said to me 'a problem shared is a problem half solved. She felt so pity for me that she referred me to Dr. Utu Herbal Cure, that was how I contacted Dr. Utu and got the medication from him and was cured for real.
    I went back to my work a month later with another HSV negative test result and they carried out another test to be very sure and they found out I am herpes negative.
    Finally, the initial result was replaced with the new HSV negative test results and my responsibility was restored to me with an apology letter and a salary increase.
    Beware of impersonators,
    Dr. Utu can only be reached at:
    drutuherbalcure@gmail.com

    ReplyDelete
  3. I’d recommend using Dr. Utu Herbal Cure topically for instant pain and itch relief as well as accelerated healing of lesions and permanently stopping oral and genital herpes virus outbreaks. I have tried just about everything from acyclovir suppressive therapy to different natural oils, extracts, and other natural methods, some of which are EXTREMELY painful and exacerbate the problem (i.e. apple cider vinegar!). While vitamin E oil and suppressive therapy worked well for me, when I became pregnant I went back to trying to find a herbal cure. I was using vitamin E oil topically for a while but it was thin and difficult to use and only seemed to prevent further outbreaks rather than getting rid of it. I contacted Dr. Utu Herbal Cure through my friend. To my surprise, I could tell my outbreak was starting to heal within only a few hours! No more itching or pain! Dr. Utu Herbal Cure that I used was liquid herbs in bottles, so it was very easy to use. It simply whiffs, but it works so I don’t care! The best part is I successfully delivered a herpes-free beautiful daughter without further medication. Anyone who’s tried Dr. Utu Herbal Cure knows just how quickly those treatments can add up. So give it a try! Anyone can reach Dr. Utu through drutuherbalcure@gmail.com
    +2349072733661.

    ReplyDelete