- 浏览: 424950 次
- 性别:
- 来自: 北京
-
文章分类
- 全部博客 (318)
- js (20)
- JQuery (2)
- Java (46)
- Oracle (4)
- mysql (21)
- ExtJs (17)
- Excel (2)
- Linux (8)
- Sql (8)
- Jsp (2)
- hibernate (12)
- jbpm (17)
- eclipse (8)
- 名博收藏 (1)
- Junit (2)
- 应用集成 (3)
- web (10)
- jboss (3)
- Rest (3)
- 其它 (7)
- 磁盘分区管理 (1)
- spring (18)
- SSO (4)
- tomcat (4)
- CSS (7)
- MemCached (6)
- EhCache (4)
- weblogic (1)
- apache (6)
- Exception design (1)
- db (1)
- 分析模式 (1)
- jstl (1)
- jsf (0)
- firefox (2)
- MongoDB (4)
- androidpn (1)
- hadoop (1)
- cvs (1)
- 微信公众号 (2)
- 高并发 (4)
- 技术论坛 (1)
- CDN (1)
- JVM (16)
- 加密 (4)
- maven (2)
- jenkins (1)
- hessian (1)
- 大数据处理 (2)
- NIO (0)
- netty (1)
- redis (1)
- git (1)
- Elastic Job (0)
最新评论
-
zgw06629:
或者<pre>aaaabbbbcccc</p ...
javaDoc注释换行 -
ddnzero:
...
StringBuffer换行 -
maosijun:
。。。。
EXT CExt.form.ComboBox选择一次后只剩一个选项 -
ysa198584:
你这有问题,当我的代码出现User.class的时候,反编绎的 ...
java的class文件批量反编译 -
dongj0325:
看到您的博客,很受启发,但还有关于jbpm4.4 timer使 ...
JBPM定时器(Timer)之Repeat属性不能使用变量
JBPM4对流程定义的部署的所有方式如下:
package org.jbpm.api; import java.io.File; import java.io.InputStream; import java.net.URL; import java.util.zip.ZipInputStream; /** extends a {@link Deployment} with method for creating a new * deployment. * * @see RepositoryService#createDeployment() * * @author Tom Baeyens */ public interface NewDeployment extends Deployment { /** typically correspond to the file name or url or some other * form of identifying the source archive file for this deployment. */ NewDeployment setName(String name); /** the timestamp can optionally be given and represents the last updated timestamp * of the archive file that is being deployed. * JBoss deployer makes use of this to remember if a file is already deployed or not.*/ NewDeployment setTimestamp(long timestamp); /** adds a resource as a string */ NewDeployment addResourceFromString(String resourceName, String string); /** adds a resource as a string */ NewDeployment addResourceFromInputStream(String resourceName, InputStream inputStream); /** adds a resource as a resource from the classpath */ NewDeployment addResourceFromClasspath(String resourceName); /** adds a resource as a url */ NewDeployment addResourceFromUrl(URL url); /** adds a resource as a zip stream */ NewDeployment addResourcesFromZipInputStream(ZipInputStream zipInputStream); /** adds a resource from a file */ NewDeployment addResourceFromFile(File file); /** after adding resources, this will perform the actual deployment. * @return the generated deploymentId identification for this deployment * in the {@link RepositoryService repository}. */ String deploy(); }
但我在使用NewDeployment addResourceFromString(String resourceName, String string);来部署时却在表jbpm4_deployprop中没有数据并且JBPM也不提示部署有错,经查看其源代码才明白是怎么回事。
我部署的代码是这样写的:
repositoryService.createDeployment().addResourceFromString("process",getJpdlAsString().deploy()
问题就出在参数resourceName:process上,JBPM部署时会判断resourceName是否以“.jpdl.xml“作为后缀,如果是,JBPM才会解析第二个参数为流程定义,否则不做处理。所以在jbpm4_deployprop就不会有数据了。JBPM相关源码在ProcessDeployer.java中如下:
@SuppressWarnings("unchecked") public void deploy(DeploymentImpl deployment) { for (String resourceName: deployment.getResourceNames()) { if (resourceName.endsWith(extension)) { byte[] bytes = deployment.getBytes(resourceName); InputStream inputStream = new ByteArrayInputStream(bytes); Parse parse = parser.createParse(); parse.contextMapPut(Parse.CONTEXT_KEY_DEPLOYMENT, deployment); parse.setProblems(deployment.getProblems()); parse.setInputStream(inputStream); parse.execute(); List<ProcessDefinitionImpl> processDefinitions = (List<ProcessDefinitionImpl>) parse.getDocumentObject(); if (processDefinitions!=null) { for (ProcessDefinitionImpl processDefinition : processDefinitions) { if ((processDefinition != null) && (processDefinition.getName() != null)) { String processDefinitionName = processDefinition.getName(); processDefinition.setSuspended(deployment.isSuspended()); String imageResourceName = resourceName.substring(0, resourceName.lastIndexOf(extension)) + ".png"; if (deployment.getResourceNames().contains(imageResourceName)) { processDefinition.setImageResourceName(imageResourceName); } processDefinition.setDeploymentDbid(deployment.getDbid()); if (deployment.hasObjectProperties(processDefinitionName)) { String key = deployment.getProcessDefinitionKey(processDefinitionName); String id = deployment.getProcessDefinitionId(processDefinitionName); Long version = deployment.getProcessDefinitionVersion(processDefinitionName); processDefinition.setId(id); processDefinition.setKey(key); processDefinition.setVersion(version.intValue()); } else { checkKey(processDefinition, deployment); checkVersion(processDefinition, deployment); checkId(processDefinition, deployment); deployment.setProcessDefinitionId(processDefinitionName, processDefinition.getId()); deployment.setProcessDefinitionKey(processDefinitionName, processDefinition.getKey()); deployment.setProcessDefinitionVersion(processDefinitionName, new Long(processDefinition.getVersion())); //execute migration Map<ProcessDefinition, MigrationDescriptor> migrations = (Map<ProcessDefinition, MigrationDescriptor>)parse.contextMapGet(Parse.CONTEXT_KEY_MIGRATIONS); if (migrations != null) { MigrationDescriptor migrationDescriptor = migrations.get(processDefinition); if (migrationDescriptor != null) { InstanceMigrator.migrateAll(processDefinition, migrationDescriptor); } } } deployment.addObject(processDefinitionName, processDefinition); } } } } } }
所以我最终把 "process"改为"process.jpdl.xml"就OK了!
发表评论
-
工作流系统参考模型
2012-04-19 15:44 1025工作流系统参考模型 ... -
【转载】JBPM之长事务设计解析
2011-08-16 22:26 794JBPM之长事务设计解析 在 ... -
纵观jBPM:从jBPM3到jBPM5以及Activiti5
2011-05-11 16:45 873原文:http://www.infoq.com/c ... -
JBPM4.3 动态创建Transition时,需要在OpenEnvironment取得Activity后closeEnvironment
2010-10-18 10:06 1692JBPM4.3 动态创建Transition时,需要在Open ... -
java.lang.NoSuchMethodError: org.w3c.dom.Element.setUserData(Ljava/lang/String;L
2010-09-14 10:40 1534http://topic.csdn.net/u/2009083 ... -
JBPM4.3变量表达式不能以数字开头
2010-07-08 19:50 1443当我配置节点超时使用以数字开头的表达式变量如下: <s ... -
jBPM Decision Node
2010-06-12 15:37 1000jBPM Decision Node 决策节点的执 ... -
JBPM4.3中的variable
2010-05-24 19:40 800http://phoenix-clt.iteye.com/bl ... -
no environment to get org.jbpm.pvm.internal.session.RepositorySession
2010-04-14 15:47 2925我的代码是这样的: public List<Strin ... -
解决异常org.hibernate.exception.ConstraintViolationException: could not delete:
2010-04-13 10:06 3984调用方法RepositoryService.deleteDep ... -
Spring与Jbpm4.3集成:Cannot find the declaration of element 'jbpm-configuration'
2010-03-15 14:45 2528在单元测试Spring与Jbpm4.3集成的时报Cannot ... -
JBPM4与Spring的集成
2010-01-21 15:15 907JBPM4与Spring的集成: http://rongha ... -
Jbpm4的IOC容器(转)
2010-01-21 11:06 920Jbpm4的IOC容器(转):http://www.iteye ... -
jBPM4的运行期环境
2010-01-21 10:07 1435http://www.3648.com/article/200 ... -
JBPM定时器(Timer)之Repeat属性不能使用变量
2010-01-21 10:01 2095我曾 ... -
jBPM4 PVM的流程定义模型与过程调度
2010-01-15 12:14 1055jBPM4 PVM的流程定义模型与过程调度: http ...
相关推荐
4. **jbpm-jpdl-suite-3.2.3部署**: - 在MySQL中执行修改后的jbpm.jpdl.mysql.sql脚本,初始化jbpm所需的表结构。 - 配置jbpm的数据库连接信息,通常是在jbpm的配置文件中(如jbpm-config.xml或相关的JNDI配置)...
JBPM提供了完整的业务流程管理功能,支持图形化的设计工具、流程定义语言JPDL(JBPM Process Definition Language),以及灵活的任务管理和流程实例执行等功能。本文将详细介绍JBPM的开发步骤,包括环境搭建、流程...
3. **多格式日期解析**:工具支持自动解析不同格式的日期字符串,增强了对数据处理的灵活性。 4. **属性配置**:用户可以方便地为每个节点和流程转换配置属性,并实时看到这些更改在图形表示上的反映。 5. **XML...
- `addResourceFromString(String resourceName, String string)`:通过字符串添加资源。 - `addResourceFromInputStream(String resourceName, InputStream inputStream)`:通过输入流添加资源。 - `...
//仓库服务中创建部署,添加xml格式字符串部署资源,部署该资源 super.getRepositoryService().createDeployment() .addResourceFromString("process.jpdl.xml", xml).deploy(); this.process(request,...