mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Workflow:
- Some fixes after merging with Gav's latest web client updates - Display of Outcome on completed Tasks - Saving of Task with null Due Date - Fix to how workflow service api IDs are represented git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,7 +38,8 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
public class BPMEngineRegistry
|
public class BPMEngineRegistry
|
||||||
{
|
{
|
||||||
/** ID seperator used in global Ids */
|
/** ID seperator used in global Ids */
|
||||||
private static final String ID_SEPERATOR = "-";
|
private static final String ID_SEPERATOR = "$";
|
||||||
|
private static final String ID_SEPERATOR_REGEX = "\\$";
|
||||||
|
|
||||||
/** Logging support */
|
/** Logging support */
|
||||||
private static Log logger = LogFactory.getLog("org.alfresco.repo.workflow");
|
private static Log logger = LogFactory.getLog("org.alfresco.repo.workflow");
|
||||||
@@ -159,7 +160,7 @@ public class BPMEngineRegistry
|
|||||||
*/
|
*/
|
||||||
public static String[] getGlobalIdParts(String globalId)
|
public static String[] getGlobalIdParts(String globalId)
|
||||||
{
|
{
|
||||||
String[] parts = globalId.split(ID_SEPERATOR);
|
String[] parts = globalId.split(ID_SEPERATOR_REGEX);
|
||||||
if (parts.length != 2)
|
if (parts.length != 2)
|
||||||
{
|
{
|
||||||
throw new WorkflowException("Invalid Global Id '" + globalId + "'");
|
throw new WorkflowException("Invalid Global Id '" + globalId + "'");
|
||||||
|
@@ -114,7 +114,7 @@ public class JBPMEngine extends BPMEngine
|
|||||||
"and ti.end is not null";
|
"and ti.end is not null";
|
||||||
|
|
||||||
// Workflow Path Seperators
|
// Workflow Path Seperators
|
||||||
private final static String WORKFLOW_PATH_SEPERATOR = "--";
|
private final static String WORKFLOW_PATH_SEPERATOR = "-";
|
||||||
private final static String WORKFLOW_TOKEN_SEPERATOR = "@";
|
private final static String WORKFLOW_TOKEN_SEPERATOR = "@";
|
||||||
|
|
||||||
// I18N labels
|
// I18N labels
|
||||||
@@ -1198,7 +1198,7 @@ public class JBPMEngine extends BPMEngine
|
|||||||
// map property to specific jBPM task instance field
|
// map property to specific jBPM task instance field
|
||||||
if (key.equals(WorkflowModel.PROP_DUE_DATE))
|
if (key.equals(WorkflowModel.PROP_DUE_DATE))
|
||||||
{
|
{
|
||||||
if (!(value instanceof Date))
|
if (value != null && !(value instanceof Date))
|
||||||
{
|
{
|
||||||
throw new WorkflowException("Task due date '" + value + "' is invalid");
|
throw new WorkflowException("Task due date '" + value + "' is invalid");
|
||||||
}
|
}
|
||||||
@@ -1216,7 +1216,7 @@ public class JBPMEngine extends BPMEngine
|
|||||||
}
|
}
|
||||||
else if (key.equals(ContentModel.PROP_OWNER))
|
else if (key.equals(ContentModel.PROP_OWNER))
|
||||||
{
|
{
|
||||||
if (!(value instanceof String))
|
if (value != null && !(value instanceof String))
|
||||||
{
|
{
|
||||||
throw new WorkflowException("Task owner '" + value + "' is invalid");
|
throw new WorkflowException("Task owner '" + value + "' is invalid");
|
||||||
}
|
}
|
||||||
|
@@ -131,7 +131,7 @@ public class JBPMEngineTest extends BaseSpringTest
|
|||||||
WorkflowDefinition workflowDef = getTestDefinition();
|
WorkflowDefinition workflowDef = getTestDefinition();
|
||||||
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, null);
|
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, null);
|
||||||
assertNotNull(path);
|
assertNotNull(path);
|
||||||
assertTrue(path.id.endsWith("--@"));
|
assertTrue(path.id.endsWith("-@"));
|
||||||
assertNotNull(path.node);
|
assertNotNull(path.node);
|
||||||
assertNotNull(path.instance);
|
assertNotNull(path.instance);
|
||||||
assertEquals(workflowDef.id, path.instance.definition.id);
|
assertEquals(workflowDef.id, path.instance.definition.id);
|
||||||
@@ -154,7 +154,7 @@ public class JBPMEngineTest extends BaseSpringTest
|
|||||||
|
|
||||||
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
|
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
|
||||||
assertNotNull(path);
|
assertNotNull(path);
|
||||||
assertTrue(path.id.endsWith("--@"));
|
assertTrue(path.id.endsWith("-@"));
|
||||||
assertNotNull(path.node);
|
assertNotNull(path.node);
|
||||||
assertNotNull(path.instance);
|
assertNotNull(path.instance);
|
||||||
assertEquals(workflowDef.id, path.instance.definition.id);
|
assertEquals(workflowDef.id, path.instance.definition.id);
|
||||||
@@ -187,7 +187,7 @@ public class JBPMEngineTest extends BaseSpringTest
|
|||||||
|
|
||||||
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
|
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
|
||||||
assertNotNull(path);
|
assertNotNull(path);
|
||||||
assertTrue(path.id.endsWith("--@"));
|
assertTrue(path.id.endsWith("-@"));
|
||||||
assertNotNull(path.node);
|
assertNotNull(path.node);
|
||||||
assertNotNull(path.instance);
|
assertNotNull(path.instance);
|
||||||
assertEquals(workflowDef.id, path.instance.definition.id);
|
assertEquals(workflowDef.id, path.instance.definition.id);
|
||||||
@@ -279,7 +279,7 @@ public class JBPMEngineTest extends BaseSpringTest
|
|||||||
assertNotNull(paths);
|
assertNotNull(paths);
|
||||||
assertEquals(1, paths.size());
|
assertEquals(1, paths.size());
|
||||||
assertEquals(instances.get(0).id, paths.get(0).instance.id);
|
assertEquals(instances.get(0).id, paths.get(0).instance.id);
|
||||||
assertTrue(paths.get(0).id.endsWith("--@"));
|
assertTrue(paths.get(0).id.endsWith("-@"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user