@DeclareRoles(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) @RolesAllowed(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) public class WorkflowService extends Object implements WorkflowManager, WorkflowContext
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TYPE |
static String |
INVALID_ITEM_FORMAT |
static String |
INVALID_ITEMVALUE_FORMAT |
protected javax.enterprise.event.Event<ProcessingEvent> |
processingEvents |
static int |
SORT_ORDER_CREATED_ASC |
static int |
SORT_ORDER_CREATED_DESC |
static int |
SORT_ORDER_MODIFIED_ASC |
static int |
SORT_ORDER_MODIFIED_DESC |
protected javax.enterprise.event.Event<TextEvent> |
textEvents |
static String |
UNIQUEIDREF |
| Constructor and Description |
|---|
WorkflowService() |
| Modifier and Type | Method and Description |
|---|---|
String |
adaptText(String text,
ItemCollection documentContext)
The method adaptText can be called to replace predefined xml tags included in
a text with custom values.
|
List<String> |
adaptTextList(String text,
ItemCollection documentContext)
The method adaptTextList can be called to replace a text with custom values.
|
ItemCollection |
evalNextTask(ItemCollection documentContext,
ItemCollection event)
This method evaluates the next task based on a Model Event element.
|
ItemCollection |
evalWorkflowResult(ItemCollection activityEntity,
ItemCollection documentContext)
The method evaluates the WorkflowResult of a BPMN event and resolves embedded
ItemValues
|
ItemCollection |
evalWorkflowResult(ItemCollection event,
ItemCollection documentContext,
boolean resolveItemValues)
The method evaluates the WorkflowResult for a given BPMN event and returns a
ItemColleciton containing all item definitions.
|
DocumentService |
getDocumentService()
Returns an instance of the DocumentService EJB.
|
List<ItemCollection> |
getEvents(ItemCollection workitem)
This returns a list of workflow events assigned to a given workitem.
|
ModelManager |
getModelManager()
This Method returns the modelManager Instance.
|
PropertyService |
getPropertyService()
Returns an instance of the PropertyService EJB.
|
ReportService |
getReportService()
Returns an instance of the ReportService EJB.
|
javax.ejb.SessionContext |
getSessionContext()
Returns an instance of the EJB session context.
|
String |
getUserName()
Obtain the java.security.Principal that identifies the caller and returns the
name of this principal.
|
List<String> |
getUserNameList()
This method returns a list of user names, roles and application groups the
caller belongs to.
|
ItemCollection |
getWorkItem(String uniqueid)
This method loads a Workitem with the corresponding uniqueid.
|
List<ItemCollection> |
getWorkListByAuthor(String name,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workItems belonging to a specified username.
|
List<ItemCollection> |
getWorkListByCreator(String name,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workitems created by a specified user ($Creator).
|
List<ItemCollection> |
getWorkListByGroup(String name,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a list of workitems filtered by the field $workflowgroup
the method supports still also the deprecated field "txtworkflowgroup"
|
List<ItemCollection> |
getWorkListByOwner(String name,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workitems containing a namOwner property belonging to
a specified username.
|
List<ItemCollection> |
getWorkListByProcessID(int aid,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workitems belonging to a specified $taskID defined by
the workflow model.
|
List<ItemCollection> |
getWorkListByRef(String aref)
Returns a collection of all workitems belonging to a specified workitem
identified by the attribute $UniqueIDRef.
|
List<ItemCollection> |
getWorkListByRef(String aref,
String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workitems belonging to a specified workitem
identified by the attribute $UniqueIDRef.
|
List<ItemCollection> |
getWorkListByWriteAccess(String type,
int pageSize,
int pageIndex,
String sortBy,
boolean sortReverse)
Returns a collection of workitems where the current user has a writeAccess.
|
boolean |
isUserInRole(String rolename)
Test if the caller has a given security role.
|
ItemCollection |
processWorkItem(ItemCollection workitem)
This method processes a workItem by the WorkflowKernel and saves the workitem
after the processing was finished successful.
|
ItemCollection |
processWorkItem(ItemCollection workitem,
int eventID)
This method processes a workItem based on a given event.
|
ItemCollection |
processWorkItem(ItemCollection workitem,
ItemCollection event)
This method processes a workItem based on a given event.
|
void |
removeWorkItem(ItemCollection aworkitem) |
public static final String UNIQUEIDREF
public static final String DEFAULT_TYPE
public static final int SORT_ORDER_CREATED_DESC
public static final int SORT_ORDER_CREATED_ASC
public static final int SORT_ORDER_MODIFIED_DESC
public static final int SORT_ORDER_MODIFIED_ASC
public static final String INVALID_ITEMVALUE_FORMAT
public static final String INVALID_ITEM_FORMAT
@Inject protected javax.enterprise.event.Event<ProcessingEvent> processingEvents
@Inject protected javax.enterprise.event.Event<TextEvent> textEvents
public ItemCollection getWorkItem(String uniqueid)
getWorkItem in interface WorkflowManagerpublic List<ItemCollection> getWorkListByOwner(String name, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
org.imixs.workflow.plugins.OwnerPluginname - = username for property namOwner - if null current username will
be usedpageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByAuthor(String name, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
name - = username or role contained in $writeAccess - if null current
username will be usedpageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByCreator(String name, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
name - = username for property $Creator - if null current username will
be usedpageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByWriteAccess(String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
pageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortorder - = defines sortorder (SORT_ORDER_CREATED_DESC = 0
SORT_ORDER_CREATED_ASC = 1 SORT_ORDER_MODIFIED_DESC = 2
SORT_ORDER_MODIFIED_ASC = 3)sortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByGroup(String name, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
name - type - pageSize - = optional page count (default 20)pageIndex - = optional start positionsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByProcessID(int aid, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
aID - = $taskID for the workitems to be returned.pageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByRef(String aref, String type, int pageSize, int pageIndex, String sortBy, boolean sortReverse)
aref - A unique reference to another workitem inside a database *pageSize - = optional page count (default 20)pageIndex - = optional start positiontype - = defines the type property of the workitems to be returnd. can be
nullsortBy - -optional field to sort the resultsortReverse - - optional sort directionpublic List<ItemCollection> getWorkListByRef(String aref)
public List<ItemCollection> getEvents(ItemCollection workitem) throws ModelException
workitem - ModelExceptionimixs-bpmnpublic ItemCollection processWorkItem(ItemCollection workitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException
processWorkItem in interface WorkflowManagerworkitem - - the workItem to be processedAccessDeniedException - - thrown if the user has insufficient access to update the
workItemProcessingErrorException - - thrown if the workitem could not be processed by the
workflowKernelPluginException - - thrown if processing by a plugin failsModelExceptionpublic ItemCollection processWorkItem(ItemCollection workitem, ItemCollection event) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException
workitem - - the workItem to be processedevent - - event objectAccessDeniedException - - thrown if the user has insufficient access to update the
workItemProcessingErrorException - - thrown if the workitem could not be processed by the
workflowKernelPluginException - - thrown if processing by a plugin failsModelExceptionItemCollection processWorkItem(ItemCollection workitem)public ItemCollection processWorkItem(ItemCollection workitem, int eventID) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException
workitem - - the workItem to be processedevent - - event objectAccessDeniedException - - thrown if the user has insufficient access to update the
workItemProcessingErrorException - - thrown if the workitem could not be processed by the
workflowKernelPluginException - - thrown if processing by a plugin failsModelExceptionItemCollection processWorkItem(ItemCollection workitem)public void removeWorkItem(ItemCollection aworkitem) throws AccessDeniedException
removeWorkItem in interface WorkflowManagerAccessDeniedExceptionpublic ModelManager getModelManager()
getModelManager in interface WorkflowContextpublic javax.ejb.SessionContext getSessionContext()
getSessionContext in interface WorkflowContextpublic DocumentService getDocumentService()
public ReportService getReportService()
public PropertyService getPropertyService()
public String getUserName()
public boolean isUserInRole(String rolename)
rolename - public List<String> getUserNameList()
public String adaptText(String text, ItemCollection documentContext) throws PluginException
text - documentContext - PluginExceptionpublic List<String> adaptTextList(String text, ItemCollection documentContext) throws PluginException
text - documentContext - PluginExceptionpublic ItemCollection evalWorkflowResult(ItemCollection event, ItemCollection documentContext, boolean resolveItemValues) throws PluginException
ABC$uniqueid
This example will result in a new item 'somedata' with the $uniqueid prefixed
with 'ABC'event - documentContext - resolveItemValues - - if true, itemValue tags will be resolved.PluginExceptionparsing-using-regex-in-java.htmlpublic ItemCollection evalWorkflowResult(ItemCollection activityEntity, ItemCollection documentContext) throws PluginException
ABC$uniqueid
This example will result in a new item 'somedata' with the $uniqueid prafixed
with 'ABC'activityEntity - documentContext - PluginExceptionevalWorkflowResult(ItemCollection activityEntity, ItemCollection
documentContext,boolean resolveItemValues)public ItemCollection evalNextTask(ItemCollection documentContext, ItemCollection event) throws PluginException, ModelException
PluginExceptionModelExceptionCopyright © 2006–2019 Imixs Software Solutions GmbH. All rights reserved.