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:
David Caruana
2006-08-23 23:41:50 +00:00
parent a1b721a7ab
commit b08f6848a3
3 changed files with 10 additions and 9 deletions

View File

@@ -38,7 +38,8 @@ import org.apache.commons.logging.LogFactory;
public class BPMEngineRegistry
{
/** 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 */
private static Log logger = LogFactory.getLog("org.alfresco.repo.workflow");
@@ -159,7 +160,7 @@ public class BPMEngineRegistry
*/
public static String[] getGlobalIdParts(String globalId)
{
String[] parts = globalId.split(ID_SEPERATOR);
String[] parts = globalId.split(ID_SEPERATOR_REGEX);
if (parts.length != 2)
{
throw new WorkflowException("Invalid Global Id '" + globalId + "'");

View File

@@ -114,7 +114,7 @@ public class JBPMEngine extends BPMEngine
"and ti.end is not null";
// Workflow Path Seperators
private final static String WORKFLOW_PATH_SEPERATOR = "--";
private final static String WORKFLOW_PATH_SEPERATOR = "-";
private final static String WORKFLOW_TOKEN_SEPERATOR = "@";
// I18N labels
@@ -1198,7 +1198,7 @@ public class JBPMEngine extends BPMEngine
// map property to specific jBPM task instance field
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");
}
@@ -1216,7 +1216,7 @@ public class JBPMEngine extends BPMEngine
}
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");
}

View File

@@ -131,7 +131,7 @@ public class JBPMEngineTest extends BaseSpringTest
WorkflowDefinition workflowDef = getTestDefinition();
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, null);
assertNotNull(path);
assertTrue(path.id.endsWith("--@"));
assertTrue(path.id.endsWith("-@"));
assertNotNull(path.node);
assertNotNull(path.instance);
assertEquals(workflowDef.id, path.instance.definition.id);
@@ -154,7 +154,7 @@ public class JBPMEngineTest extends BaseSpringTest
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
assertNotNull(path);
assertTrue(path.id.endsWith("--@"));
assertTrue(path.id.endsWith("-@"));
assertNotNull(path.node);
assertNotNull(path.instance);
assertEquals(workflowDef.id, path.instance.definition.id);
@@ -187,7 +187,7 @@ public class JBPMEngineTest extends BaseSpringTest
WorkflowPath path = workflowComponent.startWorkflow(workflowDef.id, params);
assertNotNull(path);
assertTrue(path.id.endsWith("--@"));
assertTrue(path.id.endsWith("-@"));
assertNotNull(path.node);
assertNotNull(path.instance);
assertEquals(workflowDef.id, path.instance.definition.id);
@@ -279,7 +279,7 @@ public class JBPMEngineTest extends BaseSpringTest
assertNotNull(paths);
assertEquals(1, paths.size());
assertEquals(instances.get(0).id, paths.get(0).instance.id);
assertTrue(paths.get(0).id.endsWith("--@"));
assertTrue(paths.get(0).id.endsWith("-@"));
}