Workflow:

1) Support for localisation of all Workflow definitions
2) Consolidate on id, title & description fields for all Workflow API objects
3) Add WorkflowTransition object to Workflow APIs
4) Fix up damage of above changes (web client etc)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3528 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-08-16 18:07:27 +00:00
parent ebd29c8548
commit 08fd4699f5
4 changed files with 10 additions and 16 deletions

View File

@@ -58,7 +58,7 @@ public class JBPMDeployProcessServlet extends HttpServlet
response.setContentType("text/html"); response.setContentType("text/html");
InputStream deploymentArchive = getDeploymentArchive(request); InputStream deploymentArchive = getDeploymentArchive(request);
WorkflowDefinition workflowDef = deployArchive(deploymentArchive); WorkflowDefinition workflowDef = deployArchive(deploymentArchive);
response.getWriter().println("Deployed archive " + workflowDef.name + " successfully"); response.getWriter().println("Deployed archive " + workflowDef.title + " successfully");
} }
catch(IOException e) catch(IOException e)
{ {

View File

@@ -11,6 +11,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.service.cmr.workflow.WorkflowService; import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.cmr.workflow.WorkflowTask; import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.service.cmr.workflow.WorkflowTaskDefinition; import org.alfresco.service.cmr.workflow.WorkflowTaskDefinition;
import org.alfresco.service.cmr.workflow.WorkflowTransition;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean; import org.alfresco.web.bean.dialog.BaseDialogBean;
@@ -32,7 +33,7 @@ public class ManageWorkItemDialog extends BaseDialogBean
protected WorkflowService workflowService; protected WorkflowService workflowService;
protected Node workItemNode; protected Node workItemNode;
protected WorkflowTask workItem; protected WorkflowTask workItem;
protected String[] transitions; protected WorkflowTransition[] transitions;
protected static final String ID_PREFIX = "transition_"; protected static final String ID_PREFIX = "transition_";
protected static final String CLIENT_ID_PREFIX = "dialog:" + ID_PREFIX; protected static final String CLIENT_ID_PREFIX = "dialog:" + ID_PREFIX;
@@ -93,16 +94,9 @@ public class ManageWorkItemDialog extends BaseDialogBean
{ {
buttons = new ArrayList<DialogButtonConfig>(this.transitions.length); buttons = new ArrayList<DialogButtonConfig>(this.transitions.length);
for (String trans : this.transitions) for (WorkflowTransition trans : this.transitions)
{ {
// TODO: Tidy this up when the service returns the list of labels buttons.add(new DialogButtonConfig(ID_PREFIX + trans, trans.title, null,
String label = trans;
if (label.length() == 0)
{
label = "Done";
}
buttons.add(new DialogButtonConfig(ID_PREFIX + trans, label, null,
"#{DialogManager.bean.transition}", "false", null)); "#{DialogManager.bean.transition}", "false", null));
} }
} }
@@ -138,13 +132,13 @@ public class ManageWorkItemDialog extends BaseDialogBean
Map reqParams = context.getExternalContext().getRequestParameterMap(); Map reqParams = context.getExternalContext().getRequestParameterMap();
String selectedTransition = null; String selectedTransition = null;
for (String trans : this.transitions) for (WorkflowTransition trans : this.transitions)
{ {
Object result = reqParams.get(CLIENT_ID_PREFIX + trans); Object result = reqParams.get(CLIENT_ID_PREFIX + trans);
if (result != null) if (result != null)
{ {
// this was the button that was pressed // this was the button that was pressed
selectedTransition = trans; selectedTransition = trans.id;
break; break;
} }
} }

View File

@@ -207,7 +207,7 @@ public class StartWorkflowWizard extends BaseWizardBean
List<WorkflowDefinition> workflowDefs = this.workflowService.getDefinitions(); List<WorkflowDefinition> workflowDefs = this.workflowService.getDefinitions();
for (WorkflowDefinition workflowDef : workflowDefs) for (WorkflowDefinition workflowDef : workflowDefs)
{ {
this.availableWorkflows.add(new SelectItem(workflowDef.id, workflowDef.name)); this.availableWorkflows.add(new SelectItem(workflowDef.id, workflowDef.title));
this.workflows.put(workflowDef.id, workflowDef); this.workflows.put(workflowDef.id, workflowDef);
} }

View File

@@ -159,10 +159,10 @@ public class WorkflowBean
// create the basic transient node // create the basic transient node
TransientMapNode node = new TransientMapNode(taskDef.metadata.getName(), TransientMapNode node = new TransientMapNode(taskDef.metadata.getName(),
task.name, task.properties); task.title, task.properties);
// add properties for the other useful metadata // add properties for the other useful metadata
node.getProperties().put(ContentModel.PROP_NAME.toString(), task.name); node.getProperties().put(ContentModel.PROP_NAME.toString(), task.title);
node.getProperties().put("type", taskDef.metadata.getTitle()); node.getProperties().put("type", taskDef.metadata.getTitle());
node.getProperties().put("id", task.id); node.getProperties().put("id", task.id);