Scheduling multiple tasks dynamically

Hi !
I'm working on schedulers.
My problem is I have a list of dynamically generated reports.For every report that is generated , a corresponding scheduler must run periodically say , every day at certain time. The time at which the scheduler must run will be inputted by the user for each report.
I was able to run the scheduler perfectly if there was just one report. But whenever I have more than 1 report , I'm unable to handle.
Please suggest any idea or solution for this.
My scheduler will start when my application server is started.
I'm using a class that extends TimerTask class.
Thanks in advance,
Chandrika

Hi !
A'rite here is the code ....
I'm using a struts frame work , where in I'm using a plugin. From the plugin i'm calling the scheduler.
The PLUGIN class is as below:
public class CJobPlugIn implements PlugIn
     private static String CLASS_NAME = "CJobPlugIn";
     public CJobPlugIn()
          System.out.println("IN CJOb plugin Construtor");
     }//constructor
     * this method will be call at the end of an application
     * @return     void value
     public void destroy()
          String strMethodName = "destroy()";
          try
          CJobNightly.stop();          
          catch (Exception e)
               e.printStackTrace(System.out);
     }// destroy()
public void init(ActionServlet servlet,ModuleConfig moduleConfig) throws ServletException
          System.out.println("In Init() of Plug IN");
          String strMethodName = "init()";
          try
          CJobNightly.start();                    
          catch (Exception e)
               e.printStackTrace(System.out);
     }// init()
}// CJobPlugIn
Here ends the plugin.
Now the Scheduler Class:
public class CJobNightly extends TimerTask
     private static Timer cron;                    private static int run_hour;                    private static int runmins;               
     private static int dayin_mills;               
     private static boolean doRun;                    private static boolean inProcess;                    private static String trueStartTime;                    //to hold date in string value
     private static Date runDate;                    //Date objet , to hold start date
     private static String CLASS_NAME = "CJobNightly";     //class name
//     private Logger logger =null;
     public CJobNightly()
          //logger variable initialization
     //static block which sets the data porting time
     static
          runhour = 16;
          runmins = 35;
          dayin_mills = 24 * 60 * 60 * 1000;
          _cron = new Timer();
          trueStartTime = new Date().toString();
          // runDate = getStartDate();
          runDate = new Date();
          inProcess = false;
public static synchronized void start()
          //scheduling jobremainder to specifed date      
     _cron.schedule(new CJobNightly(), runDate);
     doRun = true; //setting doRun=true
public static synchronized void stop()
     doRun = false;
     //stoping the job porting
     _cron.cancel();
     public void run()
     String strMethod = "run()";
     // logger.info(strMethod+"constructor - Run :" + doRun);
     if (doRun)
               startJob();
     _cron.schedule(new CJobNightly(), 1 * 60 * 1000);
     //logger.info(strMethod+" Run - _cron:" + _cron);
public static synchronized boolean isRunning(){
     return(doRun);
public static synchronized void remoteStart()
     doRun = true;
public static synchronized void remoteStop()
     doRun = false;
public static synchronized void switchRunMode()
          if (doRun)
          doRun = false;
          else
          doRun = true;
public void startJob()
          ExcelProcessing ep = new ExcelProcessing();
          String strFileName = "D:/Book1.xls";
          String strSheet1 = "Sheet1";
          try{
               HSSFWorkbook wb1 = new HSSFWorkbook();
                              wb1 = ep.readExcel(strFileName);
               if(ep.worksheetExists(strSheet1,wb1)){
                    wb1 = ep.processSheet(wb1,strSheet1);
                    boolean flag = false;
                    flag = ep.writeExcel(strFileName,wb1);
               else{
                    System.out.println("work sheet do not exist");
          catch(Exception e){
               System.out.println("Catch");
               e.printStackTrace();
               System.out.println(e.toString());
}// startJob()
I'm writing into an excel whenever the scheduler gets fired.So i used the
HSSF , POI.jar.
Please suggest a solution or idea tht will enable me to move further.
Thanks ,
chandrika.

Similar Messages

  • Assigning Multiple tasks in process dynamically

    Hello,
    Please help me out in solving following problem
    Scenario:
    Step 1: Query the DB get all the Products (Multiple rows).
    Step 2: For each Product merge the product information to a template, rendering it as PDF and Assigning it to a user(Assign Task Activity)
    With out waiting for the user action i would like to repeat step 2 so that i can assign all product information as different task dynamically
    Can any one please help meto achieve this?(PFA Process Design diagram)
    Thanks in advance
    Regards
    Rao

    This is more tricky than it sounds.
    You could use a gateway with one branch that goes to the User step and another branch that goes straight to the end of the gateway and set the gateway to No Wait.
    Then, from the end of the gateway object loop back to the start of the gateway so that it assigns it to the next person.
    In the next version of LiveCycle, you should be able to use the Mutli User Task operation to assign a task to multiple users in parallel.
    Jasmin

  • Dispatch center - Select multiple tasks for scheduling at the same time

    Hi!
    I need a consultation regarding Dispatch center. Is there a functionality to select multiple tasks for scheduling at the same time for one resource?
    Please, guys, this is urgent.
    Jan

    You can schedule a single task or multiple tasks automatically directly from the
    dispatch center. The scheduling criteria applied come from Advanced Scheduler.
    Make Sure, you have the advanced scheduler. With out Advanced Scheduler and by just using Advice, you can only assign one task at a time.
    HTH
    ps: for more information, refer Field Service User Guide, "Scheduling Tasks"

  • Need to find a calendar to schedule multiple assignments with multiple tasks set on specific days for multiple people

    There may be no such animal as what I am searching for, but I thought I'd give it a try.
    What I need to do is find a calendar app that allows me to have individual calendars for staff members that I can place a several-days-long assignment and have those people access remotely on an iPad or iPhone (autosync).
    I also want to be able to have tasks set on specific days within that assignment that have alerts/reminders for each stage of the assignment.
    Being able to custom colour each individual assignment (not just the person's own calndar) is also necessary, as these asignments overlap and need to be easily distinguishable at a glance. Each assignment needs to be its own entity and not affect any furture or previous entries, even if I choose the same colour.
    It needs to be in a month by month view and be able to be something each person can subscribe to and sync up with for changes on a daily basis. It does nothave to be a calendar like in the screen shot below, it could be a linear calendar that has days across the top and assignments down the left side.....
    Here is a screen shot of a rudimentary excel spreadsheet I have been using. It is awkward and becoming unmanageable as the number of assigments increases and more staff are being added on. And I must send a new spreadsheet out every time I make a change or add an assignment, which is several times a week.
    I suspect I may be asking for the world, but if anyone knows a direction I can go in to start a search, I'd be grateful. I haven't had success of my own so far and need to find something soon.
    iCal doesn't work for me due to the fact I can only colour code the calendar itself and not the event, plus not being able to have multiple tasks within one event. And the qty of assignments I'd have would see most getting lost, eliminating my abilty to see every staff member's assignmanet at the same time.
    Thank you in advance if you have a suggestion and if not, thanks for looking at my dilemma! 

    check with T-code TPM44
    zashok

  • [Forum FAQ] Schedule multiple versions of System Image Backup in Windows 8.1

    As we known that there is no UI for user to configure Image backup in Windows 8.1, this is a guide for your to schedule multiple versions of System Image Backup.
    Step 1: Create a task to schedule an image backup with following command:
    SCHTASKS /Create /SC WEEKLY /D MON /TN WeeklyFullBackup /RL HIGHEST /ST 13:00 /TR “wbAdmin Start Backup -backupTarget:F: -include:C: -allCritical -quiet”
    Step 2: Schedule a robocopy to backup the saved image with BAT file:
    Please create a new folder (in this example, the new folder is e:\test2) to save your multiple copies of image backup:
    Write following batch file to copy backup and rename with backup date:
    *****************BAT********************
    @echo off
    robocopy e:\test1\ e:\test2\ test.wim
    ren e:\test2\test.wim  test_%date:~10,4%%date:~7,2%%date:~4,2%_%time:~0,2%%time:~3,2%.wim
    NOTE: e:\test2 is my location to save multiple copies of image backup; e:\test1 is the location I create the system image backup.
    This BAT can also help to rename the copy of image backup with date and time like below:
      3.  Set up a basic task in Task schedule:
    Note: please make sure the time you configured follows the time you set for image backup in Step 1.
    Action -> Create basic task (Name you task) -> Trigger (Set how often this task should be run) -> Action (Start a program) -> Under Program/script, point to your bat file you create in Step 2.b -> Finish
    At the end, you can know more about SCHTASKS and Robocopy via following links:
    Robocopy
    http://technet.microsoft.com/en-us/library/cc733145.aspx
    Schtasks
    http://technet.microsoft.com/en-us/library/cc725744.aspx
    Welcome to your feedbacks.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hi,
    Thanks for posting in Microsoft TechNet forums.
    I will try to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Regards,
    Kelvin Xu
    TechNet Community Support

  • Create multiple Task Instance from one Task Instance

    We have a process, where user can request for multiple resources(access) in one single request.Currently user has to wait until all the resource requests are approved by application owners to start the provisioning process.
    I am thinking of splitting that one request(task) into multiple task, based on the number of resources requested.so that, if one resource request is approved user can get that particular access.
    My question :
    1.How will I split the one task into multiple task and pass the required information to child task?
    2.How do I handle views?Currently since its one task , we checkout and check-in the same view.
    3.How will I overcome the possibility of one view overwritten by the other.
    Thanks.

    We have a process, where user can request for
    multiple resources(access) in one single
    request.Currently user has to wait until all the
    resource requests are approved by application owners
    to start the provisioning process.
    I am thinking of splitting that one request(task)
    into multiple task, based on the number of resources
    requested.so that, if one resource request is
    approved user can get that particular access.
    My question :
    1.How will I split the one task into multiple task
    and pass the required information to child task?
    2.How do I handle views?Currently since its one task
    , we checkout and check-in the same view.
    3.How will I overcome the possibility of one view
    overwritten by the other.
    Thanks.Hi,
    yes u can split one task into multiple task means as ur requirment diffrent task for different resource. so u have to write diffrent W/F for each resource and call them by setting a counter for number of resource.
    the below code help u.
    <Variable name='index'>
              <i>0</i>
         </Variable>
    <Activity id='1' name='createNewTask'>
              <Action id='0' name='createView' application='com.waveset.session.WorkflowServices'>
                   <Argument name='op' value='createView'/>
                   <Argument name='type' value='Process'/>
                   <Argument name='viewId' value='Process'/>
                   <Argument name='taskName'>
                             <s>give any name to the task</s>
                   </Argument>
                   <Argument name='process'>
                             <s>task name that u want to launch</s><!-- u can get task name dynamicly by rule also by passing resource name -->
                   </Argument>          
                   <Argument name='accountId' value='$(accountId)'/><!-- pass the required information to child task as argument -->
                   </Action>
                   <Action id='1' application='com.waveset.session.WorkflowServices'>
                   <Argument name='op' value='checkinView'/>
                   <Argument name='view'>
                        <ref>view</ref>
                   </Argument>
                   </Action>
                   <Action id='2'>
                        <set name='view'>
                        <null/>
                        </set>
                   </Action>
                   <Transition to='incrementIndex'/>
    </Activity>
         <Activity id='2' name='incrementIndex'>
              <Action id='0'>
                   <set name='index'>
                        <add>
                             <ref>index</ref>
                             <i>1</i>
                        </add>
                   </set>
              </Action>
              <Transition to='createNewTask'>
                   <lt>
                        <ref>index</ref>
                        <ref>length</ref><!-- number of resource-->
                   </lt>
              </Transition>
              <Transition to='end'/>
         </Activity>

  • How to add multiple tasks to the worklist view?

    Hi,
    We are creating a view based on our BPM process and we are using OBPM 11.1.1.4. We do have 2 human workflow tasks in the process.
    While creating views in the worklist we are able to add only one task is there a way to add multiple tasks to one view?
    Thanks a lot for the help in advance.

    Hi Mikael,
    First of all, which Project Server version do you use?
    I'd like to be sure to correctly understand your concern. You would like to have more than 1 task list in your project site, am I right? I'm a bit confused since you talk about both project site and project center.
    First notice that the default task list is related to the project Schedule, ie when a task is updated in the project, the list will be updated accordingly.
    With Project Server 2013, I could open a project site, navigate to "site content", select the task app and create a new task list. This new list will be created as a blank list not related to the schedule neither the default task list.
    Note that there is a list setting which triggers wheither or not the list link will be added to the navigation menu of the left side (list settings, List name, description and navigation).
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Regarding ssis - schedule multiple packages at a time

    Hi,
       how do we schedule multiple packages at a time in ssis

    You could create a master package with Execute Package Tasks to execute child packages and then use SQL Server Agent to schedule the master package.
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • Schedule a task for a given period of time

    Hi,
    any body has an idea how to schedule a task for a specified period of time. e.g A program keeps on asking for your name to be input for an hour and then start doing something else?
    /bob

    hi friend,
    Why don't you try using a TIMER. Try using this code
    Timer timer = new Timer((TIMER), new ActionListener()
         public void actionPerformed(ActionEvent ae)
    // perform your task here...
    timer.setInitialDelay(TIMER);
    timer.setRepeats(true);
    timer.start();
    I think this will work fine.
    Bye,
    Ravi.

  • Mx-DAQ multiple tasks

    Hello,
    Im using LV7.1 with NI-Daq 7.4.
    in my Application i use multiple tasks, a few for aquiring analog and digital input from my first 6024E and one to aquire digital input from my second 6024E.
    In most of the time this works very well, but from time to time, when the mxdaq read VI for the second task is executing for the first time, an error message occurs. This erromessage tells me, that i passing an empty string instead of an task reference to the mxdaq read VI of my second card. After Reexecuting my App it works fine without creating error messages until I reboot. For me it looks like an initialization/synchronization problem. Both cards are properly installed and visible/testable in MAX.
    For syncroniziation of these cards i use the same MX-DAQ clock source.
    Perhaps i have to reconfigure the task initailization but i dont know what is wrong.
    thank for help

    I'm guessing that the reason that you only see this sometimes is that it is a race condition between the read call and task creation. I've seen this problem before and the cause is usually that you are trying to read before your task is created. This can be caused by using an asynchronous process to create your channels/tasks apart from doing your multi-channel reads. To eliminate this problem I suggest you write your application in such a way that you create all of your tasks first, before trying to read from any of them. The easiest way to do this is to wire up your create task VI's in order before your reads, as these VI's will block until they complete task creation.
    Hope this helps,
    DB

  • Creating multiple tasks

    I am using the CVI plug-in for MSVC.  My application requires that I toggle a set of digital lines based on a user's input.  For a variety of reasons I would like to initialize my DAQ task handles at the start of the program so that when I need to toggle the lines I just call Run and Stop.
    Some of my tasks use the same lines.  I know that if I try to define multiple tasks using the same lines that I will get an error (-200089). 
    My question is this: Is there a clever way to pre-define my tasks at the start of the program even if they use the same lines? 
    Thanks. 

    UGH!  Cut and paste got me.  Stupid syntax error.  I can do what I wanted to do.

  • Synchronize multiple tasks and multiple boards with X-series USB devices

    Hi all,
    I am trying to figure out how to synchronize multiple tasks across multiple X-series USB boards (6353, to be precise). 
    I have to run a digital output task AND an analog output task on each board.  All four tasks (the DO and AO on Board 1, and the DO and AO on Board 2) must be synchronized.
    I know how to synchronize multiple tasks on a single board.  I've been doing that for years.  That works fine.
    I know how to synchronize a single task across multiple boards (say, a DO task across 2 different boards).  That works fine too.
    For the life of me, I can't figure out how to marry the two.  Everything I've seen, all of the examples, etc. assume you want to do one or the other, or that you have a RTSI cable available.  Are there any examples out there that synchronize multiple tasks across multiple USB boards?
    I tried exporting the AO clock signal from my master AO task to PFI12, and then using the signal on PFI12 to as the clock source for the remaining tasks (Dev1/PFI12 physically connected to Dev2/PFI12, and Dev1/PFI12 set as the clock source for Dev1's DO task). 
    I have also tried setting Dev1/aoSampClock as the source for Dev1's DO task.
    Under both configurations, I invariably get error -89137 when I try to start the tasks -- required resources (PFI12) in use by Dev1/do/SampClock.  I understand what the error is telling me.  What I don't understand is why I'm receiving this error when I don't have any of my tasks configured to use the DO Sample Clock.  It seems as though it is not possible to export a clock signal to a PFI line and simultaneously run a clocked digital task, even if the clock source for that task is specified as something other than the DO Sample Clock?
    So, my question is, is it possible to do what I want to do?  And if so, how do I do it?  How do I configure a common clock source across multiple tasks running on multiple USB boards?
    Hoping for insight from those wiser than I...
    Diane
    Solved!
    Go to Solution.

    Update:  I decided to try using a counter as the source clock.  One cannot use counter 0 to accomplish this, but it does appear to work with counter 1.
    I'll take what I can get.  Fortunately I have two spare counters.  (Yes, I'm running counter tasks too -- 6 of them -- but they don't have to be synchronized.)
    I have to add both digital and analog input tasks as well -- all synchronous with each other, but not with the output tasks since they'll be running at different sample rates.  I hope I'm able to use a counter as the source clock for those as well.
    My head aches.

  • Creating multiple tasks in labview fpga

    Hi,
    I need to create multiple tasks in labview fpga....I need to set one update period in each task so that i can make my while loop run at this rate everytime my input frequency changes....How do i do this?

    Hi,
    just to be sure: You are talking about multiple tasks on the FPGA to acquire data? Or do you want to have multiple tasks on the host to display the data?

  • Create Multiple tasks for Single Item in List using state machine workflow in sharepoint

    Hi,
    I want to create multiple create tasks for Single Item in List based on Assigned to column using state machine Workflow through visual studio
    Here Assigned to column allows multiple users. so i have to create task for every user based on column .
    I'm trying for this but i didn't got any solution
    Please provide solution for this.

    Hi,
    According to your post, my understanding is that you wanted to allow multiple users to approve.
    There are some articles about creating parallel tasks in state machine workflow, you can have a look at them.
    http://www.codeproject.com/Articles/477849/Create-Parallel-Task-in-State-Machine-Workflow-in
    http://msdn.microsoft.com/en-us/library/office/hh128697(v=office.14).aspx
    http://social.technet.microsoft.com/Forums/office/en-US/b16ee858-4360-479a-a686-4ee35b7be9db/sharepoint-2010-workflow-creating-multiple-tasks?forum=sharepointdevelopmentprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Schedule multiple jobs/test runs

    Hi,
    Is there a way to schedule multiple jobs/test runs with oats 9.10?
    It seems it is only possible to schedule a single job, by setting the start time in OLT...
    Any suggestions?

    Hi
    I'm talking about functional tests.
    In OLT when you set the auto-pilot you can schedule the test to start after a delay of xxx minutes or at some exact time, however I have never used that fixture.
    Regards
    Alex

Maybe you are looking for

  • HP C7283 All-In-One and wireless issues

    I have the C7283 All-In-One hooked up on my home network.  I'm running a Linksys wireless router (WRT54G) and sending prints to the unit that way.  My main computer is an iMac with 10.5 and the latest drivers (2/2008) for the HP software. The print j

  • In return order price should copy from the invoice

    Dear All, Greetings for the day, We are facing with the below issue, please help to resolve the issue. We have one discount condition type; scales have been maintained for that condition type. The scales are like below Up to 10,000 liters - 0% Above

  • Collect calling

    Can we receive collect calls on our Verizon wireless phones from a jail

  • How to view records frm higher to lower using sql statement

    Dear all i have tables RATING: 50 76 55 60 80 90 95 100 20 30 32 34 i want to view this record into higher to lower and 5 records only will appear in sql .. Like this : 100 95 90 80 76 thank you very much

  • Write serial data directly to file

    I am using DasyLab 9. I am reading a com port for serial data. if i issue the command to output a log of stored data from the RSMASTER when the program is not running I get all the data that is in the log. however, when I run the program and send the