org.alfresco.bm.eventprocessor
Class ScheduleWorkflows

java.lang.Object
  extended by org.alfresco.bm.event.AbstractEventProcessor
      extended by org.alfresco.bm.eventprocessor.ScheduleWorkflows
All Implemented Interfaces:
org.alfresco.bm.event.EventProcessor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class ScheduleWorkflows
extends org.alfresco.bm.event.AbstractEventProcessor

Schedule processing events.

Input

No input requirements

Data

A MongoDB collection containing unstarted workflows data.

Actions

The MongoDB collection is examined to find unscheduled workflows. They are scheduled up to a batch size after which this processor reschedules itself.

Output

EVENT_NAME_PROCESS: The process name
#EVENT_NAME_SCHEDULE_WORKFLOWS: No data

Since:
1.0
Author:
Derek Hulley

Field Summary
static int DEFAULT_BATCH_SIZE
           
static String EVENT_NAME_PROCESS
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
ScheduleWorkflows(WorkflowDataService workflowDataService, org.alfresco.bm.user.UserDataService userDataService, long timeBetweenProcesses)
           
 
Method Summary
 org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
           
 void setBatchSize(int batchSize)
          Set the size of the batches the unscheduled workflows will be started in.
 void setEventNameProcess(String eventNameProcess)
          Override the default event name to process an event
 
Methods inherited from class org.alfresco.bm.event.AbstractEventProcessor
getWarnDelay, register, setBeanName, setEventName, setEventNames, setRegistry, setWarnDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BATCH_SIZE

public static final int DEFAULT_BATCH_SIZE
See Also:
Constant Field Values

EVENT_NAME_PROCESS

public static final String EVENT_NAME_PROCESS
See Also:
Constant Field Values
Constructor Detail

ScheduleWorkflows

public ScheduleWorkflows(WorkflowDataService workflowDataService,
                         org.alfresco.bm.user.UserDataService userDataService,
                         long timeBetweenProcesses)
Parameters:
mongo - connection to MongoDB
processData - name of DB collection containing process details
processCount - total number of processes to schedule
timeBetweenProcesses - how long between each process
Method Detail

setEventNameProcess

public void setEventNameProcess(String eventNameProcess)
Override the default event name to process an event


processEvent

public org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
                                               throws Exception
Throws:
Exception

setBatchSize

public void setBatchSize(int batchSize)
Set the size of the batches the unscheduled workflows will be started in.

Parameters:
batchSize - size of a batch


Copyright © 2012. All Rights Reserved.