我是按demo集成的uflo, 现在尝试跑一个测试流程, 在查询工作流任务的时候报了no session, service层代码如下:
```java
@IocBean(args = {"refer:dao"})
public class UfloServiceBean extends BaseServiceImpl implements UfloService {
public UfloServiceBean(Dao dao) {
super(dao);
}
@Inject
private ProcessService processService;
@Inject
private TaskService taskService;
public ApiResult start() {
StartProcessInfo info=new StartProcessInfo("user1");
info.setBusinessId("bill_id_1");
processService.startProcessByKey("test-2", info);
return new ApiResult();
}
public ApiResult listTask() {
ApiResult result = new ApiResult();
List<Task> tasks = taskService.createTaskQuery().assignee("user1").list();
result.setData(tasks);
return result;
}
}
controller层代码如下:
package cn.regentsoft.newmf.uflo.api;
import cn.regentsoft.newmf.uflo.service.UfloService;
import cn.regentsoft.newmf.web.api.ApiResult;
import cn.regentsoft.newmf.web.commons.filter.MyCrossOriginFilter;
import cn.regentsoft.newmf.web.commons.filter.TokenFilter;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.adaptor.JsonAdaptor;
import org.nutz.mvc.annotation.*;
@IocBean
@At("/v1/api/uflo")
@Filters({@By(type = TokenFilter.class), @By(type = MyCrossOriginFilter.class)})
public class UfloTestAPI {
@Inject
private UfloService ufloService;
@GET
@At("/start")
@AdaptBy(type = JsonAdaptor.class)
public ApiResult start() {
return ufloService.start();
}
@GET
@At("/list-task")
@AdaptBy(type = JsonAdaptor.class)
public ApiResult listTask() {
return ufloService.listTask();
}
}
```