Class AccessAdapter
- java.lang.Object
-
- org.imixs.workflow.engine.adapters.AccessAdapter
-
- All Implemented Interfaces:
Serializable
,Adapter
,GenericAdapter
@Named public class AccessAdapter extends Object implements GenericAdapter, Serializable
The AccessAdapter is a generic adapter class responsible to update the ACL of a workitem. The CID Bean updates the following Items- $writeAccess
- $readAccess
- $participants
The read and write access for a workitem can be defined by the BPMN model with the ACL Properties of the Imixs-BPMN modeler.
The participants is a computed list of all users who edited this workitem.
By defining an CDI alternative an application can overwrite the behavior of this bean.
- Version:
- 1.0.0
- Author:
- rsoika
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected WorkflowService
workflowService
-
Constructor Summary
Constructors Constructor Description AccessAdapter()
Default ConstructorAccessAdapter(WorkflowService workflowService)
CDI Constructor to inject WorkflowService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemCollection
execute(ItemCollection document, ItemCollection event)
The Execute method updates the ACL of a process instance based on a given event.void
mergeFieldList(ItemCollection documentContext, List valueList, List<String> fieldList)
This method merges the values of fieldList into valueList and test for duplicates.void
mergeRoles(List valueList, List sourceList, ItemCollection documentContext)
This method merges the role names from a SourceList into a valueList and removes duplicates.void
setWorkflowService(WorkflowService workflowService)
List<?>
uniqueList(List<Object> valueList)
This method removes duplicates and null values from a vector.ItemCollection
updateACL(ItemCollection workitem, ItemCollection event, ItemCollection nextTask)
This method updates the $readAccess and $writeAccess attributes of a WorkItem depending to the configuration of a Activity Entity.ItemCollection
updateParticipants(ItemCollection workitem)
Update the $PARTICIPANTS.
-
-
-
Field Detail
-
workflowService
protected WorkflowService workflowService
-
-
Constructor Detail
-
AccessAdapter
public AccessAdapter()
Default Constructor
-
AccessAdapter
@Inject public AccessAdapter(WorkflowService workflowService)
CDI Constructor to inject WorkflowService- Parameters:
workflowService
-
-
-
Method Detail
-
execute
public ItemCollection execute(ItemCollection document, ItemCollection event) throws AdapterException
The Execute method updates the ACL of a process instance based on a given event.- Specified by:
execute
in interfaceAdapter
- Parameters:
document
- the workitem to be processedevent
- the workflow event containing the processing instructions- Returns:
- updated workitem for further processing
- Throws:
AdapterException
- interrupt processing
-
setWorkflowService
public void setWorkflowService(WorkflowService workflowService)
-
updateParticipants
public ItemCollection updateParticipants(ItemCollection workitem)
Update the $PARTICIPANTS.- Parameters:
workitem
-- Returns:
-
updateACL
public ItemCollection updateACL(ItemCollection workitem, ItemCollection event, ItemCollection nextTask) throws PluginException
This method updates the $readAccess and $writeAccess attributes of a WorkItem depending to the configuration of a Activity Entity. The method evaluates the new model flag keyupdateacl. If 'false' then acl will not be updated.- Throws:
PluginException
-
mergeFieldList
public void mergeFieldList(ItemCollection documentContext, List valueList, List<String> fieldList)
This method merges the values of fieldList into valueList and test for duplicates. If an entry of the fieldList is a single key value, than the values to be merged are read from the corresponding documentContext property e.g. 'namTeam' -> maps the values of the documentContext property 'namteam' into the valueList If an entry of the fieldList is in square brackets, than the comma separated elements are mapped into the valueList e.g. '[user1,user2]' - maps the values 'user1' and 'user2' int the valueList. Also Curly brackets are allowed '{user1,user2}'- Parameters:
valueList
-fieldList
-
-
uniqueList
public List<?> uniqueList(List<Object> valueList)
This method removes duplicates and null values from a vector.- Parameters:
valueList
- - list of elements
-
mergeRoles
public void mergeRoles(List valueList, List sourceList, ItemCollection documentContext) throws PluginException
This method merges the role names from a SourceList into a valueList and removes duplicates. The AddaptText event is fired so a client can adapt a role name.- Parameters:
valueList
-sourceList
-- Throws:
PluginException
-
-