package com.mossle.bpm.web;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.mossle.bpm.persistence.domain.BpmConfBase;
import com.mossle.bpm.persistence.domain.BpmConfNode;
import com.mossle.bpm.persistence.domain.BpmConfUser;
import com.mossle.bpm.persistence.domain.BpmProcess;
import com.mossle.bpm.persistence.manager.BpmConfBaseManager;
import com.mossle.bpm.persistence.manager.BpmConfNodeManager;
import com.mossle.bpm.persistence.manager.BpmConfUserManager;
import com.mossle.bpm.persistence.manager.BpmProcessManager;
import com.mossle.core.hibernate.PropertyFilter;
import com.mossle.core.mapper.BeanMapper;
import com.mossle.core.page.Page;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
@RequestMapping("bpm")
public class BpmConfNodeController {
private BpmConfUserManager bpmConfUserManager;
private BpmConfNodeManager bpmConfNodeManager;
private BpmConfBaseManager bpmConfBaseManager;
private BeanMapper beanMapper = new BeanMapper();
private ProcessEngine processEngine;
private BpmProcessManager bpmProcessManager;
@RequestMapping("bpm-conf-node-list")
public String list(@RequestParam("bpmConfBaseId") Long bpmConfBaseId,
Model model) {
BpmConfBase bpmConfBase = bpmConfBaseManager.get(bpmConfBaseId);
List<BpmConfNode> bpmConfNodes = bpmConfNodeManager.findBy(
"bpmConfBase", bpmConfBase);
model.addAttribute("bpmConfNodes", bpmConfNodes);
return "bpm/bpm-conf-node-list";
}
// ~ ======================================================================
@Resource
public void setBpmConfUserManager(BpmConfUserManager bpmConfUserManager) {
this.bpmConfUserManager = bpmConfUserManager;
}
@Resource
public void setBpmConfNodeManager(BpmConfNodeManager bpmConfNodeManager) {
this.bpmConfNodeManager = bpmConfNodeManager;
}
@Resource
public void setBpmConfBaseManager(BpmConfBaseManager bpmConfBaseManager) {
this.bpmConfBaseManager = bpmConfBaseManager;
}
@Resource
public void setBpmProcessManager(BpmProcessManager bpmProcessManager) {
this.bpmProcessManager = bpmProcessManager;
}
@Resource
public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
}
}