mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Workflow Console: automatically create workflow package and assignee variables on start of console (always required for testing, so saves some typing to create them manually.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5765 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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.
|
||||
|
@@ -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<WorkflowTimer> 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<WorkflowTimer> 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 + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user