org.alfresco.bm.eventprocessor
Class PrepareWorkflows

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

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

Prepare a specific number of workflows.
This merely creates the test-local data that will be used for later processing, the actual processes aren't started yet.

Input

No input requirements

Data

A MongoDB collection (either empty or with existing process data).

Actions

Examines the MongoDB collection and ensures that there are at least a certain number of unfinished workflows existing.

Output

EVENT_NAME_WORKFLOWS_CREATED: No data

Since:
1.0
Author:
Frederik Heremans

Field Summary
static List<String> DEFAUL_WORKFLOW_DEFINITIONS
           
static String EVENT_NAME_WORKFLOWS_CREATED
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
PrepareWorkflows(WorkflowDataService workflowDataService, long workflowCount)
           
 
Method Summary
protected  String getWorkflowDefinition(long number)
          Get the workflow-definition to use for a new process
 org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
           
 void setEventNameWorkflowsCreated(String eventNameWorkflowsCreated)
          Override the default event name when processes have been created.
 void setWorkflowDefinitions(List<String> workflowDefinitions)
          Set the worklfow-definition id's that will be used when creating new processes.
 
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

EVENT_NAME_WORKFLOWS_CREATED

public static final String EVENT_NAME_WORKFLOWS_CREATED
See Also:
Constant Field Values

DEFAUL_WORKFLOW_DEFINITIONS

public static final List<String> DEFAUL_WORKFLOW_DEFINITIONS
Constructor Detail

PrepareWorkflows

public PrepareWorkflows(WorkflowDataService workflowDataService,
                        long workflowCount)
Parameters:
workflowDataService - service to use
workflowCount - number of workflows to create
Method Detail

setEventNameWorkflowsCreated

public void setEventNameWorkflowsCreated(String eventNameWorkflowsCreated)
Override the default event name when processes have been created.


processEvent

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

setWorkflowDefinitions

public void setWorkflowDefinitions(List<String> workflowDefinitions)
Set the worklfow-definition id's that will be used when creating new processes. They will be selected using round-robin mechanism.

Parameters:
workflowDefinitions - the definitions to use. This should be a fully-qualified workflow definition id, including engine-id. Eg. activiti$adhoc

getWorkflowDefinition

protected String getWorkflowDefinition(long number)
Get the workflow-definition to use for a new process

Parameters:
number - a workflow number, cycling back to start if it exceeds the number of workflows


Copyright © 2012. All Rights Reserved.