- 浏览: 268697 次
- 性别:
- 来自: 新乡
文章分类
- 全部博客 (227)
- servciemix (10)
- db (18)
- javaTools (4)
- hibernate (31)
- web (3)
- spring (14)
- design pattern (4)
- java security (3)
- portal (1)
- ejb (6)
- session (2)
- java_lang (21)
- jbpm (29)
- struts (7)
- orgRights (2)
- project manager Jira (7)
- 跨库事务 (2)
- mysql (14)
- ubuntu (7)
- osgi (9)
- maven ant make (4)
- 分布式 高并发 高性能 (5)
- virgo-dm_server (0)
- osgi web (3)
- platform (1)
- smooks (1)
- business (1)
- 职场生涯 (14)
- Java编码格式 (2)
- web服务 (1)
- 计算机使用 (1)
- 健康工作生活的保障,工作中务必抛掉的不良心态 (4)
- 电信-网络监控 (1)
- 多线程-multithread (1)
- 海量数据-高性能 (2)
- Mybatis (1)
- web开发平台研发 (0)
- oracle (0)
- 应用服务器调优 (0)
- web前端 (0)
- servlet-jsp (0)
- tomcat (2)
- newtouch (1)
- portal_liferay (2)
- version control (1)
- apm-impact (2)
- tools (1)
- 研发管理 (1)
- 电商业务 (1)
- 生鲜电商市场调查 (0)
- PBX (0)
- 房东 (0)
最新评论
-
lifuchao:
...
权限问题 -
Branding:
谢谢,受教了,另外,CONN AS SYSDBA,必须是在操作 ...
Oracle密码忘记了怎么办? -
zhuchao_ko:
...
Portal实现原理 -
败类斯文:
不知道改哪里。。。木有见到红色。。表示悟性低了、、
jira error: Neither the JAVA_HOME nor the JRE_HOME environment variable is defin -
c__06:
正文:假如事务我是这样定义的: <tx:method n ...
Spring中Transactional配置
jbpm4.1得到Session
开启事务
并执行SQL操作
--------------------------------------------------------------------------------------------------------
package testProcess.basic;
import javax.annotation.Resource;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration(locations = { "classpath:applicationContext.xml" })
@ContextConfiguration(locations = { "/jbpm4/spring/applicationContext.xml" })
public class BasicTestProcess extends TestCase {
@Resource(name = "processEngine")
private ProcessEngine processEngine;
public RepositoryService repositoryService = null;
public ExecutionService executionService = null;
public TaskService taskService = null;
private static final Log log = LogFactory.getLog(BasicTestProcess.class);
protected void setUp() throws Exception {
repositoryService = this.getProcessEngines().getRepositoryService();
executionService = this.getProcessEngines().getExecutionService();
taskService = this.getProcessEngines().getTaskService();
}
public ProcessEngine getProcessEngines() {
return this.processEngine;
}
}
--------------------------------------------------------------------------------------------------------
package testProcess.del;
import java.util.Iterator;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.hibernate.DbSessionImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.junit.Test;
import testProcess.basic.BasicTestProcess;
public class Hibernate extends BasicTestProcess {
private static final String STRING = null;
@Test
public void jbpm4_1_Session_SQL_Detele() {
EnvironmentFactory environmentFactory = (EnvironmentFactory) this
.getProcessEngines();
Environment environment = environmentFactory.openEnvironment();
try {
EnvironmentImpl environmentImpl = (EnvironmentImpl) environment;
DbSessionImpl dbSession = (DbSessionImpl) environmentImpl
.getFromCurrent(DbSession.class);
// 得到Session
Session session = dbSession.getSession();
Transaction tx = session.beginTransaction();
// 业务操作开始
ExecutionImpl customer = (ExecutionImpl) session.get(
ExecutionImpl.class, new Long(32));
session.delete(customer);
// 业务操作结束
tx.commit();
} catch (Exception ex) {
ex.printStackTrace();
}
finally {
}
System.out.println("END");
}
@Test
public void jbpm4_1_Session_SQL_Query() {
EnvironmentFactory environmentFactory = (EnvironmentFactory) this
.getProcessEngines();
Environment environment = environmentFactory.openEnvironment();
try {
EnvironmentImpl environmentImpl = (EnvironmentImpl) environment;
DbSessionImpl dbSession = (DbSessionImpl) environmentImpl
.getFromCurrent(DbSession.class);
// 得到Session
Session session = dbSession.getSession();
Transaction tx = session.beginTransaction();
// 业务操作开始
String sql = "SELECT * FROM jbpmdb.jbpm4_execution j";
Query query = session.createSQLQuery(sql).addScalar("DBID_",
org.hibernate.Hibernate.STRING).addScalar("ACTIVITYNAME_",
org.hibernate.Hibernate.STRING);
//
List list = query.list();
Iterator iter = list.iterator();
while (iter.hasNext()) {
Object[] o = (Object[]) iter.next();
String str = (String) o[0];
String str1 = (String) o[1];
System.out.println(str);
System.out.println(str1);
}
// 业务操作结束
tx.commit();
} catch (Exception ex) {
ex.printStackTrace();
}
finally {
}
System.out.println("END");
}
}
发表评论
-
JBPM4的优秀博文链接
2011-08-31 22:39 13231 Jbpm4 IOC容器 http://www.it ... -
jbpm4 在tomcat6 下面ssh2 错误
2011-08-31 21:35 993异常:java.lang.LinkageError: load ... -
JBPM4表结构说明
2011-07-23 00:33 1292JBPM4表结构说明 (2010-05-05 14:10:02 ... -
jbpm流程文件的部署
2011-07-23 00:32 1190jbpm流程文件的部署 (2010-05-05 14:51:5 ... -
BPM4.3总结二 Jbpm4.3使用文档
2011-07-23 00:30 1151JBPM4.3总结二 [此博文包含图片] (2010-05-0 ... -
JBPM4.3总结五 合同审批实例
2011-07-23 00:27 1357JBPM4.3总结五 [此博文包含图片] (2010-05-0 ... -
JBPM4.3总结四 2.9任务管理
2011-07-23 00:26 1061JBPM4.3总结四 (2010-05-05 11:53:32 ... -
JBPM4.3总结三 集成自定义用户表
2011-07-23 00:24 1576JBPM4.3总结三 (2010-05-05 11:54:56 ... -
swing 实现JBPM 4.2例子
2011-07-22 13:20 1035swing 实现JBPM 4.2例子 http://blo ... -
JBPM4.3之任务管理
2011-07-22 12:37 1073JBPM4.3总结四(2010-05-05 11:53:32) ... -
jbpm frequently used url
2011-06-29 12:19 10641. http://old.family168.com/bb ... -
jbpm4 和 spring 的集成
2011-06-29 11:37 834jbpm4 内置了和 spring 的集成支持, 配置很简单, ... -
任务提交后为什么JBPM4_HIST_VAR不存在值
2011-06-29 11:05 1488JbpmProcessEngineUtil.getExecut ... -
权限问题
2011-06-29 09:05 1232机构 与 权限关系表:机构拥有与之关联的权限 应用 与 权限 ... -
jBPM4的运行期环境
2011-06-29 08:52 680一、运行期环境就是一个餐馆 二、jBPM4的运行期环境 E ... -
Jbpm4.3连接数据库配置
2011-06-29 08:35 1310Jbpm4.3连接数据库配置 收藏 1、我以mysql为例子 ... -
jbpm4 有18张表,简单介绍如下
2011-06-29 08:33 1804jbpm4 有18张表,简单介绍如下: JBPM4_DEP ... -
Drools
2011-06-28 20:59 1278Drools - The Business Logic int ... -
Activiti BPM Platform
2011-06-28 20:58 1121Activiti BPM Platform http://a ... -
jbpm之6 JBPM流程通过Aciton动态创建TaskInstance来实现“会签”
2011-06-28 20:57 832jbpm6(2007-03-14 23:32:38)转载 ...
相关推荐
加入 jBPM 社区可以获得技术支持和交流经验的机会。 ##### 2.5 源码 jBPM 的源代码开放给公众,开发者可以自行编译或贡献代码。 - **许可证**:Apache License 2.0 - **源代码**:可在 GitHub 或其他代码仓库获取...
4.1 jBPM API 16 4.11 Knowledge Base 17 4.12 会话 17 4.13 事件 19 4.2. Knowledge-based API 21 第五章 核心引擎:基础 21 5.1 创建一个流程 21 5.1.1 Eclipse BPMN2.0图形编辑器插件 22 5.1.2 使用XML定义流程 ...
介绍了jBPM API的使用,包括知识库(KnowledgeBase)、会话(Session)、相关键(Correlation Key)、相关属性(Correlation Properties)和事件(Events)。 #### 4.2 基于知识的API(Knowledge-based API) 说明...
#### 4.1 jBPM API 核心API是jBPM的基础,提供了与jBPM核心引擎交互的接口。 ##### 4.1.1 KnowledgeBase 知识库用于管理业务知识,包括流程定义和规则。 ##### 4.1.2 Session 会话对象允许用户与jBPM引擎交互,...
1.4. Seam 和jBPM:待办事项列表(todo list)示例..................................................................................................... 32 1.4.1. 理解代码....................................