mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-19942: Failed to displayed Process Engines page in Admin Console after creation of workflow by tenant user
Do special tenant specific filtering for WorkflowInstances and TaskInstances: for default tenant all instances included, for other tenants - only tenant-specific. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@56139 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -108,6 +108,30 @@ public class ActivitiTypeConverter
|
||||
return convert(filtered);
|
||||
}
|
||||
|
||||
/**
|
||||
* filters HistoricProcessInstances by domain
|
||||
* including all instances for default domain
|
||||
* and excluding shared instances (THOR-206) for tenants
|
||||
*
|
||||
* @param completedInstances
|
||||
* @param function
|
||||
* @return
|
||||
*/
|
||||
public <F, T> List<T> doSpecialTenantFilterAndSafeConvert(List<F> values, Function<F, String> processKeyGetter)
|
||||
{
|
||||
List<F> filtered = factory.doSpecialTenantFilter(values, processKeyGetter);
|
||||
factory.setIgnoreTenantCheck(factory.isDefaultDomain());
|
||||
try
|
||||
{
|
||||
return convert(filtered, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
factory.setIgnoreTenantCheck(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a {@link Deployment} into a {@link WorkflowDeployment}.
|
||||
* @param deployment
|
||||
@@ -329,13 +353,29 @@ public class ActivitiTypeConverter
|
||||
return results;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> List<T> convert(List<?> inputs)
|
||||
{
|
||||
return convert(inputs, false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> List<T> convert(List<?> inputs, boolean ignoreNotDeployed)
|
||||
{
|
||||
ArrayList<T> results = new ArrayList<T>(inputs.size());
|
||||
for (Object in : inputs)
|
||||
{
|
||||
T out = (T) convert(in);
|
||||
T out = null;
|
||||
try
|
||||
{
|
||||
out = (T) convert(in);
|
||||
}
|
||||
catch (NullPointerException npe)
|
||||
{
|
||||
if (!ignoreNotDeployed)
|
||||
{
|
||||
throw npe;
|
||||
}
|
||||
}
|
||||
if(out != null)
|
||||
{
|
||||
results.add(out);
|
||||
|
@@ -1121,7 +1121,7 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
*/
|
||||
private List<WorkflowTask> getValidWorkflowTasks(List<Task> tasks)
|
||||
{
|
||||
return typeConverter.filterByDomainAndConvert(tasks, new Function<Task, String>()
|
||||
return typeConverter.doSpecialTenantFilterAndSafeConvert(tasks, new Function<Task, String>()
|
||||
{
|
||||
public String apply(Task task)
|
||||
{
|
||||
|
Reference in New Issue
Block a user