Jbpm4環境搭建和整合Spring
jbpm.cfg.xml配置檔案內容如下:
<!--使用spring的事務管理器-->
<!--
-->
<!-- Job executor is excluded for running the example test cases. -->
<!--
spring配置檔案applicationContext.xml中hibernate配置新增:
然後配置jbpm4的工廠bean
<!--工作流統一service介面,業務封裝用-->
jbpmService的實現類如下
package net.uni.ap.jbpm.bo;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.zip.ZipInputStream;
import net.uni.ap.exp.BOException;
import net.uni.ap.exp.DAOException;
import net.uni.ap.jbpm.BaseJbpmTask;
import net.uni.ap.jbpm.BaseJbpmVar;
import net.uni.ap.jbpm.JbpmConstants;
import net.uni.ap.jbpm.dao.IJbpmDAO;
import net.uni.ap.jbpm.handle.CountJoinsignTaskCmd;
import net.uni.ap.jbpm.model.Deploy;
import net.uni.ap.jbpm.model.JbpmTask;
import net.uni.in1.BaseDictConstants;
import net.uni.in1.bo.IBaseUserRoleBO;
import net.uni.in1.model.BaseUserRole;
import net.uni.in1.model.User;
import net.uni.util.Page;
import org.jbpm.api.Execution;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.HistoryService;
import org.jbpm.api.JbpmException;
import org.jbpm.api.ManagementService;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.ProcessInstanceQuery;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
import org.jbpm.api.history.HistoryActivityInstance;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryTask;
import org.jbpm.api.history.HistoryTaskQuery;
import org.jbpm.api.model.ActivityCoordinates;
import org.jbpm.api.task.Task;
/**
* 處理內容:jbpm統一介面實現類
* @version: 1.0
* @see:net.uni.ap.jbpm.bo.JbpmBOImpl.java
* @date:2012-2-21
* @author:孫偉
*/
public class JbpmBOImpl implements IJbpmBO {
private ProcessEngine processEngineService;
private RepositoryService repositoryService = null;
private ExecutionService executionService = null;
private TaskService taskService = null;
private HistoryService historyService = null;
private ManagementService managementService = null;
private IJbpmDAO jbpmDAO;
private IBaseUserRoleBO baseUserRoleService;
public JbpmBOImpl(ProcessEngine processEngineService) {
super();
this.processEngineService = processEngineService;
this.repositoryService = processEngineService.getRepositoryService();
this.executionService = processEngineService.getExecutionService();
this.taskService = processEngineService.getTaskService();
this.historyService = processEngineService.getHistoryService();
this.managementService = processEngineService.getManagementService();
}
public JbpmBOImpl() {
super();
}
/**
* @return the processEngineService
*/
public ProcessEngine getProcessEngineService() {
return processEngineService;
}
/**
* @param processEngineService the processEngineService to set
*/
public void setProcessEngineService(ProcessEngine processEngineService) {
this.processEngineService = processEngineService;
this.repositoryService = processEngineService.getRepositoryService();
this.executionService = processEngineService.getExecutionService();
this.taskService = processEngineService.getTaskService();
this.historyService = processEngineService.getHistoryService();
this.managementService = processEngineService.getManagementService();
}
/**
* @return the repositoryService
*/
public RepositoryService getRepositoryService() {
return repositoryService;
}
/**
* @param repositoryService the repositoryService to set
*/
public void setRepositoryService(RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}
/**
* @return the executionService
*/
public ExecutionService getExecutionService() {
return executionService;
}
/**
* @param executionService the executionService to set
*/
public void setExecutionService(ExecutionService executionService) {
this.executionService = executionService;
}
/**
* @return the taskService
*/
public TaskService getTaskService() {
return taskService;
}
/**
* @param taskService the taskService to set
*/
public void setTaskService(TaskService taskService) {
this.taskService = taskService;
}
/**
* @return the historyService
*/
public HistoryService getHistoryService() {
return historyService;
}
/**
* @param historyService the historyService to set
*/
public void setHistoryService(HistoryService historyService) {
this.historyService = historyService;
}
/**
* @return the managementService
*/
public ManagementService getManagementService() {
return managementService;
}
/**
* @param managementService the managementService to set
*/
public void setManagementService(ManagementService managementService) {
this.managementService = managementService;
}
public IJbpmDAO getJbpmDAO() {
return jbpmDAO;
}
public void setJbpmDAO(IJbpmDAO jbpmDAO) {
this.jbpmDAO = jbpmDAO;
}
@Override
public Map
return taskService.getVariables(taskId, taskService.getVariableNames(taskId));
}
public IBaseUserRoleBO getBaseUserRoleService() {
return baseUserRoleService;
}
public void setBaseUserRoleService(IBaseUserRoleBO baseUserRoleService) {
this.baseUserRoleService = baseUserRoleService;
}
}
到這裡,Jbpm4的環境搭建基本完成,後續的介面呼叫都透過業務jbpmService來完成,因為這個注入了所有jbpm的service
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25261409/viewspace-1059010/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Spring與Web環境整合SpringWeb
- Maven環境搭建和介紹Maven
- Shiro(環境搭建與Spring整合)Spring
- androidNDK環境的搭建和使用Android
- Flutter開發環境搭建和除錯Flutter開發環境除錯
- Android systrace環境的搭建和使用Android
- 【SSH專案實戰】國稅協同平臺-2.環境搭建和整合
- 從零搭建和配置OSX開發環境開發環境
- Mac下git的環境搭建和基本使用MacGit
- WebSphere MQ傳輸環境搭建和測試WebMQ
- 部落格專案環境搭建和Model設計
- MySQL InnoDB Cluster環境搭建和簡單測試MySql
- wnmp(windows+nginx+mysql+php)環境搭建和配置WindowsNginxMySqlPHP
- SSM整合之CRUD環境搭建整合SSM
- 基於spring-boot&spring-data-jpa的web開發環境整合SpringbootWeb開發環境
- 手搭一個 React,Typescript,Koa,GraphQL 環境ReactTypeScript
- 「MoreThanJava」Day 1:環境搭建和程式基本結構元素Java
- Flutter 基礎(二)Flutter 開發環境搭建和 Hello WorldFlutter開發環境
- RocketMQ 視覺化環境搭建和基礎程式碼使用MQ視覺化
- 資料倉儲元件:Hive環境搭建和基礎用法元件Hive
- ORACLE 12C DATAGUARD環境搭建和主從切換Oracle
- 十、.net core(.NET 6)搭建ElasticSearch(ES)系列之Java環境搭建和Node.js環境搭建ElasticsearchJavaNode.js
- (全)Python 的虛擬環境構建和jupyter notebook 中虛擬環境切換Python
- spring boot環境抽象Spring Boot抽象
- 用 Spring 區分開發環境、測試環境、生產環境Spring開發環境
- Flutter基礎(二)Flutter最新開發環境搭建和Hello WorldFlutter開發環境
- TypeScript學習筆記(一)環境搭建和資料型別TypeScript筆記資料型別
- node環境搭建和vue-cli腳手架使用詳解Vue
- 【機器學習】在生產環境使用Kafka構建和部署大規模機器學習機器學習Kafka
- iOS--支付寶環境整合iOS
- phpwamp開發環境搭建詳解,phpwamp綠色整合環境開發環境一鍵搭建PHP開發環境
- Windows下搭載虛擬機器以及環境安裝Windows虛擬機
- vmware centos虛擬上面搭lamp環境,做埠對映CentOSLAMP
- 資料倉儲元件:HBase叢集環境搭建和應用案例元件
- 【NOIP複賽篇1】上機指南(一)環境搭建和執行
- 整合開發環境(IDE)的用途?開發環境IDE
- phpstudy 整合環境升級 MySQL 版本PHPMySql
- Tmux與Oh-my-zsh環境整合UX