public class OnPremiseWorkflowServiceImpl extends AbstractWorkflowService
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<OnPremiseWorkflowServiceImpl> |
CREATOR |
CONTENT_CACHE, RENDITION_CACHE, session
FILTER_ASSIGNEE_ALL, FILTER_ASSIGNEE_ME, FILTER_ASSIGNEE_UNASSIGNED, FILTER_DUE_7DAYS, FILTER_DUE_NODATE, FILTER_DUE_OVERDUE, FILTER_DUE_TODAY, FILTER_DUE_TOMORROW, FILTER_INITIATOR_ANY, FILTER_INITIATOR_ME, FILTER_KEY_ASSIGNEE, FILTER_KEY_DUE, FILTER_KEY_INITIATOR, FILTER_KEY_PRIORITY, FILTER_KEY_STATUS, FILTER_NO_ASSIGNEE, FILTER_PRIORITY_HIGH, FILTER_PRIORITY_LOW, FILTER_PRIORITY_MEDIUM, FILTER_STATUS_ACTIVE, FILTER_STATUS_ANY, FILTER_STATUS_COMPLETE
Constructor and Description |
---|
OnPremiseWorkflowServiceImpl(AlfrescoSession repositorySession) |
OnPremiseWorkflowServiceImpl(android.os.Parcel o) |
Modifier and Type | Method and Description |
---|---|
void |
addDocuments(Task task,
List<Document> items)
Add a list of items to the the specified task.
|
Task |
claimTask(Task task)
Claiming a task is done by one of the candidates of a task, task owner or
process-initiator
|
Task |
completeTask(Task task,
Map<String,Serializable> variables)
Completing a task.
|
PagingResult<Document> |
getDocuments(Process process,
ListingContext listingContext) |
PagingResult<Document> |
getDocuments(Task task,
ListingContext listingContext) |
protected PagingResult<Document> |
getItems(String id,
ListingContext listingContext) |
Process |
getProcess(String processId)
Retrieves a single process.
|
ProcessDefinition |
getProcessDefinition(String processDefinitionIdentifier)
Returns a single process definition.
|
PagingResult<ProcessDefinition> |
getProcessDefinitions(ListingContext listingContext) |
ContentStream |
getProcessDiagram(Process process)
This process diagram shows a user the context of the task that is being
performed.
|
ContentStream |
getProcessDiagram(String processId)
This process diagram shows a user the context of the task that is being
performed.
|
org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getProcessDiagramUrl(String processId) |
PagingResult<Process> |
getProcesses(ListingContext listingContext)
Returns a list of process.
|
protected org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getProcessUrl(Process process)
Internal method to retrieve a specific process url.
|
Task |
getTask(String taskIdentifier)
Retrieves a single task by its id.
|
PagingResult<Task> |
getTasks(ListingContext listingContext)
Returns a list of tasks that the authenticated user is allowed to see.
This method support the use of ListingFilter
inside the ListingContext parameter to get task that meet certain
criteria like WorkflowService.FILTER_KEY_ASSIGNEE , WorkflowService.FILTER_KEY_STATUS ,
WorkflowService.FILTER_KEY_PRIORITY , WorkflowService.FILTER_KEY_DUE . |
PagingResult<Task> |
getTasks(Process process,
ListingContext listingContext)
Get the tasks for the specified process.
|
Map<String,Property> |
getVariables(Process process)
Retrieves the variables for a given process.
|
Map<String,Property> |
getVariables(Task task)
Retrieves the variables for a given task.
|
Task |
reassignTask(Task task,
Person assignee)
Reassign the task from the owner to an assignee
|
Process |
refresh(Process process)
Returns the latest (and complete) variables for the provided process.
|
Task |
refresh(Task task)
Returns the latest (and complete) variables for the provided task.
|
void |
removeDocuments(Task task,
List<Document> items)
Delete a list of items to the the task.
|
Process |
startProcess(ProcessDefinition processDefinition,
List<Person> assignees,
Map<String,Serializable> variables,
List<Document> items)
Start a new process based on the specified process definition with an
optional set of variables and document attachments(items).
Variables keys must respect the same format as defined by the workflowModel inside the repository. |
Task |
unclaimTask(Task task)
This removes the assignee of the task i.e the current user.
|
Process |
updateVariables(Process process,
Map<String,Serializable> variables)
Update the variables for a given process.
|
Task |
updateVariables(Task task,
Map<String,Serializable> variables)
Update the variables for a given process.
|
decodeKey, deleteProcess, encodeKey, getDocuments, getDocuments, getProcessDefinitionByKey, getProcessDefinitions, getProcesses, getTasks, getTasks
clear, convertException, convertNode, convertNode, convertStatusCode, delete, describeContents, getHttpInvoker, getSessionHttp, isCloudSession, isListNull, isMapNull, isObjectNull, isOnPremiseSession, isStringNull, post, put, read, saveContentStream, writeToParcel
public static final android.os.Parcelable.Creator<OnPremiseWorkflowServiceImpl> CREATOR
public OnPremiseWorkflowServiceImpl(AlfrescoSession repositorySession)
public OnPremiseWorkflowServiceImpl(android.os.Parcel o)
public PagingResult<ProcessDefinition> getProcessDefinitions(ListingContext listingContext)
listingContext
- : Listing context that define the behavior of
paging results
ListingContext
public ProcessDefinition getProcessDefinition(String processDefinitionIdentifier)
WorkflowService
processDefinitionIdentifier
- : unique identifierpublic Process startProcess(ProcessDefinition processDefinition, List<Person> assignees, Map<String,Serializable> variables, List<Document> items)
A collection of default Alfresco variables are available inside the
WorkflowModel
Starting an Adhoc Process
// Process Definition Listing
List<ProcessDefinition> definitions = workflowService.getProcessDefinitions();
// Retrieve adhoc processDefinition
ProcessDefinition def = null;
for (ProcessDefinition processDefinition : definitions)
{
if (WorkflowModel.KEY_ADHOC_ACTIVITI.equals(processDefinition.getKey()))
{
def = processDefinition;
break;
}
}
// Start Process : Prepare Variables
Map<String, Serializable> variables = new HashMap<String, Serializable>();
// ASSIGNEE
Person user = alfsession.getServiceRegistry().getPersonService().getPerson(alfsession.getPersonIdentifier());
List<Person> users = new ArrayList<Person>();
users.add(user);
// DUE DATE
GregorianCalendar calendar = new GregorianCalendar();
calendar.set(Calendar.YEAR, 2000);
variables.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, DateUtils.format(calendar));
// PRIORITY
variables.put(WorkflowModel.PROP_WORKFLOW_PRIORITY, priority);
// DESCRIPTION
variables.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, description);
// START THE PROCESS
return workflowService.startProcess(def, users, variables, null);
processDefinition
- (mandatory) : Represents the process definition
to execute.assignees
- (optional) : List of person to assign. In case of
"group based process", leave this parameter as null and add
inside the variables map the correct key/value like
bpm__groupAssignee. Warning : Majority of default alfresco
workflow/process require an assignee.variables
- (optional) : Map of process variables to add at the
start.items
- (optional) : List of document object.protected org.apache.chemistry.opencmis.commons.impl.UrlBuilder getProcessUrl(Process process)
getProcessUrl
in class AbstractWorkflowService
process
- : a process objectpublic PagingResult<Process> getProcesses(ListingContext listingContext)
listingContext
- : Listing context that define the behavior of
paging results
ListingContext
public Process getProcess(String processId)
processId
- : unique identifier of the processpublic PagingResult<Task> getTasks(Process process, ListingContext listingContext)
ListingFilter
inside the ListingContext parameter to get task that meet certain
criteria like WorkflowService.FILTER_KEY_STATUS
.process
- : process specifiedlistingContext
- : defines the behavior of paging results
ListingContext
public Process refresh(Process process)
process
- : process to refreshpublic Map<String,Property> getVariables(Process process)
WorkflowService
public PagingResult<Document> getDocuments(Task task, ListingContext listingContext)
listingContext
- : defines the behavior of paging results
ListingContext
public PagingResult<Document> getDocuments(Process process, ListingContext listingContext)
listingContext
- : defines the behavior of paging results
ListingContext
protected PagingResult<Document> getItems(String id, ListingContext listingContext)
public void addDocuments(Task task, List<Document> items)
public void removeDocuments(Task task, List<Document> items)
public Task getTask(String taskIdentifier)
taskIdentifier
- : unique identifier of the taskpublic PagingResult<Task> getTasks(ListingContext listingContext)
ListingFilter
inside the ListingContext parameter to get task that meet certain
criteria like WorkflowService.FILTER_KEY_ASSIGNEE
, WorkflowService.FILTER_KEY_STATUS
,
WorkflowService.FILTER_KEY_PRIORITY
, WorkflowService.FILTER_KEY_DUE
. It's possible to
add more than one filter. In this case filters value are joined with an
AND operator.
// We wants tasks which are unassigned AND active
ListingFilter lf = new ListingFilter();
lf.addFilter(WorkflowService.FILTER_STATUS, WorkflowService.FILTER_STATUS_ACTIVE);
lf.addFilter(WorkflowService.FILTER_ASSIGNEE, WorkflowService.FILTER_ASSIGNEE_UNASSIGNED);
ListingContext lc = new ListingContext();
lc.setFilter(lf);
PagingResult<Task> pagingTasks = workflowService.getTasks(lc);
listingContext
- : defines the behavior of paging results
ListingContext
public Task completeTask(Task task, Map<String,Serializable> variables)
task
- : Task object to completepublic Task refresh(Task task)
task
- : task to refreshpublic Task claimTask(Task task)
task
- : Task object to claimpublic Task unclaimTask(Task task)
task
- : Task object to unclaimpublic Task reassignTask(Task task, Person assignee)
task
- : Task object to reassignassignee
- : New assignee username/identifier of the taskpublic Map<String,Property> getVariables(Task task)
WorkflowService
task
- : task to refreshpublic Process updateVariables(Process process, Map<String,Serializable> variables)
WorkflowService
process
- : process to updatevariables
- : map of variables to updatepublic Task updateVariables(Task task, Map<String,Serializable> variables)
task
- : tak to updatevariables
- : map of variables to updatepublic org.apache.chemistry.opencmis.commons.impl.UrlBuilder getProcessDiagramUrl(String processId)
getProcessDiagramUrl
in class AbstractWorkflowService
public ContentStream getProcessDiagram(Process process)
process
- : process objectpublic ContentStream getProcessDiagram(String processId)
processId
- : process unique identifierCopyright © 2012-2018 Alfresco Software. All Rights Reserved.