我知道snaker没人维护了 ,我只是想学习下工作流引擎这块,我试着用以前的nutz结合snaker的测试代码跑了下 跑的通,如果要用的话是怎么用,测试代码是
IocLoader loader = new ComboIocLoader("*anno","*js", "ioc.js", "*"+SnakerIocLoader.class.getName());
Ioc ioc = new NutIoc(loader);
SnakerEngine engine = ioc.get(SnakerEngine.class);
engine.process().deploy(StreamHelper.getStreamFromClasspath("process.snaker"));
Map<String, Object> args1 = new HashMap<String, Object>();
args1.put("task1.operator", new String[]{"1"});
Order order = engine.startInstanceByName("simple", 0, "2", args1);
System.out.println("order=" + order);
List<Task> tasks = engine.query().getActiveTasks(new QueryFilter().setOrderId(order.getId()));
for(Task task : tasks) {
engine.executeTask(task.getId(), "1", args1);
}
如果要结合web怎么获取SnakerEngine呢,直接在主模块声明org.snaker.nutz.SnakerIocLoader
然后再其他地方通过
@Inject
SnakerEngine engine
就可以使用engine了吗?