diff --git a/config/alfresco/messages/workflow-interpreter-help.txt b/config/alfresco/messages/workflow-interpreter-help.txt index fe186b9d12..dd737e30fc 100644 --- a/config/alfresco/messages/workflow-interpreter-help.txt +++ b/config/alfresco/messages/workflow-interpreter-help.txt @@ -75,6 +75,13 @@ ## Variable Commands ## + Note: The following variables are defined automatically when the console + starts. They may be deleted or modified. + + var bpm:package package 1 (test package of one document) + var bpm:assignee person admin (test assignee who is admin) + + ok> var Show all defined variables. diff --git a/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java b/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java index 0aee27bc2a..affd20b4b8 100644 --- a/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java +++ b/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java @@ -70,6 +70,7 @@ import org.alfresco.service.namespace.QName; import org.alfresco.service.transaction.TransactionService; import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.GUID; +import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; import org.springframework.core.io.ClassPathResource; @@ -78,7 +79,7 @@ import org.springframework.core.io.ClassPathResource; * * @author davidc */ -public class WorkflowInterpreter +public class WorkflowInterpreter implements InitializingBean { // Service dependencies private WorkflowService workflowService; @@ -120,6 +121,7 @@ public class WorkflowInterpreter * Main entry point. */ public static void main(String[] args) + throws IOException { ApplicationContext context = ApplicationContextHelper.getApplicationContext(); WorkflowInterpreter console = (WorkflowInterpreter)context.getBean("workflowInterpreter"); @@ -135,6 +137,15 @@ public class WorkflowInterpreter fIn = new BufferedReader(new InputStreamReader(System.in)); } + /* (non-Javadoc) + * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() + */ + public void afterPropertiesSet() throws Exception + { + interpretCommand("var bpm:package package 1"); + interpretCommand("var bpm:assignee person admin"); + } + /** * @param workflowService The Workflow Service */ @@ -499,7 +510,7 @@ public class WorkflowInterpreter List timers = workflowService.getTimers(workflow.id); for (WorkflowTimer timer : timers) { - out.println("id: " + timer.id + " , name: " + timer.name + " , due date: " + timer.dueDate + " , path: " + timer.path.id + " , node: " + timer.path.node.name + " , process: " + timer.path.instance.id + " , task: " + timer.task.name); + out.println("id: " + timer.id + " , name: " + timer.name + " , due date: " + timer.dueDate + " , path: " + timer.path.id + " , node: " + timer.path.node.name + " , process: " + timer.path.instance.id + " , task: " + timer.task.name + "(" + timer.task.id + ")"); } } } @@ -512,7 +523,7 @@ public class WorkflowInterpreter List timers = workflowService.getTimers(workflow.id); for (WorkflowTimer timer : timers) { - out.println("id: " + timer.id + " , name: " + timer.name + " , due date: " + timer.dueDate + " , path: " + timer.path.id + " , node: " + timer.path.node.name + " , process: " + timer.path.instance.id + " , task: " + timer.task.name); + out.println("id: " + timer.id + " , name: " + timer.name + " , due date: " + timer.dueDate + " , path: " + timer.path.id + " , node: " + timer.path.node.name + " , process: " + timer.path.instance.id + " , task: " + timer.task.name + "(" + timer.task.id + ")"); } } }