mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Workflow group / pooled tasks support
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4892 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,7 +25,7 @@ bpm_businessprocessmodel.property.bpm_priority.description=Priority
|
||||
bpm_businessprocessmodel.property.bpm_percentComplete.title=Percent Complete
|
||||
bpm_businessprocessmodel.property.bpm_percentComplete.description=Percent Complete
|
||||
bpm_businessprocessmodel.association.bpm_pooledActors.title=Pooled Users
|
||||
bpm_businessprocessmodel.association.bpm_pooledActors.title=The users who may take ownership of the task
|
||||
bpm_businessprocessmodel.association.bpm_pooledActors.title=Pool
|
||||
|
||||
# Workflow Task
|
||||
bpm_businessprocessmodel.type.bpm_workflowTask.title=Worflow Task
|
||||
|
@@ -10,6 +10,8 @@
|
||||
<imports>
|
||||
<!-- Import Alfresco Dictionary Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
|
||||
<!-- Import Alfresco System Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
|
||||
<!-- Import Alfresco Content Domain Model Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
|
||||
<!-- Import User Model Definitions -->
|
||||
@@ -146,7 +148,8 @@
|
||||
<many>false</many>
|
||||
</source>
|
||||
<target>
|
||||
<class>cm:person</class>
|
||||
<!-- For now, this may consists of cm:person or usr:authorityContainer -->
|
||||
<class>sys:base</class>
|
||||
<mandatory>false</mandatory>
|
||||
<many>true</many>
|
||||
</target>
|
||||
|
@@ -15,6 +15,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="workflowServiceImpl" class="org.alfresco.repo.workflow.WorkflowServiceImpl">
|
||||
<property name="authorityService" ref="authorityService"/>
|
||||
<property name="BPMEngineRegistry" ref="bpm_engineRegistry"/>
|
||||
<property name="workflowPackageComponent" ref="workflowPackageImpl"/>
|
||||
</bean>
|
||||
@@ -89,7 +90,6 @@
|
||||
<property name="namespaceService" ref="namespaceService"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<property name="personService" ref="personService"/>
|
||||
<property name="authorityService" ref="authorityService"/>
|
||||
<property name="authorityDAO" ref="authorityDAO"/>
|
||||
<property name="serviceRegistry" ref="ServiceRegistry"/>
|
||||
<property name="companyHomeStore"><value>${spaces.store}</value></property>
|
||||
|
@@ -221,7 +221,15 @@ public class ActionServiceImpl implements ActionService, RuntimeActionService, A
|
||||
*/
|
||||
public ActionDefinition getActionDefinition(String name)
|
||||
{
|
||||
return this.actionDefinitions.get(name);
|
||||
// get direct access to action definition (i.e. ignoring public flag of executer)
|
||||
ActionDefinition definition = null;
|
||||
Object bean = this.applicationContext.getBean(name);
|
||||
if (bean != null && bean instanceof ActionExecuter)
|
||||
{
|
||||
ActionExecuter executer = (ActionExecuter)bean;
|
||||
definition = executer.getActionDefinition();
|
||||
}
|
||||
return definition;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,8 +22,11 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDeployment;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowException;
|
||||
@@ -49,9 +52,20 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
private static Log logger = LogFactory.getLog("org.alfresco.repo.workflow");
|
||||
|
||||
// Dependent services
|
||||
private AuthorityService authorityService;
|
||||
private BPMEngineRegistry registry;
|
||||
private WorkflowPackageComponent workflowPackageComponent;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the Authority Service
|
||||
*
|
||||
* @param authorityService
|
||||
*/
|
||||
public void setAuthorityService(AuthorityService authorityService)
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the BPM Engine Registry
|
||||
@@ -288,10 +302,13 @@ public class WorkflowServiceImpl implements WorkflowService
|
||||
*/
|
||||
public List<WorkflowTask> getPooledTasks(String authority)
|
||||
{
|
||||
// TODO: Expand authorities to include associated groups (and parent groups)
|
||||
// Expand authorities to include associated groups (and parent groups)
|
||||
List<String> authorities = new ArrayList<String>();
|
||||
authorities.add(authority);
|
||||
|
||||
Set<String> parents = authorityService.getContainingAuthorities(AuthorityType.GROUP, authority, false);
|
||||
authorities.addAll(parents);
|
||||
|
||||
// Retrieve pooled tasks for authorities (from each of the registered task components)
|
||||
List<WorkflowTask> tasks = new ArrayList<WorkflowTask>(10);
|
||||
String[] ids = registry.getTaskComponents();
|
||||
for (String id: ids)
|
||||
|
@@ -23,7 +23,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -51,7 +50,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
@@ -112,7 +110,6 @@ public class JBPMEngine extends BPMEngine
|
||||
protected NodeService nodeService;
|
||||
protected ServiceRegistry serviceRegistry;
|
||||
protected PersonService personService;
|
||||
protected AuthorityService authorityService;
|
||||
protected AuthorityDAO authorityDAO;
|
||||
protected JbpmTemplate jbpmTemplate;
|
||||
|
||||
@@ -188,16 +185,6 @@ public class JBPMEngine extends BPMEngine
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Authority Service
|
||||
*
|
||||
* @param authorityService
|
||||
*/
|
||||
public void setAuthorityService(AuthorityService authorityService)
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Authority DAO
|
||||
@@ -857,17 +844,9 @@ public class JBPMEngine extends BPMEngine
|
||||
{
|
||||
public List<WorkflowTask> doInJbpm(JbpmContext context)
|
||||
{
|
||||
// flatten authorities to include all parent authorities
|
||||
Set<String> flattenedAuthorities = new HashSet<String>();
|
||||
for (String authority : authorities)
|
||||
{
|
||||
Set<String> parents = authorityService.getContainingAuthorities(AuthorityType.GROUP, authority, false);
|
||||
flattenedAuthorities.addAll(parents);
|
||||
}
|
||||
|
||||
// retrieve pooled tasks for all flattened authorities
|
||||
TaskMgmtSession taskSession = context.getTaskMgmtSession();
|
||||
List<TaskInstance> tasks = taskSession.findPooledTaskInstances(new ArrayList(flattenedAuthorities));
|
||||
List<TaskInstance> tasks = taskSession.findPooledTaskInstances(authorities);
|
||||
List<WorkflowTask> workflowTasks = new ArrayList<WorkflowTask>(tasks.size());
|
||||
for (TaskInstance task : tasks)
|
||||
{
|
||||
@@ -1406,7 +1385,16 @@ public class JBPMEngine extends BPMEngine
|
||||
List<NodeRef> pooledNodeRefs = new ArrayList<NodeRef>(pooledActors.size());
|
||||
for (PooledActor pooledActor : (Set<PooledActor>)pooledActors)
|
||||
{
|
||||
NodeRef pooledNodeRef = mapNameToAuthority(pooledActor.getActorId());
|
||||
NodeRef pooledNodeRef = null;
|
||||
String pooledActorId = pooledActor.getActorId();
|
||||
if (AuthorityType.getAuthorityType(pooledActorId) == AuthorityType.GROUP)
|
||||
{
|
||||
pooledNodeRef = mapNameToAuthority(pooledActorId);
|
||||
}
|
||||
else
|
||||
{
|
||||
pooledNodeRef = mapNameToPerson(pooledActorId);
|
||||
}
|
||||
if (pooledNodeRef != null)
|
||||
{
|
||||
pooledNodeRefs.add(pooledNodeRef);
|
||||
@@ -1529,12 +1517,20 @@ public class JBPMEngine extends BPMEngine
|
||||
int i = 0;
|
||||
for (JBPMNode actor : actors)
|
||||
{
|
||||
pooledActors[i++] = actor.getName();
|
||||
if (actor.getType().equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
|
||||
{
|
||||
pooledActors[i++] = (String)actor.getProperties().get(ContentModel.PROP_AUTHORITY_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
pooledActors[i++] = actor.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value instanceof JBPMNode)
|
||||
{
|
||||
pooledActors = new String[] {((JBPMNode)value).getName()};
|
||||
JBPMNode node = (JBPMNode)value;
|
||||
pooledActors = new String[] {(node.getType().equals(ContentModel.TYPE_AUTHORITY_CONTAINER)) ? (String)node.getProperties().get(ContentModel.PROP_AUTHORITY_NAME) : node.getName()};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -18,7 +18,8 @@
|
||||
|
||||
<task-node name="review">
|
||||
<task name="wf:reviewTask" swimlane="reviewer"/>
|
||||
<transition name="" to="end" />
|
||||
<transition name="reject" to="end" />
|
||||
<transition name="approve" to="end" />
|
||||
</task-node>
|
||||
|
||||
<node name="parallel">
|
||||
|
Reference in New Issue
Block a user