public class WorkflowDataService extends Object implements org.springframework.beans.factory.InitializingBean
WorkflowData storage. All WorkflowData returned from and persisted
with this service will be testrun-specific. The testrun-identifier is set in the constructor.| Constructor and Description |
|---|
WorkflowDataService(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collectionName,
String testRun) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
long |
count()
Count the total number of workflows.
|
long |
countFinishedWorkflows()
Count the total number of finished workflows.
|
WorkflowData |
findById(String workflowId)
Find data by id.
|
List<WorkflowData> |
findUnscheduledProcesses(int maxCount)
Find a number of unscheduled processes.
|
void |
insert(WorkflowData data)
Insert the given
WorkflowData object. |
void |
markWorkflowAsEnded(String id)
Mark a workflow as ended.
|
void |
markWorkflowAsScheduled(String id,
String userName)
Mark a workflow as scheduled.
|
void |
markWorkflowAsStarted(String id,
String workflowInstanceId)
Mark a workflow as started.
|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic WorkflowData findById(String workflowId)
workflowId - id of the workflow in mongopublic void markWorkflowAsStarted(String id, String workflowInstanceId)
id - id of the workflow in mongoworkflowId - id of the workflow in alfrescopublic void markWorkflowAsScheduled(String id, String userName)
id - id of the workflow in mongouserName - name of the users that will run the workflowpublic void markWorkflowAsEnded(String id)
id - id of the workflow in mongopublic long count()
public long countFinishedWorkflows()
mongo - collectionName - public void insert(WorkflowData data)
WorkflowData object. A new id will be assigned?data - the data to insertpublic List<WorkflowData> findUnscheduledProcesses(int maxCount)
maxCount - maximum number of results that should be returnedCopyright © 2013. All Rights Reserved.