二:app
1.有關工做流碼錶對象的設計:工具
public class ActivitiCode {
//默認上一個節點對應的標識
private String lastNodeName="lastNode";
//默認下一個節點對應的標識
private String nextNodeName="nextNode";
//(權限組)計算值
private String figureValue="figureValue";
//對應按鈕
private String button="button";spa
private Map<String, Object> codeValue;設計
還有這些變量的get,set方法。其實這些變量能夠根據本身設計的工做流進行變通code
2.建立工做流操做接口對象
public interface ActivitiInterfaceService {繼承
/**
* 全部涉及到工做流的操做, 都會固定的執行下面幾部
*/
public void operate(Map<String, Object> paramMap);
}接口
3.建立另外一個工做流的service,建立這個service,能夠讓其餘的service集成他,那麼就能夠使用它的方法get
public abstract class ActivitiAbstractService {
@Autowired
private WoWorkorderInfoMapper woWorkorderInfoMapper;
// 發郵件的服務
@Autowired
private ISendMailService sendMailService;
@Autowired
private WoEmployeeService woEmployeeService;
@Autowired
private WoOrganizationService woOrganizationService;
@Autowired
private WoProcessLoggningService woProcessLoggningService;
@Autowired
private WoWorkorderEntrustMapper woWorkorderEntrustMapper;
@Autowired
private WoProcessLoggningAnnexService woProcessLoggningAnnexService;工作流
/**
* 全部涉及到工做流的操做, 都會固定的執行下面幾部
*/
@Transactional
public void operate(Map<String, Object> paramMap){
// 操做工做流: activitiHandle.completeTaskByExecution(dto);
operateActivi(paramMap);
}
/**
* 操做工做流--子類中實現各自的工做流
*/
protected abstract void operateActivi(Map<String, Object> paramMap);
}
4.建立一個操做工做流的子類,繼承ActivitiAbstractService,實現ActivitiInterfaceService;
由於ActivitiAbstractService中有operater方法,因此在子類中直接有一個operateActivi的方法便可;
如:
@Component("activitiBackTService")
public class ActivitiBackTServiceImpl extends ActivitiAbstractService implements ActivitiInterfaceService {
// 工做流處理的工具類
@Autowired
private ActivitiHandle activitiHandle;
protected void operateActivi(Map<String, Object> paramMap) { ActivitiDto wdDetailInfoDto = (ActivitiDto)paramMap.get("activitiKey"); activitiHandle.fallBack(wdDetailInfoDto.getTaskId()); } }