mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9727: Querying using NodeRef type now uses ActivitiScriptNodeVariableType insead of ByteArrayVariableType (which isn't queryable) + fixed activiti components text-context
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30847 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -680,7 +680,28 @@ public class ActivitiTaskComponentTest extends AbstractActivitiComponentTest
|
||||
tasks = workflowEngine.queryTasks(taskQuery);
|
||||
assertNotNull(tasks);
|
||||
assertEquals(0, tasks.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryUsingNodeRef() {
|
||||
NodeRef nodeRef = new NodeRef("workspace:///someRef");
|
||||
|
||||
QName nodeRefPropQname = QName.createQName("testProp");
|
||||
HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
|
||||
props.put(nodeRefPropQname, nodeRef);
|
||||
|
||||
// Start the workflow-path
|
||||
workflowEngine.startWorkflow(workflowDef.getId(), props);
|
||||
|
||||
// Test querying with a value of type NodeRef
|
||||
WorkflowTaskQuery taskQuery = createWorkflowTaskQuery(WorkflowTaskState.IN_PROGRESS);
|
||||
HashMap<QName, Object> queryParams = new HashMap<QName, Object>();
|
||||
queryParams.put(nodeRefPropQname, nodeRef);
|
||||
taskQuery.setProcessCustomProps(queryParams);
|
||||
|
||||
List<WorkflowTask> tasks = workflowEngine.queryTasks(taskQuery);
|
||||
assertNotNull(tasks);
|
||||
assertEquals(1, tasks.size());
|
||||
}
|
||||
|
||||
private void checkTaskVariableTaskPresent(WorkflowTaskState state,
|
||||
|
@@ -1647,7 +1647,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
for(Entry<QName, Object> customProperty : processCustomProps.entrySet())
|
||||
{
|
||||
String name =factory.mapQNameToName(customProperty.getKey());
|
||||
taskQuery.processVariableValueEquals(name, customProperty.getValue());
|
||||
|
||||
// Perform minimal property conversions
|
||||
Object converted = propertyConverter.convertPropertyToValue(customProperty.getValue());
|
||||
taskQuery.processVariableValueEquals(name, converted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1765,7 +1768,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
for(Entry<QName, Object> customProperty : taskCustomProps.entrySet())
|
||||
{
|
||||
String name = factory.mapQNameToName(customProperty.getKey());
|
||||
taskQuery.taskVariableValueEquals(name, customProperty.getValue());
|
||||
|
||||
// Perform minimal property conversions
|
||||
Object converted = propertyConverter.convertPropertyToValue(customProperty.getValue());
|
||||
taskQuery.taskVariableValueEquals(name, converted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1854,7 +1860,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
for(Entry<QName, Object> customProperty : taskCustomProps.entrySet())
|
||||
{
|
||||
String name =factory.mapQNameToName(customProperty.getKey());
|
||||
taskQuery.taskVariableValueEquals(name, customProperty.getValue());
|
||||
|
||||
// Perform minimal property conversions
|
||||
Object converted = propertyConverter.convertPropertyToValue(customProperty.getValue());
|
||||
taskQuery.taskVariableValueEquals(name, converted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1864,7 +1873,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
for(Entry<QName, Object> customProperty : processCustomProps.entrySet())
|
||||
{
|
||||
String name =factory.mapQNameToName(customProperty.getKey());
|
||||
taskQuery.processVariableValueEquals(name, customProperty.getValue());
|
||||
|
||||
// Perform minimal property conversions
|
||||
Object converted = propertyConverter.convertPropertyToValue(customProperty.getValue());
|
||||
taskQuery.processVariableValueEquals(name, converted);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -44,6 +44,10 @@
|
||||
<constructor-arg value="org.alfresco.repo.workflow.BPMEngineRegistry" />
|
||||
</bean>
|
||||
|
||||
<bean id="workflowAdminService" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.alfresco.service.cmr.workflow.WorkflowAdminService" />
|
||||
</bean>
|
||||
|
||||
<bean id="baseWorkflowEngineStatus" class="org.alfresco.repo.workflow.WorkflowEngineStatus" abstract="true" />
|
||||
|
||||
<!-- Authentication Util initialization -->
|
||||
|
Reference in New Issue
Block a user