Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
a2bfafed
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a2bfafed
编写于
10月 13, 2010
作者:
T
tombaeyens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-242 added getDeployedprocessDefinition to expose process definitions for introspection
上级
1982939c
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
107 addition
and
4 deletion
+107
-4
modules/activiti-engine/src/main/java/org/activiti/engine/RepositoryService.java
.../src/main/java/org/activiti/engine/RepositoryService.java
+4
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/RepositoryServiceImpl.java
.../java/org/activiti/engine/impl/RepositoryServiceImpl.java
+6
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/GetDeploymentProcessDefinitionCmd.java
...ti/engine/impl/cmd/GetDeploymentProcessDefinitionCmd.java
+37
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/db/ProcessDefinitionPersistenceTest.java
...viti/engine/test/db/ProcessDefinitionPersistenceTest.java
+35
-0
modules/activiti-pvm/src/main/java/org/activiti/pvm/process/PvmProcessDefinition.java
...n/java/org/activiti/pvm/process/PvmProcessDefinition.java
+1
-3
modules/activiti-pvm/src/main/java/org/activiti/pvm/process/ReadOnlyProcessDefinition.java
...a/org/activiti/pvm/process/ReadOnlyProcessDefinition.java
+24
-0
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/RepositoryService.java
浏览文件 @
a2bfafed
...
@@ -19,6 +19,7 @@ import java.util.List;
...
@@ -19,6 +19,7 @@ import java.util.List;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.pvm.process.ReadOnlyProcessDefinition
;
/** Service providing access to the repository of process definitions and deployments.
/** Service providing access to the repository of process definitions and deployments.
...
@@ -63,7 +64,9 @@ public interface RepositoryService {
...
@@ -63,7 +64,9 @@ public interface RepositoryService {
/** Query process definitions. */
/** Query process definitions. */
ProcessDefinitionQuery
createProcessDefinitionQuery
();
ProcessDefinitionQuery
createProcessDefinitionQuery
();
/** exposes a fully deployed process definition for introspection purposes. */
ReadOnlyProcessDefinition
getDeployedProcessDefinition
(
String
processDefinitionId
);
/** Query process definitions. */
/** Query process definitions. */
DeploymentQuery
createDeploymentQuery
();
DeploymentQuery
createDeploymentQuery
();
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/RepositoryServiceImpl.java
浏览文件 @
a2bfafed
...
@@ -19,6 +19,7 @@ import java.util.List;
...
@@ -19,6 +19,7 @@ import java.util.List;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.impl.cmd.DeleteDeploymentCmd
;
import
org.activiti.engine.impl.cmd.DeleteDeploymentCmd
;
import
org.activiti.engine.impl.cmd.DeployCmd
;
import
org.activiti.engine.impl.cmd.DeployCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceNamesCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceNamesCmd
;
import
org.activiti.engine.impl.repository.DeploymentBuilderImpl
;
import
org.activiti.engine.impl.repository.DeploymentBuilderImpl
;
...
@@ -26,6 +27,7 @@ import org.activiti.engine.repository.Deployment;
...
@@ -26,6 +27,7 @@ import org.activiti.engine.repository.Deployment;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.pvm.process.ReadOnlyProcessDefinition
;
/**
/**
...
@@ -65,5 +67,9 @@ public class RepositoryServiceImpl extends ServiceImpl implements RepositoryServ
...
@@ -65,5 +67,9 @@ public class RepositoryServiceImpl extends ServiceImpl implements RepositoryServ
public
DeploymentQuery
createDeploymentQuery
()
{
public
DeploymentQuery
createDeploymentQuery
()
{
return
new
DeploymentQueryImpl
(
commandExecutor
);
return
new
DeploymentQueryImpl
(
commandExecutor
);
}
}
public
ReadOnlyProcessDefinition
getDeployedProcessDefinition
(
String
processDefinitionId
)
{
return
commandExecutor
.
execute
(
new
GetDeploymentProcessDefinitionCmd
(
processDefinitionId
));
}
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/GetDeploymentProcessDefinitionCmd.java
0 → 100644
浏览文件 @
a2bfafed
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine.impl.cmd
;
import
org.activiti.engine.impl.cfg.RepositorySession
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.pvm.process.ReadOnlyProcessDefinition
;
/**
* @author Tom Baeyens
*/
public
class
GetDeploymentProcessDefinitionCmd
implements
Command
<
ReadOnlyProcessDefinition
>
{
protected
String
processDefinitionId
;
public
GetDeploymentProcessDefinitionCmd
(
String
processDefinitionId
)
{
this
.
processDefinitionId
=
processDefinitionId
;
}
public
ReadOnlyProcessDefinition
execute
(
CommandContext
commandContext
)
{
RepositorySession
repositorySession
=
commandContext
.
getRepositorySession
();
return
repositorySession
.
findDeployedProcessDefinitionById
(
processDefinitionId
);
}
}
modules/activiti-engine/src/test/java/org/activiti/engine/test/db/ProcessDefinitionPersistenceTest.java
浏览文件 @
a2bfafed
...
@@ -13,10 +13,15 @@
...
@@ -13,10 +13,15 @@
package
org.activiti.engine.test.db
;
package
org.activiti.engine.test.db
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
org.activiti.engine.impl.test.ActivitiInternalTestCase
;
import
org.activiti.engine.impl.test.ActivitiInternalTestCase
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.pvm.process.PvmActivity
;
import
org.activiti.pvm.process.PvmTransition
;
import
org.activiti.pvm.process.ReadOnlyProcessDefinition
;
/**
/**
...
@@ -40,4 +45,34 @@ public class ProcessDefinitionPersistenceTest extends ActivitiInternalTestCase {
...
@@ -40,4 +45,34 @@ public class ProcessDefinitionPersistenceTest extends ActivitiInternalTestCase {
repositoryService
.
deleteDeployment
(
deploymentId
);
repositoryService
.
deleteDeployment
(
deploymentId
);
}
}
public
void
testProcessDefinitionIntrospection
()
{
String
deploymentId
=
repositoryService
.
createDeployment
()
.
addClasspathResource
(
"org/activiti/engine/test/db/processOne.bpmn20.xml"
)
.
deploy
()
.
getId
();
ReadOnlyProcessDefinition
processDefinition
=
repositoryService
.
getDeployedProcessDefinition
(
"processOne:1"
);
assertEquals
(
"processOne:1"
,
processDefinition
.
getId
());
PvmActivity
start
=
processDefinition
.
findActivity
(
"start"
);
assertNotNull
(
start
);
assertEquals
(
"start"
,
start
.
getId
());
assertEquals
(
Collections
.
EMPTY_LIST
,
start
.
getActivities
());
List
<
PvmTransition
>
outgoingTransitions
=
start
.
getOutgoingTransitions
();
assertEquals
(
1
,
outgoingTransitions
.
size
());
PvmActivity
end
=
processDefinition
.
findActivity
(
"end"
);
assertNotNull
(
end
);
assertEquals
(
"end"
,
end
.
getId
());
PvmTransition
transition
=
outgoingTransitions
.
get
(
0
);
assertEquals
(
"flow1"
,
transition
.
getId
());
assertSame
(
start
,
transition
.
getSource
());
assertSame
(
end
,
transition
.
getDestination
());
repositoryService
.
deleteDeployment
(
deploymentId
);
}
}
}
modules/activiti-pvm/src/main/java/org/activiti/pvm/process/PvmProcessDefinition.java
浏览文件 @
a2bfafed
...
@@ -19,10 +19,8 @@ import org.activiti.pvm.runtime.PvmProcessInstance;
...
@@ -19,10 +19,8 @@ import org.activiti.pvm.runtime.PvmProcessInstance;
/**
/**
* @author Tom Baeyens
* @author Tom Baeyens
*/
*/
public
interface
PvmProcessDefinition
extends
PvmScope
{
public
interface
PvmProcessDefinition
extends
ReadOnlyProcessDefinition
{
PvmProcessInstance
createProcessInstance
();
PvmProcessInstance
createProcessInstance
();
PvmActivity
getInitial
();
}
}
modules/activiti-pvm/src/main/java/org/activiti/pvm/process/ReadOnlyProcessDefinition.java
0 → 100644
浏览文件 @
a2bfafed
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.pvm.process
;
/**
* @author Tom Baeyens
*/
public
interface
ReadOnlyProcessDefinition
extends
PvmScope
{
PvmActivity
getInitial
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录