public class WorkflowDAO extends Object
WorkflowData storage. All WorkflowData returned from and persisted
with this service will be testrun-specific. The testrun-identifier is set in the constructor.| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_END_DATE |
static String |
FIELD_ID |
static String |
FIELD_START_DATE |
static String |
FIELD_STATE |
static String |
FIELD_TEST_RUN |
static String |
FIELD_USERNAME |
static String |
FIELD_WORKFLOW_DEFINITION |
static String |
FIELD_WORKFLOW_ID |
| Constructor and Description |
|---|
WorkflowDAO(com.mongodb.DB db,
String collection,
String testRun) |
| Modifier and Type | Method and Description |
|---|---|
long |
countWorkflows(org.alfresco.bm.data.DataCreationState state)
Count the workflows in the given state (for the current test run)
|
String |
createWorkflow(String workflowDefinition)
Create a new data object using the definition provided (for the current test run)
|
com.mongodb.DBObject |
findById(String id)
Find data by generated ID.
|
List<com.mongodb.DBObject> |
findWorkflows(org.alfresco.bm.data.DataCreationState state,
int count)
Find a number of processes with a given state (for the current test run)
|
void |
setEnded(String id,
Date endDate)
Mark a workflow as ended.
|
void |
setStarted(String id,
String username,
String workflowId,
Date startDate)
Mark a workflow as started.
|
void |
setState(String id,
org.alfresco.bm.data.DataCreationState state)
Mark a workflow as scheduled.
|
public static final String FIELD_ID
public static final String FIELD_WORKFLOW_DEFINITION
public static final String FIELD_WORKFLOW_ID
public static final String FIELD_USERNAME
public static final String FIELD_START_DATE
public static final String FIELD_END_DATE
public static final String FIELD_STATE
public static final String FIELD_TEST_RUN
public String createWorkflow(String workflowDefinition)
public com.mongodb.DBObject findById(String id)
public void setState(String id, org.alfresco.bm.data.DataCreationState state)
id - id of the workflow in Mongostate - the current state from a test perspectivepublic void setStarted(String id, String username, String workflowId, Date startDate)
id - id of the workflow in Mongousername - the name of the use that started the processworkflowId - id of the workflow in Alfrescopublic void setEnded(String id, Date endDate)
id - id of the workflow in Mongopublic long countWorkflows(org.alfresco.bm.data.DataCreationState state)
state - the state of the workflows or null to ignorepublic List<com.mongodb.DBObject> findWorkflows(org.alfresco.bm.data.DataCreationState state, int count)
state - the state of the workflows or null to ignorecount - number of results that should be returnedCopyright © 2016. All rights reserved.