Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z_stack
Activiti
提交
c70d320c
A
Activiti
项目概览
z_stack
/
Activiti
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Activiti
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c70d320c
编写于
11月 13, 2012
作者:
T
tijsrademakers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added model table for Activiti Modeler and added simple administration page to explorer
上级
b679dd9d
变更
83
展开全部
隐藏空白更改
内联
并排
Showing
83 changed file
with
2862 addition
and
461 deletion
+2862
-461
modules/activiti-bpmn-converter/pom.xml
modules/activiti-bpmn-converter/pom.xml
+1
-1
modules/activiti-engine/src/main/java/org/activiti/engine/RepositoryService.java
.../src/main/java/org/activiti/engine/RepositoryService.java
+37
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java
...rc/main/java/org/activiti/engine/impl/ModelQueryImpl.java
+162
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ModelQueryProperty.java
...ain/java/org/activiti/engine/impl/ModelQueryProperty.java
+54
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/RepositoryServiceImpl.java
.../java/org/activiti/engine/impl/RepositoryServiceImpl.java
+27
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
...iviti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
+3
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/CreateModelCmd.java
...ain/java/org/activiti/engine/impl/cmd/CreateModelCmd.java
+15
-4
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/DeleteModelCmd.java
...ain/java/org/activiti/engine/impl/cmd/DeleteModelCmd.java
+43
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/GetModelCmd.java
...c/main/java/org/activiti/engine/impl/cmd/GetModelCmd.java
+39
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/SaveModelCmd.java
.../main/java/org/activiti/engine/impl/cmd/SaveModelCmd.java
+47
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/interceptor/CommandContext.java
.../org/activiti/engine/impl/interceptor/CommandContext.java
+6
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntity.java
...iviti/engine/impl/persistence/entity/ExecutionEntity.java
+3
-5
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionManager.java
...viti/engine/impl/persistence/entity/ExecutionManager.java
+0
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricDetailManager.java
...engine/impl/persistence/entity/HistoricDetailManager.java
+1
-7
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ModelEntity.java
.../activiti/engine/impl/persistence/entity/ModelEntity.java
+119
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ModelManager.java
...activiti/engine/impl/persistence/entity/ModelManager.java
+72
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ProcessDefinitionManager.java
...ine/impl/persistence/entity/ProcessDefinitionManager.java
+0
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/TaskManager.java
.../activiti/engine/impl/persistence/entity/TaskManager.java
+1
-2
modules/activiti-engine/src/main/java/org/activiti/engine/repository/Model.java
...e/src/main/java/org/activiti/engine/repository/Model.java
+49
-0
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ModelQuery.java
.../main/java/org/activiti/engine/repository/ModelQuery.java
+68
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.engine.sql
...ces/org/activiti/db/create/activiti.db2.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.engine.sql
...rces/org/activiti/db/create/activiti.h2.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.engine.sql
...s/org/activiti/db/create/activiti.mssql.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.engine.sql
...s/org/activiti/db/create/activiti.mysql.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.engine.sql
.../org/activiti/db/create/activiti.oracle.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.engine.sql
...rg/activiti/db/create/activiti.postgres.create.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.db2.drop.engine.sql
...sources/org/activiti/db/drop/activiti.db2.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.h2.drop.engine.sql
...esources/org/activiti/db/drop/activiti.h2.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.mssql.drop.engine.sql
...urces/org/activiti/db/drop/activiti.mssql.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.mysql.drop.engine.sql
...urces/org/activiti/db/drop/activiti.mysql.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.oracle.drop.engine.sql
...rces/org/activiti/db/drop/activiti.oracle.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.postgres.drop.engine.sql
...es/org/activiti/db/drop/activiti.postgres.drop.engine.sql
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Model.xml
...c/main/resources/org/activiti/db/mapping/entity/Model.xml
+107
-0
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/mappings.xml
...e/src/main/resources/org/activiti/db/mapping/mappings.xml
+1
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.510.to.511.engine.sql
...db/upgrade/activiti.db2.upgradestep.510.to.511.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.510.to.511.engine.sql
.../db/upgrade/activiti.h2.upgradestep.510.to.511.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.510.to.511.engine.sql
.../upgrade/activiti.mssql.upgradestep.510.to.511.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.510.to.511.engine.sql
.../upgrade/activiti.mysql.upgradestep.510.to.511.engine.sql
+12
-0
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.510.to.511.engine.sql
...upgrade/activiti.oracle.upgradestep.510.to.511.engine.sql
+13
-1
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.510.to.511.engine.sql
...grade/activiti.postgres.upgradestep.510.to.511.engine.sql
+13
-1
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/ModelQueryTest.java
...g/activiti/engine/test/api/repository/ModelQueryTest.java
+144
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/RepositoryServiceTest.java
...iti/engine/test/api/repository/RepositoryServiceTest.java
+38
-2
modules/activiti-spring/src/test/java/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.java
...ing/test/servicetask/ServiceTaskSpringDelegationTest.java
+17
-0
modules/activiti-spring/src/test/resources/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.testAsyncDelegateExpression.bpmn20.xml
...ringDelegationTest.testAsyncDelegateExpression.bpmn20.xml
+28
-0
modules/activiti-spring/src/test/resources/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.testAsyncMethodExpressionOnSpringBean.bpmn20.xml
...tionTest.testAsyncMethodExpressionOnSpringBean.bpmn20.xml
+23
-0
modules/activiti-webapp-explorer2/pom.xml
modules/activiti-webapp-explorer2/pom.xml
+1
-4
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/data/dao/BaseDao.java
...2/src/main/java/org/activiti/editor/data/dao/BaseDao.java
+0
-141
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/rest/model/ModelEditorJsonRestResource.java
...tiviti/editor/rest/model/ModelEditorJsonRestResource.java
+6
-7
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/rest/model/ModelSaveRestResource.java
...org/activiti/editor/rest/model/ModelSaveRestResource.java
+12
-9
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/test/listener/TestDataListener.java
...a/org/activiti/editor/test/listener/TestDataListener.java
+0
-77
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/ConvertProcessDefinitionPopupWindow.java
...tiviti/editor/ui/ConvertProcessDefinitionPopupWindow.java
+26
-19
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/CopyModelPopupWindow.java
...ain/java/org/activiti/editor/ui/CopyModelPopupWindow.java
+14
-11
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/DeleteModelPopupWindow.java
...n/java/org/activiti/editor/ui/DeleteModelPopupWindow.java
+8
-5
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionDetailPanel.java
...ctiviti/editor/ui/EditorProcessDefinitionDetailPanel.java
+10
-7
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionInfoComponent.java
...iviti/editor/ui/EditorProcessDefinitionInfoComponent.java
+5
-7
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionPage.java
...a/org/activiti/editor/ui/EditorProcessDefinitionPage.java
+7
-8
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/NewModelPopupWindow.java
...main/java/org/activiti/editor/ui/NewModelPopupWindow.java
+39
-28
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/DefaultViewManager.java
...c/main/java/org/activiti/explorer/DefaultViewManager.java
+9
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Messages.java
...plorer2/src/main/java/org/activiti/explorer/Messages.java
+26
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ViewManager.java
...rer2/src/main/java/org/activiti/explorer/ViewManager.java
+4
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/demo/DemoDataGenerator.java
...in/java/org/activiti/explorer/demo/DemoDataGenerator.java
+42
-1
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/navigation/NavigatorManager.java
...va/org/activiti/explorer/navigation/NavigatorManager.java
+2
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/navigation/TaskNavigator.java
.../java/org/activiti/explorer/navigation/TaskNavigator.java
+0
-2
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/ManagementMenuBar.java
...rg/activiti/explorer/ui/management/ManagementMenuBar.java
+10
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminCompletedInstancesPanel.java
...rer/ui/management/admin/AdminCompletedInstancesPanel.java
+504
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminDatabaseSettingsPanel.java
...lorer/ui/management/admin/AdminDatabaseSettingsPanel.java
+167
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminRunningInstancesPanel.java
...lorer/ui/management/admin/AdminRunningInstancesPanel.java
+483
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdministrationNavigator.java
...explorer/ui/management/admin/AdministrationNavigator.java
+41
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdministrationPage.java
...viti/explorer/ui/management/admin/AdministrationPage.java
+113
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/ProcessDefinitionImageStreamResourceBuilder.java
.../process/ProcessDefinitionImageStreamResourceBuilder.java
+21
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/CopyModelClickListener.java
.../explorer/ui/process/listener/CopyModelClickListener.java
+3
-3
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/DeleteModelClickListener.java
...xplorer/ui/process/listener/DeleteModelClickListener.java
+3
-3
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/DeployProcessDefinitionClickListener.java
...rocess/listener/DeployProcessDefinitionClickListener.java
+4
-4
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/EditModelClickListener.java
.../explorer/ui/process/listener/EditModelClickListener.java
+2
-2
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/ExportModelClickListener.java
...xplorer/ui/process/listener/ExportModelClickListener.java
+4
-5
modules/activiti-webapp-explorer2/src/main/resources/META-INF/persistence.xml
...app-explorer2/src/main/resources/META-INF/persistence.xml
+0
-18
modules/activiti-webapp-explorer2/src/main/resources/log4j.xml
...es/activiti-webapp-explorer2/src/main/resources/log4j.xml
+0
-17
modules/activiti-webapp-explorer2/src/main/resources/messages.properties
...i-webapp-explorer2/src/main/resources/messages.properties
+27
-1
modules/activiti-webapp-explorer2/src/main/resources/org/activiti/explorer/demo/model/test.model.json
...esources/org/activiti/explorer/demo/model/test.model.json
+0
-0
modules/activiti-webapp-explorer2/src/main/resources/org/activiti/explorer/demo/model/test.svg
.../main/resources/org/activiti/explorer/demo/model/test.svg
+0
-0
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
...-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
+12
-40
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/web.xml
...activiti-webapp-explorer2/src/main/webapp/WEB-INF/web.xml
+0
-8
pom.xml
pom.xml
+0
-5
未找到文件。
modules/activiti-bpmn-converter/pom.xml
浏览文件 @
c70d320c
...
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<name>
Activiti -
Engine
</name>
<name>
Activiti -
BPMN Converter
</name>
<artifactId>
activiti-bpmn-converter
</artifactId>
<parent>
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/RepositoryService.java
浏览文件 @
c70d320c
...
...
@@ -16,9 +16,18 @@ package org.activiti.engine;
import
java.io.InputStream
;
import
java.util.List
;
import
org.activiti.engine.identity.User
;
import
org.activiti.engine.impl.ModelQueryImpl
;
import
org.activiti.engine.impl.cmd.CreateModelCmd
;
import
org.activiti.engine.impl.cmd.DeleteModelCmd
;
import
org.activiti.engine.impl.cmd.GetModelCmd
;
import
org.activiti.engine.impl.cmd.SaveModelCmd
;
import
org.activiti.engine.impl.persistence.entity.ModelEntity
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.DiagramLayout
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ModelQuery
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.engine.task.IdentityLink
;
...
...
@@ -154,6 +163,34 @@ public interface RepositoryService {
*/
DiagramLayout
getProcessDiagramLayout
(
String
processDefinitionId
);
/**
* Creates a new model. The model is transient and must be saved using
* {@link #saveModel(Model)}.
*/
public
Model
newModel
();
/**
* Saves the model. If the model already existed, the model is updated
* otherwise a new model is created.
* @param model model to save, cannot be null.
*/
public
void
saveModel
(
Model
model
);
/**
* @param modelId id of model to delete, cannot be null. When an id is passed
* for an unexisting model, this operation is ignored.
*/
public
void
deleteModel
(
String
modelId
);
/** Query models. */
public
ModelQuery
createModelQuery
();
/**
* Returns the {@link Model}
* @param modelId id of model
*/
public
Model
getModel
(
String
modelId
);
/**
* Authorizes a candidate user for a process definition.
* @param processDefinitionId id of the process definition, cannot be null.
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ModelQueryImpl.java
0 → 100644
浏览文件 @
c70d320c
/* 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
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.interceptor.CommandExecutor
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ModelQuery
;
/**
* @author Tijs Rademakers
*/
public
class
ModelQueryImpl
extends
AbstractQuery
<
ModelQuery
,
Model
>
implements
ModelQuery
{
private
static
final
long
serialVersionUID
=
1L
;
protected
String
id
;
protected
String
category
;
protected
String
categoryLike
;
protected
String
categoryNotEquals
;
protected
String
name
;
protected
String
nameLike
;
protected
Integer
version
;
public
ModelQueryImpl
()
{
}
public
ModelQueryImpl
(
CommandContext
commandContext
)
{
super
(
commandContext
);
}
public
ModelQueryImpl
(
CommandExecutor
commandExecutor
)
{
super
(
commandExecutor
);
}
public
ModelQueryImpl
modelId
(
String
modelId
)
{
this
.
id
=
modelId
;
return
this
;
}
public
ModelQueryImpl
modelCategory
(
String
category
)
{
if
(
category
==
null
)
{
throw
new
ActivitiException
(
"category is null"
);
}
this
.
category
=
category
;
return
this
;
}
public
ModelQueryImpl
modelCategoryLike
(
String
categoryLike
)
{
if
(
categoryLike
==
null
)
{
throw
new
ActivitiException
(
"categoryLike is null"
);
}
this
.
categoryLike
=
categoryLike
;
return
this
;
}
public
ModelQueryImpl
modelCategoryNotEquals
(
String
categoryNotEquals
)
{
if
(
categoryNotEquals
==
null
)
{
throw
new
ActivitiException
(
"categoryNotEquals is null"
);
}
this
.
categoryNotEquals
=
categoryNotEquals
;
return
this
;
}
public
ModelQueryImpl
modelName
(
String
name
)
{
if
(
name
==
null
)
{
throw
new
ActivitiException
(
"name is null"
);
}
this
.
name
=
name
;
return
this
;
}
public
ModelQueryImpl
modelNameLike
(
String
nameLike
)
{
if
(
nameLike
==
null
)
{
throw
new
ActivitiException
(
"nameLike is null"
);
}
this
.
nameLike
=
nameLike
;
return
this
;
}
public
ModelQueryImpl
modelVersion
(
Integer
version
)
{
if
(
version
==
null
)
{
throw
new
ActivitiException
(
"version is null"
);
}
else
if
(
version
<=
0
)
{
throw
new
ActivitiException
(
"version must be positive"
);
}
this
.
version
=
version
;
return
this
;
}
//sorting ////////////////////////////////////////////
public
ModelQuery
orderByModelCategory
()
{
return
orderBy
(
ModelQueryProperty
.
MODEL_CATEGORY
);
}
public
ModelQuery
orderByModelId
()
{
return
orderBy
(
ModelQueryProperty
.
MODEL_ID
);
}
public
ModelQuery
orderByModelVersion
()
{
return
orderBy
(
ModelQueryProperty
.
MODEL_VERSION
);
}
public
ModelQuery
orderByModelName
()
{
return
orderBy
(
ModelQueryProperty
.
MODEL_NAME
);
}
//results ////////////////////////////////////////////
public
long
executeCount
(
CommandContext
commandContext
)
{
checkQueryOk
();
return
commandContext
.
getModelManager
()
.
findModelCountByQueryCriteria
(
this
);
}
public
List
<
Model
>
executeList
(
CommandContext
commandContext
,
Page
page
)
{
checkQueryOk
();
return
commandContext
.
getModelManager
()
.
findModelsByQueryCriteria
(
this
,
page
);
}
//getters ////////////////////////////////////////////
public
String
getId
()
{
return
id
;
}
public
String
getName
()
{
return
name
;
}
public
String
getNameLike
()
{
return
nameLike
;
}
public
Integer
getVersion
()
{
return
version
;
}
public
String
getCategory
()
{
return
category
;
}
public
String
getCategoryLike
()
{
return
categoryLike
;
}
public
String
getCategoryNotEquals
()
{
return
categoryNotEquals
;
}
}
modules/activiti-
webapp-explorer2/src/main/java/org/activiti/editor/data/model/ModelData
.java
→
modules/activiti-
engine/src/main/java/org/activiti/engine/impl/ModelQueryProperty
.java
浏览文件 @
c70d320c
...
...
@@ -10,61 +10,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.editor.data.model
;
import
java.io.Serializable
;
package
org.activiti.engine.impl
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.query.QueryProperty
;
import
org.activiti.engine.repository.ModelQuery
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
/**
* Contains the possible properties that can be used in a {@link ModelQuery}.
*
* @author Tijs Rademakers
*/
@Entity
public
class
ModelData
extends
BaseDatabaseObject
implements
Serializable
{
public
class
ModelQueryProperty
implements
QueryProperty
{
private
static
final
long
serialVersionUID
=
1L
;
protected
String
name
;
protected
int
revision
;
@Column
(
columnDefinition
=
"TEXT"
)
protected
String
modelJson
;
@Column
(
columnDefinition
=
"LONGTEXT"
)
protected
String
modelSvg
;
private
static
final
Map
<
String
,
ModelQueryProperty
>
properties
=
new
HashMap
<
String
,
ModelQueryProperty
>();
@Column
(
columnDefinition
=
"LONGTEXT"
)
protected
String
modelEditorJson
;
public
static
final
ModelQueryProperty
MODEL_CATEGORY
=
new
ModelQueryProperty
(
"RES.CATEGORY_"
);
public
static
final
ModelQueryProperty
MODEL_ID
=
new
ModelQueryProperty
(
"RES.ID_"
);
public
static
final
ModelQueryProperty
MODEL_VERSION
=
new
ModelQueryProperty
(
"RES.VERSION_"
);
public
static
final
ModelQueryProperty
MODEL_NAME
=
new
ModelQueryProperty
(
"RES.NAME_"
);
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
private
String
name
;
public
ModelQueryProperty
(
String
name
)
{
this
.
name
=
name
;
properties
.
put
(
name
,
this
);
}
public
int
getRevision
()
{
return
revision
;
}
public
void
setRevision
(
int
revision
)
{
this
.
revision
=
revision
;
}
public
String
getModelJson
()
{
return
modelJson
;
}
public
void
setModelJson
(
String
modelJson
)
{
this
.
modelJson
=
modelJson
;
}
public
String
getModelSvg
()
{
return
modelSvg
;
}
public
void
setModelSvg
(
String
modelSvg
)
{
this
.
modelSvg
=
modelSvg
;
}
public
String
getModelEditorJson
()
{
return
modelEditorJson
;
public
String
getName
()
{
return
name
;
}
public
void
setModelEditorJson
(
String
modelEditorJson
)
{
this
.
modelEditorJson
=
modelEditorJson
;
public
static
ModelQueryProperty
findByName
(
String
propertyName
)
{
return
properties
.
get
(
propertyName
);
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/RepositoryServiceImpl.java
浏览文件 @
c70d320c
...
...
@@ -19,8 +19,10 @@ import java.util.List;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.impl.cmd.ActivateProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.AddIdentityLinkForProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.CreateModelCmd
;
import
org.activiti.engine.impl.cmd.DeleteDeploymentCmd
;
import
org.activiti.engine.impl.cmd.DeleteIdentityLinkForProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.DeleteModelCmd
;
import
org.activiti.engine.impl.cmd.DeployCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentProcessDiagramCmd
;
...
...
@@ -29,13 +31,18 @@ import org.activiti.engine.impl.cmd.GetDeploymentProcessModelCmd;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceCmd
;
import
org.activiti.engine.impl.cmd.GetDeploymentResourceNamesCmd
;
import
org.activiti.engine.impl.cmd.GetIdentityLinksForProcessDefinitionCmd
;
import
org.activiti.engine.impl.cmd.GetModelCmd
;
import
org.activiti.engine.impl.cmd.SaveModelCmd
;
import
org.activiti.engine.impl.cmd.SuspendProcessDefinitionCmd
;
import
org.activiti.engine.impl.persistence.entity.ModelEntity
;
import
org.activiti.engine.impl.pvm.ReadOnlyProcessDefinition
;
import
org.activiti.engine.impl.repository.DeploymentBuilderImpl
;
import
org.activiti.engine.repository.Deployment
;
import
org.activiti.engine.repository.DeploymentBuilder
;
import
org.activiti.engine.repository.DeploymentQuery
;
import
org.activiti.engine.repository.DiagramLayout
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ModelQuery
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.repository.ProcessDefinitionQuery
;
import
org.activiti.engine.task.IdentityLink
;
...
...
@@ -120,6 +127,26 @@ public class RepositoryServiceImpl extends ServiceImpl implements RepositoryServ
return
commandExecutor
.
execute
(
new
GetDeploymentProcessDiagramLayoutCmd
(
processDefinitionId
));
}
public
Model
newModel
()
{
return
commandExecutor
.
execute
(
new
CreateModelCmd
());
}
public
void
saveModel
(
Model
model
)
{
commandExecutor
.
execute
(
new
SaveModelCmd
((
ModelEntity
)
model
));
}
public
void
deleteModel
(
String
modelId
)
{
commandExecutor
.
execute
(
new
DeleteModelCmd
(
modelId
));
}
public
ModelQuery
createModelQuery
()
{
return
new
ModelQueryImpl
(
commandExecutor
);
}
public
Model
getModel
(
String
modelId
)
{
return
commandExecutor
.
execute
(
new
GetModelCmd
(
modelId
));
}
public
void
addCandidateStarterUser
(
String
processDefinitionId
,
String
userId
)
{
commandExecutor
.
execute
(
new
AddIdentityLinkForProcessDefinitionCmd
(
processDefinitionId
,
userId
,
null
));
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
浏览文件 @
c70d320c
...
...
@@ -79,7 +79,6 @@ import org.activiti.engine.impl.form.LongFormType;
import
org.activiti.engine.impl.form.StringFormType
;
import
org.activiti.engine.impl.history.handler.HistoryParseListener
;
import
org.activiti.engine.impl.interceptor.CommandContextFactory
;
import
org.activiti.engine.impl.interceptor.CommandContextInterceptor
;
import
org.activiti.engine.impl.interceptor.CommandExecutor
;
import
org.activiti.engine.impl.interceptor.CommandExecutorImpl
;
import
org.activiti.engine.impl.interceptor.CommandInterceptor
;
...
...
@@ -111,12 +110,13 @@ import org.activiti.engine.impl.persistence.entity.GroupManager;
import
org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricDetailManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.IdentityInfoManager
;
import
org.activiti.engine.impl.persistence.entity.IdentityLinkManager
;
import
org.activiti.engine.impl.persistence.entity.JobManager
;
import
org.activiti.engine.impl.persistence.entity.MembershipManager
;
import
org.activiti.engine.impl.persistence.entity.ModelManager
;
import
org.activiti.engine.impl.persistence.entity.ProcessDefinitionManager
;
import
org.activiti.engine.impl.persistence.entity.PropertyManager
;
import
org.activiti.engine.impl.persistence.entity.ResourceManager
;
...
...
@@ -610,6 +610,7 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
addSessionFactory
(
new
GenericManagerFactory
(
AttachmentManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
CommentManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
DeploymentManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
ModelManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
ExecutionManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
HistoricActivityInstanceManager
.
class
));
addSessionFactory
(
new
GenericManagerFactory
(
HistoricDetailManager
.
class
));
...
...
modules/activiti-
webapp-explorer2/src/main/java/org/activiti/editor/exception/ModelException
.java
→
modules/activiti-
engine/src/main/java/org/activiti/engine/impl/cmd/CreateModelCmd
.java
浏览文件 @
c70d320c
...
...
@@ -10,16 +10,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.editor.exception
;
package
org.activiti.engine.impl.cmd
;
import
java.io.Serializable
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.repository.Model
;
/**
* @author Tijs Rademakers
*/
public
class
ModelException
extends
RuntimeException
{
public
class
CreateModelCmd
implements
Command
<
Model
>,
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
ModelException
(
String
message
)
{
super
(
message
);
public
Model
execute
(
CommandContext
commandContext
)
{
return
commandContext
.
getModelManager
()
.
createNewModel
();
}
}
modules/activiti-
webapp-explorer2/src/main/java/org/activiti/editor/servlet/listener/EntityManagerListener
.java
→
modules/activiti-
engine/src/main/java/org/activiti/engine/impl/cmd/DeleteModelCmd
.java
浏览文件 @
c70d320c
...
...
@@ -10,37 +10,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine.impl.cmd
;
package
org.activiti.editor.servlet.listener
;
import
java.io.Serializable
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
javax.persistence.EntityManagerFactory
;
import
javax.persistence.Persistence
;
import
javax.servlet.ServletContextEvent
;
import
javax.servlet.ServletContextListener
;
/**
* @author Tijs Rademakers
*/
public
class
EntityManagerListener
implements
ServletContextListener
{
public
class
DeleteModelCmd
implements
Command
<
Void
>,
Serializable
{
pr
otected
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
EntityManagerListener
.
class
.
getName
())
;
private
static
EntityManagerFactory
pathwaysFactory
;
pr
ivate
static
final
long
serialVersionUID
=
1L
;
String
modelId
;
public
void
contextDestroyed
(
ServletContextEvent
context
)
{
LOGGER
.
log
(
Level
.
INFO
,
"Destroying EntityManager factory"
);
pathwaysFactory
.
close
();
}
public
void
contextInitialized
(
ServletContextEvent
context
)
{
LOGGER
.
log
(
Level
.
INFO
,
"Creating EntityManager factory"
);
pathwaysFactory
=
Persistence
.
createEntityManagerFactory
(
"org.activiti.jpa"
);
public
DeleteModelCmd
(
String
modelId
)
{
this
.
modelId
=
modelId
;
}
public
static
EntityManagerFactory
getEntityManagerFactory
()
{
return
pathwaysFactory
;
public
Void
execute
(
CommandContext
commandContext
)
{
if
(
modelId
==
null
)
{
throw
new
ActivitiException
(
"modelId is null"
);
}
commandContext
.
getModelManager
().
deleteModel
(
modelId
);
return
null
;
}
}
modules/activiti-
webapp-explorer2/src/main/java/org/activiti/editor/data/model/BaseDatabaseObject
.java
→
modules/activiti-
engine/src/main/java/org/activiti/engine/impl/cmd/GetModelCmd
.java
浏览文件 @
c70d320c
...
...
@@ -11,27 +11,29 @@
* limitations under the License.
*/
package
org.activiti.editor.data.model
;
package
org.activiti.engine.impl.cmd
;
import
java.io.Serializable
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.persistence.entity.ModelEntity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.MappedSuperclass
;
/**
* @author Tijs Rademakers
*/
@MappedSuperclass
public
abstract
class
BaseDatabaseObject
{
@Id
@GeneratedValue
private
long
objectId
;
public
class
GetModelCmd
implements
Command
<
ModelEntity
>,
Serializable
{
public
long
getObjectId
()
{
return
objectId
;
private
static
final
long
serialVersionUID
=
1L
;
protected
String
modelId
;
public
GetModelCmd
(
String
modelId
)
{
this
.
modelId
=
modelId
;
}
public
void
setObjectId
(
long
objectId
)
{
this
.
objectId
=
objectId
;
public
ModelEntity
execute
(
CommandContext
commandContext
)
{
return
Context
.
getCommandContext
().
getModelManager
().
findModelById
(
modelId
)
;
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/SaveModelCmd.java
0 → 100644
浏览文件 @
c70d320c
/* 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
java.io.Serializable
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.persistence.entity.ModelEntity
;
/**
* @author Tijs Rademakers
*/
public
class
SaveModelCmd
implements
Command
<
Void
>,
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
protected
ModelEntity
model
;
public
SaveModelCmd
(
ModelEntity
model
)
{
this
.
model
=
model
;
}
public
Void
execute
(
CommandContext
commandContext
)
{
if
(
model
==
null
)
{
throw
new
ActivitiException
(
"model is null"
);
}
if
(
model
.
getId
()
==
null
)
{
commandContext
.
getModelManager
().
insertModel
(
model
);
}
else
{
commandContext
.
getModelManager
().
updateModel
(
model
);
}
return
null
;
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/interceptor/CommandContext.java
浏览文件 @
c70d320c
...
...
@@ -35,12 +35,13 @@ import org.activiti.engine.impl.persistence.entity.GroupManager;
import
org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricDetailManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceManager
;
import
org.activiti.engine.impl.persistence.entity.IdentityInfoManager
;
import
org.activiti.engine.impl.persistence.entity.IdentityLinkManager
;
import
org.activiti.engine.impl.persistence.entity.JobManager
;
import
org.activiti.engine.impl.persistence.entity.MembershipManager
;
import
org.activiti.engine.impl.persistence.entity.ModelManager
;
import
org.activiti.engine.impl.persistence.entity.ProcessDefinitionManager
;
import
org.activiti.engine.impl.persistence.entity.PropertyManager
;
import
org.activiti.engine.impl.persistence.entity.ResourceManager
;
...
...
@@ -212,6 +213,10 @@ public class CommandContext {
public
ProcessDefinitionManager
getProcessDefinitionManager
()
{
return
getSession
(
ProcessDefinitionManager
.
class
);
}
public
ModelManager
getModelManager
()
{
return
getSession
(
ModelManager
.
class
);
}
public
ExecutionManager
getExecutionManager
()
{
return
getSession
(
ExecutionManager
.
class
);
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntity.java
浏览文件 @
c70d320c
...
...
@@ -21,8 +21,6 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
org.activiti.engine.EngineServices
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.impl.HistoricActivityInstanceQueryImpl
;
import
org.activiti.engine.impl.bpmn.parser.BpmnParse
;
import
org.activiti.engine.impl.bpmn.parser.EventSubscriptionDeclaration
;
...
...
@@ -428,7 +426,7 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
return
childExecutions
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
public
void
takeAll
(
List
<
PvmTransition
>
transitions
,
List
<
ActivityExecution
>
recyclableExecutions
)
{
transitions
=
new
ArrayList
<
PvmTransition
>(
transitions
);
recyclableExecutions
=
(
recyclableExecutions
!=
null
?
new
ArrayList
<
ActivityExecution
>(
recyclableExecutions
)
:
new
ArrayList
<
ActivityExecution
>());
...
...
@@ -583,7 +581,7 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
return
executions
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
protected
void
ensureExecutionsInitialized
()
{
if
(
executions
==
null
)
{
this
.
executions
=
(
List
)
Context
...
...
@@ -935,7 +933,7 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
return
replacedBy
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
public
void
setReplacedBy
(
InterpretableExecution
replacedBy
)
{
this
.
replacedBy
=
(
ExecutionEntity
)
replacedBy
;
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionManager.java
浏览文件 @
c70d320c
...
...
@@ -18,7 +18,6 @@ import java.util.List;
import
java.util.Map
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.ExecutionQueryImpl
;
import
org.activiti.engine.impl.AbstractVariableQueryImpl
;
import
org.activiti.engine.impl.Page
;
import
org.activiti.engine.impl.context.Context
;
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricDetailManager.java
浏览文件 @
c70d320c
...
...
@@ -19,8 +19,6 @@ import org.activiti.engine.history.HistoricDetail;
import
org.activiti.engine.impl.HistoricDetailQueryImpl
;
import
org.activiti.engine.impl.Page
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.db.DbSqlSession
;
import
org.activiti.engine.impl.persistence.AbstractHistoricManager
;
...
...
@@ -47,7 +45,7 @@ public class HistoricDetailManager extends AbstractHistoricManager {
// getDbSqlSession().delete(HistoricDetailEntity.class, historicDetail.getId());
// }
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
public
void
deleteHistoricDetailsByProcessInstanceId
(
String
historicProcessInstanceId
)
{
if
(
historyLevel
>=
ProcessEngineConfigurationImpl
.
HISTORYLEVEL_AUDIT
)
{
List
<
HistoricDetailEntity
>
historicDetails
=
(
List
)
getDbSqlSession
()
...
...
@@ -55,10 +53,6 @@ public class HistoricDetailManager extends AbstractHistoricManager {
.
processInstanceId
(
historicProcessInstanceId
)
.
list
();
HistoricDetailManager
historicDetailManager
=
Context
.
getCommandContext
()
.
getHistoricDetailManager
();
for
(
HistoricDetailEntity
historicDetail:
historicDetails
)
{
historicDetail
.
delete
();
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ModelEntity.java
0 → 100644
浏览文件 @
c70d320c
/* 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.persistence.entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.db.PersistentObject
;
import
org.activiti.engine.repository.Model
;
/**
* @author Tijs Rademakers
*/
public
class
ModelEntity
implements
Serializable
,
Model
,
PersistentObject
{
private
static
final
long
serialVersionUID
=
1L
;
protected
String
id
;
protected
String
name
;
protected
String
category
;
protected
Date
createTime
;
protected
Integer
version
;
protected
String
metaInfo
;
protected
byte
[]
editorSource
;
protected
byte
[]
editorSourceExtra
;
public
Object
getPersistentState
()
{
Map
<
String
,
Object
>
persistentState
=
new
HashMap
<
String
,
Object
>();
persistentState
.
put
(
"name"
,
this
.
name
);
persistentState
.
put
(
"category"
,
this
.
category
);
persistentState
.
put
(
"createTime"
,
this
.
createTime
);
persistentState
.
put
(
"version"
,
this
.
version
);
persistentState
.
put
(
"metaInfo"
,
this
.
metaInfo
);
persistentState
.
put
(
"editorSource"
,
this
.
editorSource
);
persistentState
.
put
(
"editorSourceExtra"
,
this
.
editorSourceExtra
);
return
persistentState
;
}
// getters and setters //////////////////////////////////////////////////////
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getVersion
()
{
return
version
;
}
public
void
setVersion
(
Integer
version
)
{
this
.
version
=
version
;
}
public
String
getMetaInfo
()
{
return
metaInfo
;
}
public
void
setMetaInfo
(
String
metaInfo
)
{
this
.
metaInfo
=
metaInfo
;
}
public
byte
[]
getEditorSource
()
{
return
editorSource
;
}
public
void
setEditorSource
(
byte
[]
editorSource
)
{
this
.
editorSource
=
editorSource
;
}
public
byte
[]
getEditorSourceExtra
()
{
return
editorSourceExtra
;
}
public
void
setEditorSourceExtra
(
byte
[]
editorSourceExtra
)
{
this
.
editorSourceExtra
=
editorSourceExtra
;
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ModelManager.java
0 → 100644
浏览文件 @
c70d320c
/* 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.persistence.entity
;
import
java.util.Date
;
import
java.util.List
;
import
org.activiti.engine.impl.ModelQueryImpl
;
import
org.activiti.engine.impl.Page
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.db.DbSqlSession
;
import
org.activiti.engine.impl.db.PersistentObject
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.persistence.AbstractManager
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ModelQuery
;
/**
* @author Tijs Rademakers
*/
public
class
ModelManager
extends
AbstractManager
{
public
Model
createNewModel
()
{
return
new
ModelEntity
();
}
public
void
insertModel
(
Model
model
)
{
((
ModelEntity
)
model
).
setCreateTime
(
new
Date
());
getDbSqlSession
().
insert
((
PersistentObject
)
model
);
}
public
void
updateModel
(
ModelEntity
updatedModel
)
{
CommandContext
commandContext
=
Context
.
getCommandContext
();
DbSqlSession
dbSqlSession
=
commandContext
.
getDbSqlSession
();
dbSqlSession
.
update
(
updatedModel
);
}
public
void
deleteModel
(
String
modelId
)
{
ModelEntity
model
=
getDbSqlSession
().
selectById
(
ModelEntity
.
class
,
modelId
);
getDbSqlSession
().
delete
(
model
);
}
public
ModelQuery
createNewModelQuery
()
{
return
new
ModelQueryImpl
(
Context
.
getProcessEngineConfiguration
().
getCommandExecutorTxRequired
());
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
Model
>
findModelsByQueryCriteria
(
ModelQueryImpl
query
,
Page
page
)
{
return
getDbSqlSession
().
selectList
(
"selectModelsByQueryCriteria"
,
query
,
page
);
}
public
long
findModelCountByQueryCriteria
(
ModelQueryImpl
query
)
{
return
(
Long
)
getDbSqlSession
().
selectOne
(
"selectModelCountByQueryCriteria"
,
query
);
}
public
ModelEntity
findModelById
(
String
modelId
)
{
return
(
ModelEntity
)
getDbSqlSession
().
selectOne
(
"selectModel"
,
modelId
);
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ProcessDefinitionManager.java
浏览文件 @
c70d320c
...
...
@@ -13,7 +13,6 @@
package
org.activiti.engine.impl.persistence.entity
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -23,7 +22,6 @@ import org.activiti.engine.identity.Group;
import
org.activiti.engine.identity.User
;
import
org.activiti.engine.impl.Page
;
import
org.activiti.engine.impl.ProcessDefinitionQueryImpl
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.persistence.AbstractManager
;
import
org.activiti.engine.repository.ProcessDefinition
;
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/TaskManager.java
浏览文件 @
c70d320c
...
...
@@ -30,7 +30,7 @@ import org.activiti.engine.task.Task;
*/
public
class
TaskManager
extends
AbstractManager
{
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
public
void
deleteTasksByProcessInstanceId
(
String
processInstanceId
,
String
deleteReason
,
boolean
cascade
)
{
List
<
TaskEntity
>
tasks
=
(
List
)
getDbSqlSession
()
.
createTaskQuery
()
...
...
@@ -91,7 +91,6 @@ public class TaskManager extends AbstractManager {
return
getDbSqlSession
().
selectList
(
"selectTasksByExecutionId"
,
executionId
);
}
@SuppressWarnings
(
"unchecked"
)
@Deprecated
public
List
<
Task
>
findTasksByQueryCriteria
(
TaskQueryImpl
taskQuery
,
Page
page
)
{
taskQuery
.
setFirstResult
(
page
.
getFirstResult
());
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/repository/Model.java
0 → 100644
浏览文件 @
c70d320c
/* 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.repository
;
import
java.util.Date
;
/**
* Represents a model that is stored in the model repository.
* In addition, a model can be deployed to the Activiti Engine in a separate deployment step.
*
* A model is a container for the meta data and sources of a process model that typically can
* be edited in a modeling environment.
*
* @author Tijs Rademakers
*/
public
interface
Model
{
String
getId
();
String
getName
();
void
setName
(
String
name
);
String
getCategory
();
void
setCategory
(
String
category
);
Date
getCreateTime
();
Integer
getVersion
();
void
setVersion
(
Integer
version
);
String
getMetaInfo
();
void
setMetaInfo
(
String
metaInfo
);
byte
[]
getEditorSource
();
void
setEditorSource
(
byte
[]
editorSource
);
byte
[]
getEditorSourceExtra
();
void
setEditorSourceExtra
(
byte
[]
editorSourceExtra
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ModelQuery.java
0 → 100644
浏览文件 @
c70d320c
/* 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.repository
;
import
org.activiti.engine.query.Query
;
/**
* Allows programmatic querying of {@link Model}s.
*
* @author Tijs Rademakers
*/
public
interface
ModelQuery
extends
Query
<
ModelQuery
,
Model
>
{
/** Only select model with the given id. */
ModelQuery
modelId
(
String
modelId
);
/** Only select models with the given category. */
ModelQuery
modelCategory
(
String
modelCategory
);
/**
* Only select models where the category matches the given parameter.
* The syntax that should be used is the same as in SQL, eg. %activiti%
*/
ModelQuery
modelCategoryLike
(
String
modelCategoryLike
);
/** Only select models that have a different category then the given one. */
ModelQuery
modelCategoryNotEquals
(
String
categoryNotEquals
);
/** Only select models with the given name. */
ModelQuery
modelName
(
String
modelName
);
/**
* Only select models where the name matches the given parameter.
* The syntax that should be used is the same as in SQL, eg. %activiti%
*/
ModelQuery
modelNameLike
(
String
modelNameLike
);
/**
* Only select model with a certain version.
*/
ModelQuery
modelVersion
(
Integer
modelVersion
);
// ordering ////////////////////////////////////////////////////////////
/** Order by the category of the models (needs to be followed by {@link #asc()} or {@link #desc()}). */
ModelQuery
orderByModelCategory
();
/** Order by the id of the models (needs to be followed by {@link #asc()} or {@link #desc()}). */
ModelQuery
orderByModelId
();
/** Order by the version of the models (needs to be followed by {@link #asc()} or {@link #desc()}). */
ModelQuery
orderByModelVersion
();
/** Order by the name of the models (needs to be followed by {@link #asc()} or {@link #desc()}). */
ModelQuery
orderByModelName
();
}
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
BLOB
,
EDITOR_SOURCE_EXTRA_
BLOB
,
primary
key
(
ID_
)
);
create
table
ACT_RU_EXECUTION
(
ID_
varchar
(
64
)
not
null
,
REV_
integer
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.h2.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
longvarbinary
,
EDITOR_SOURCE_EXTRA_
longvarbinary
,
primary
key
(
ID_
)
);
create
table
ACT_RU_EXECUTION
(
ID_
varchar
(
64
),
REV_
integer
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mssql.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
);
create
table
ACT_RE_MODEL
(
ID_
nvarchar
(
64
)
not
null
,
NAME_
nvarchar
(
255
),
CATEGORY_
nvarchar
(
255
),
CREATE_TIME_
datetime
,
VERSION_
int
,
META_INFO_
nvarchar
(
4000
),
EDITOR_SOURCE_
image
,
EDITOR_SOURCE_EXTRA_
image
,
primary
key
(
ID_
)
);
create
table
ACT_RU_EXECUTION
(
ID_
nvarchar
(
64
),
REV_
int
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.mysql.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
utf8_bin
;
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
LONGBLOB
,
EDITOR_SOURCE_EXTRA_
LONGBLOB
,
primary
key
(
ID_
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
utf8_bin
;
create
table
ACT_RU_EXECUTION
(
ID_
varchar
(
64
),
REV_
integer
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.oracle.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
);
create
table
ACT_RE_MODEL
(
ID_
NVARCHAR2
(
64
)
not
null
,
NAME_
NVARCHAR2
(
255
),
CATEGORY_
NVARCHAR2
(
255
),
CREATE_TIME_
TIMESTAMP
(
6
),
VERSION_
INTEGER
,
META_INFO_
NVARCHAR2
(
4000
),
EDITOR_SOURCE_
BLOB
,
EDITOR_SOURCE_EXTRA_
BLOB
,
primary
key
(
ID_
)
);
create
table
ACT_RU_EXECUTION
(
ID_
NVARCHAR2
(
64
),
REV_
INTEGER
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.postgres.create.engine.sql
浏览文件 @
c70d320c
...
...
@@ -32,6 +32,18 @@ create table ACT_RE_DEPLOYMENT (
primary
key
(
ID_
)
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
bytea
,
EDITOR_SOURCE_EXTRA_
bytea
,
primary
key
(
ID_
)
);
create
table
ACT_RU_EXECUTION
(
ID_
varchar
(
64
),
REV_
integer
,
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.db2.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -55,6 +55,7 @@ drop index ACT_IDX_ATHRZ_PROCEDEF;
drop
table
ACT_GE_PROPERTY
;
drop
table
ACT_GE_BYTEARRAY
;
drop
table
ACT_RE_DEPLOYMENT
;
drop
table
ACT_RE_MODEL
;
drop
table
ACT_RE_PROCDEF
;
drop
table
ACT_RU_VARIABLE
;
drop
table
ACT_RU_IDENTITYLINK
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.h2.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -61,6 +61,7 @@ drop index ACT_IDX_ATHRZ_PROCEDEF;
drop
table
ACT_GE_PROPERTY
if
exists
;
drop
table
ACT_GE_BYTEARRAY
if
exists
;
drop
table
ACT_RE_DEPLOYMENT
if
exists
;
drop
table
ACT_RE_MODEL
if
exists
;
drop
table
ACT_RU_EXECUTION
if
exists
;
drop
table
ACT_RU_JOB
if
exists
;
drop
table
ACT_RE_PROCDEF
if
exists
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.mssql.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -53,6 +53,7 @@ if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = '
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_GE_BYTEARRAY'
)
drop
table
ACT_GE_BYTEARRAY
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RE_PROCDEF'
)
drop
table
ACT_RE_PROCDEF
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RE_DEPLOYMENT'
)
drop
table
ACT_RE_DEPLOYMENT
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RE_MODEL'
)
drop
table
ACT_RE_MODEL
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RU_IDENTITYLINK'
)
drop
table
ACT_RU_IDENTITYLINK
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RU_TASK'
)
drop
table
ACT_RU_TASK
;
if
exists
(
select
TABLE_NAME
from
INFORMATION_SCHEMA
.
TABLES
where
TABLE_NAME
=
'ACT_RU_VARIABLE'
)
drop
table
ACT_RU_VARIABLE
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.mysql.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -56,6 +56,7 @@ drop table if exists ACT_GE_PROPERTY;
drop
table
if
exists
ACT_RU_VARIABLE
;
drop
table
if
exists
ACT_GE_BYTEARRAY
;
drop
table
if
exists
ACT_RE_DEPLOYMENT
;
drop
table
if
exists
ACT_RE_MODEL
;
drop
table
if
exists
ACT_RU_IDENTITYLINK
;
drop
table
if
exists
ACT_RU_TASK
;
drop
table
if
exists
ACT_RE_PROCDEF
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.oracle.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -72,6 +72,7 @@ drop index ACT_IDX_ATHRZ_PROCEDEF;
drop
table
ACT_GE_PROPERTY
;
drop
table
ACT_GE_BYTEARRAY
;
drop
table
ACT_RE_DEPLOYMENT
;
drop
table
ACT_RE_MODEL
;
drop
table
ACT_RE_PROCDEF
;
drop
table
ACT_RU_IDENTITYLINK
;
drop
table
ACT_RU_VARIABLE
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/drop/activiti.postgres.drop.engine.sql
浏览文件 @
c70d320c
...
...
@@ -74,6 +74,7 @@ drop index ACT_IDX_ATHRZ_PROCEDEF;
drop
table
ACT_GE_PROPERTY
;
drop
table
ACT_GE_BYTEARRAY
;
drop
table
ACT_RE_DEPLOYMENT
;
drop
table
ACT_RE_MODEL
;
drop
table
ACT_RE_PROCDEF
;
drop
table
ACT_RU_EXECUTION
;
drop
table
ACT_RU_JOB
;
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Model.xml
0 → 100644
浏览文件 @
c70d320c
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.activiti.engine.impl.persistence.entity.ModelEntity"
>
<!-- MODEL INSERT -->
<insert
id=
"insertModel"
parameterType=
"org.activiti.engine.impl.persistence.entity.ModelEntity"
>
insert into ${prefix}ACT_RE_MODEL(ID_, NAME_, CATEGORY_, CREATE_TIME_, VERSION_, META_INFO_, EDITOR_SOURCE_, EDITOR_SOURCE_EXTRA_)
values(#{id, jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{category, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP},
1, #{metaInfo, jdbcType=VARCHAR}, #{editorSource, jdbcType=BLOB}, #{editorSourceExtra, jdbcType=BLOB})
</insert>
<!-- MODEL UPDATE -->
<update
id=
"updateModel"
parameterType=
"org.activiti.engine.impl.persistence.entity.ModelEntity"
>
update ${prefix}ACT_RE_MODEL set
NAME_ = #{name, jdbcType=VARCHAR},
CATEGORY_ = #{category, jdbcType=VARCHAR},
VERSION_ = #{version, jdbcType=INTEGER},
META_INFO_ = #{metaInfo, jdbcType=VARCHAR},
EDITOR_SOURCE_ = #{editorSource, jdbcType=BLOB},
EDITOR_SOURCE_EXTRA_ = #{editorSourceExtra, jdbcType=BLOB}
where ID_ = #{id, jdbcType=VARCHAR}
</update>
<!-- MODEL DELETE -->
<delete
id=
"deleteModel"
parameterType=
"string"
>
delete from ${prefix}ACT_RE_MODEL where ID_ = #{id}
</delete>
<!-- MODEL RESULTMAP -->
<resultMap
id=
"modelResultMap"
type=
"org.activiti.engine.impl.persistence.entity.ModelEntity"
>
<id
property=
"id"
column=
"ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"name"
column=
"NAME_"
jdbcType=
"VARCHAR"
/>
<result
property=
"category"
column=
"CATEGORY_"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"CREATE_TIME_"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"version"
column=
"VERSION_"
jdbcType=
"INTEGER"
/>
<result
property=
"metaInfo"
column=
"META_INFO_"
jdbcType=
"VARCHAR"
/>
<result
property=
"editorSource"
column=
"EDITOR_SOURCE_"
jdbcType=
"VARCHAR"
/>
<result
property=
"editorSourceExtra"
column=
"EDITOR_SOURCE_EXTRA_"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!-- MODEL SELECT -->
<select
id=
"selectModelsByQueryCriteria"
parameterType=
"org.activiti.engine.impl.ModelQueryImpl"
resultMap=
"modelResultMap"
>
${limitBefore}
select distinct RES.* ${limitBetween}
<include
refid=
"selectModelsByQueryCriteriaSql"
/>
${orderBy}
${limitAfter}
</select>
<select
id=
"selectModelCountByQueryCriteria"
parameterType=
"org.activiti.engine.impl.ModelQueryImpl"
resultType=
"long"
>
select count(distinct RES.ID_)
<include
refid=
"selectModelsByQueryCriteriaSql"
/>
</select>
<sql
id=
"selectModelsByQueryCriteriaSql"
>
from ${prefix}ACT_RE_MODEL RES
<where>
<if
test=
"id != null"
>
RES.ID_ = #{id}
</if>
<if
test=
"name != null"
>
RES.NAME_ = #{name}
</if>
<if
test=
"nameLike != null"
>
RES.NAME_ like #{nameLike}
</if>
<if
test=
"category != null"
>
RES.CATEGORY_ = #{category}
</if>
<if
test=
"categoryLike != null"
>
RES.CATEGORY_ like #{categoryLike}
</if>
<if
test=
"categoryNotEquals != null"
>
( RES.CATEGORY_
<>
#{categoryNotEquals} OR RES.CATEGORY_ is null )
</if>
<if
test=
"version != null"
>
RES.VERSION_ = #{version}
</if>
</where>
</sql>
<select
id=
"selectModel"
parameterType=
"string"
resultMap=
"modelResultMap"
>
select * from ${prefix}ACT_RE_MODEL where ID_ = #{id}
</select>
<!-- mysql specific -->
<select
id=
"selectModelsByQueryCriteria_mysql"
parameterType=
"org.activiti.engine.impl.ModelQueryImpl"
resultMap=
"modelResultMap"
>
${limitBefore}
select distinct RES.* ${limitBetween}
<include
refid=
"selectModelsByQueryCriteriaSql"
/>
${orderBy}
${limitAfter}
</select>
<!-- mysql specific -->
<select
id=
"selectModelCountByQueryCriteria_mysql"
parameterType=
"org.activiti.engine.impl.ModelQueryImpl"
resultType=
"long"
>
select distinct count(RES.ID_)
<include
refid=
"selectModelsByQueryCriteriaSql"
/>
</select>
</mapper>
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/mapping/mappings.xml
浏览文件 @
c70d320c
...
...
@@ -21,6 +21,7 @@
<mapper
resource=
"org/activiti/db/mapping/entity/IdentityLink.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/Job.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/Membership.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/Model.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/ProcessDefinition.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/Property.xml"
/>
<mapper
resource=
"org/activiti/db/mapping/entity/Resource.xml"
/>
...
...
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.db2.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -9,3 +9,15 @@ alter table ACT_RE_DEPLOYMENT
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
varchar
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
BLOB
,
EDITOR_SOURCE_EXTRA_
BLOB
,
primary
key
(
ID_
)
);
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.h2.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -9,3 +9,15 @@ alter table ACT_RE_DEPLOYMENT
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
varchar
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
longvarbinary
,
EDITOR_SOURCE_EXTRA_
longvarbinary
,
primary
key
(
ID_
)
);
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mssql.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -9,3 +9,15 @@ alter table ACT_RE_DEPLOYMENT
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
nvarchar
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
nvarchar
(
64
)
not
null
,
NAME_
nvarchar
(
255
),
CATEGORY_
nvarchar
(
255
),
CREATE_TIME_
datetime
,
VERSION_
int
,
META_INFO_
nvarchar
(
4000
),
EDITOR_SOURCE_
image
,
EDITOR_SOURCE_EXTRA_
image
,
primary
key
(
ID_
)
);
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.mysql.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -13,3 +13,15 @@ alter table ACT_RE_DEPLOYMENT
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
varchar
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
LONGBLOB
,
EDITOR_SOURCE_EXTRA_
LONGBLOB
,
primary
key
(
ID_
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
utf8_bin
;
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.oracle.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -8,4 +8,16 @@ alter table ACT_RE_DEPLOYMENT
add
CATEGORY_
NVARCHAR2
(
255
);
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
NVARCHAR2
(
4000
);
\ No newline at end of file
add
DESCRIPTION_
NVARCHAR2
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
NVARCHAR2
(
64
)
not
null
,
NAME_
NVARCHAR2
(
255
),
CATEGORY_
NVARCHAR2
(
255
),
CREATE_TIME_
TIMESTAMP
(
6
),
VERSION_
INTEGER
,
META_INFO_
NVARCHAR2
(
4000
),
EDITOR_SOURCE_
BLOB
,
EDITOR_SOURCE_EXTRA_
BLOB
,
primary
key
(
ID_
)
);
modules/activiti-engine/src/main/resources/org/activiti/db/upgrade/activiti.postgres.upgradestep.510.to.511.engine.sql
浏览文件 @
c70d320c
...
...
@@ -8,4 +8,16 @@ alter table ACT_RE_DEPLOYMENT
add
CATEGORY_
varchar
(
255
);
alter
table
ACT_RE_PROCDEF
add
DESCRIPTION_
varchar
(
4000
);
\ No newline at end of file
add
DESCRIPTION_
varchar
(
4000
);
create
table
ACT_RE_MODEL
(
ID_
varchar
(
64
)
not
null
,
NAME_
varchar
(
255
),
CATEGORY_
varchar
(
255
),
CREATE_TIME_
timestamp
,
VERSION_
integer
,
META_INFO_
varchar
(
4000
),
EDITOR_SOURCE_
bytea
,
EDITOR_SOURCE_EXTRA_
bytea
,
primary
key
(
ID_
)
);
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/ModelQueryTest.java
0 → 100644
浏览文件 @
c70d320c
/* 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.test.api.repository
;
import
java.util.List
;
import
org.activiti.engine.impl.test.PluggableActivitiTestCase
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ModelQuery
;
/**
* @author Tijs Rademakers
*/
public
class
ModelQueryTest
extends
PluggableActivitiTestCase
{
private
String
modelOneId
;
@Override
protected
void
setUp
()
throws
Exception
{
Model
model
=
repositoryService
.
newModel
();
model
.
setName
(
"my model"
);
model
.
setCategory
(
"test"
);
repositoryService
.
saveModel
(
model
);
modelOneId
=
model
.
getId
();
super
.
setUp
();
}
@Override
protected
void
tearDown
()
throws
Exception
{
super
.
tearDown
();
repositoryService
.
deleteModel
(
modelOneId
);
}
public
void
testQueryNoCriteria
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
();
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByName
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelName
(
"my model"
);
assertNotNull
(
query
.
singleResult
());
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByInvalidName
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelName
(
"invalid"
);
assertNull
(
query
.
singleResult
());
assertEquals
(
0
,
query
.
list
().
size
());
assertEquals
(
0
,
query
.
count
());
}
public
void
testQueryByNameLike
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelNameLike
(
"%model%"
);
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByInvalidNameLike
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelNameLike
(
"%invalid%"
);
assertNull
(
query
.
singleResult
());
assertEquals
(
0
,
query
.
list
().
size
());
assertEquals
(
0
,
query
.
count
());
}
public
void
testQueryByCategory
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelCategory
(
"test"
);
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByInvalidCategory
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelCategory
(
"invalid"
);
assertNull
(
query
.
singleResult
());
assertEquals
(
0
,
query
.
list
().
size
());
assertEquals
(
0
,
query
.
count
());
}
public
void
testQueryByCategoryLike
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelCategoryLike
(
"%te%"
);
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByInvalidCategoryLike
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelCategoryLike
(
"%invalid%"
);
assertNull
(
query
.
singleResult
());
assertEquals
(
0
,
query
.
list
().
size
());
assertEquals
(
0
,
query
.
count
());
}
public
void
testQueryByCategoryNotEquals
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelCategoryNotEquals
(
"aap"
);
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testQueryByVersion
()
{
ModelQuery
query
=
repositoryService
.
createModelQuery
().
modelVersion
(
1
);
assertEquals
(
1
,
query
.
list
().
size
());
assertEquals
(
1
,
query
.
count
());
}
public
void
testVerifyModelProperties
()
{
List
<
Model
>
models
=
repositoryService
.
createModelQuery
()
.
orderByModelName
()
.
asc
()
.
list
();
Model
modelOne
=
models
.
get
(
0
);
assertEquals
(
"my model"
,
modelOne
.
getName
());
assertEquals
(
modelOneId
,
modelOne
.
getId
());
models
=
repositoryService
.
createModelQuery
()
.
modelNameLike
(
"%model%"
)
.
orderByModelName
()
.
asc
()
.
list
();
assertEquals
(
"my model"
,
models
.
get
(
0
).
getName
());
assertEquals
(
1
,
models
.
size
());
assertEquals
(
1
,
repositoryService
.
createModelQuery
()
.
orderByModelId
()
.
asc
()
.
list
()
.
size
());
}
}
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/RepositoryServiceTest.java
浏览文件 @
c70d320c
...
...
@@ -17,6 +17,7 @@ import java.util.List;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.test.PluggableActivitiTestCase
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.engine.test.Deployment
;
...
...
@@ -133,7 +134,6 @@ public class RepositoryServiceTest extends PluggableActivitiTestCase {
}
}
public
void
testGetResourceAsStreamNullArguments
()
{
try
{
repositoryService
.
getResourceAsStream
(
null
,
"resource"
);
...
...
@@ -149,5 +149,41 @@ public class RepositoryServiceTest extends PluggableActivitiTestCase {
assertTextPresent
(
"resourceName is null"
,
ae
.
getMessage
());
}
}
public
void
testNewModelPersistence
()
{
Model
model
=
repositoryService
.
newModel
();
assertNotNull
(
model
);
model
.
setName
(
"Test model"
);
model
.
setCategory
(
"test"
);
model
.
setMetaInfo
(
"meta"
);
repositoryService
.
saveModel
(
model
);
assertNotNull
(
model
.
getId
());
model
=
repositoryService
.
getModel
(
model
.
getId
());
assertNotNull
(
model
);
assertEquals
(
"Test model"
,
model
.
getName
());
assertEquals
(
"test"
,
model
.
getCategory
());
assertEquals
(
"meta"
,
model
.
getMetaInfo
());
assertNotNull
(
model
.
getCreateTime
());
assertEquals
(
Integer
.
valueOf
(
1
),
model
.
getVersion
());
repositoryService
.
deleteModel
(
model
.
getId
());
}
public
void
testNewModelWithSource
()
throws
Exception
{
Model
model
=
repositoryService
.
newModel
();
model
.
setName
(
"Test model"
);
byte
[]
testSource
=
"modelsource"
.
getBytes
(
"utf-8"
);
assertNotNull
(
testSource
);
model
.
setEditorSource
(
testSource
);
repositoryService
.
saveModel
(
model
);
assertNotNull
(
model
.
getId
());
model
=
repositoryService
.
getModel
(
model
.
getId
());
assertNotNull
(
model
);
assertEquals
(
"modelsource"
,
new
String
(
model
.
getEditorSource
(),
"utf-8"
));
repositoryService
.
deleteModel
(
model
.
getId
());
}
}
modules/activiti-spring/src/test/java/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.java
浏览文件 @
c70d320c
...
...
@@ -31,11 +31,28 @@ public class ServiceTaskSpringDelegationTest extends SpringActivitiTestCase {
assertEquals
(
"fieldInjectionWorking"
,
runtimeService
.
getVariable
(
procInst
.
getId
(),
"fieldInjection"
));
}
@Deployment
public
void
testAsyncDelegateExpression
()
{
ProcessInstance
procInst
=
runtimeService
.
startProcessInstanceByKey
(
"delegateExpressionToSpringBean"
);
assertTrue
(
areJobsAvailable
());
waitForJobExecutorToProcessAllJobs
(
5000
,
1000
);
assertEquals
(
"Activiti BPMN 2.0 process engine"
,
runtimeService
.
getVariable
(
procInst
.
getId
(),
"myVar"
));
assertEquals
(
"fieldInjectionWorking"
,
runtimeService
.
getVariable
(
procInst
.
getId
(),
"fieldInjection"
));
}
@Deployment
public
void
testMethodExpressionOnSpringBean
()
{
ProcessInstance
procInst
=
runtimeService
.
startProcessInstanceByKey
(
"methodExpressionOnSpringBean"
);
assertEquals
(
"ACTIVITI BPMN 2.0 PROCESS ENGINE"
,
runtimeService
.
getVariable
(
procInst
.
getId
(),
"myVar"
));
}
@Deployment
public
void
testAsyncMethodExpressionOnSpringBean
()
{
ProcessInstance
procInst
=
runtimeService
.
startProcessInstanceByKey
(
"methodExpressionOnSpringBean"
);
assertTrue
(
areJobsAvailable
());
waitForJobExecutorToProcessAllJobs
(
5000
,
1000
);
assertEquals
(
"ACTIVITI BPMN 2.0 PROCESS ENGINE"
,
runtimeService
.
getVariable
(
procInst
.
getId
(),
"myVar"
));
}
@Deployment
public
void
testExecutionAndTaskListenerDelegationExpression
()
{
...
...
modules/activiti-spring/src/test/resources/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.testAsyncDelegateExpression.bpmn20.xml
0 → 100644
浏览文件 @
c70d320c
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id=
"definitions"
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
targetNamespace=
"Examples"
>
<process
id=
"delegateExpressionToSpringBean"
>
<startEvent
id=
"start"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"start"
targetRef=
"serviceTask"
/>
<serviceTask
id=
"serviceTask"
activiti:delegateExpression=
"${delegateExpressionBean}"
activiti:async=
"true"
>
<extensionElements>
<activiti:field
name=
"someField"
stringValue=
"fieldInjectionWorking"
/>
</extensionElements>
</serviceTask>
<sequenceFlow
id=
"flow2"
sourceRef=
"serviceTask"
targetRef=
"userTask"
/>
<userTask
id=
"userTask"
name=
"Schedule meeting"
/>
<sequenceFlow
id=
"flow3"
sourceRef=
"userTask"
targetRef=
"end"
/>
<endEvent
id=
"end"
/>
</process>
</definitions>
\ No newline at end of file
modules/activiti-spring/src/test/resources/org/activiti/spring/test/servicetask/ServiceTaskSpringDelegationTest.testAsyncMethodExpressionOnSpringBean.bpmn20.xml
0 → 100644
浏览文件 @
c70d320c
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id=
"definitions"
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
targetNamespace=
"Examples"
>
<process
id=
"methodExpressionOnSpringBean"
>
<startEvent
id=
"start"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"start"
targetRef=
"serviceTask"
/>
<serviceTask
id=
"serviceTask"
activiti:expression=
"${sentenceToUpperCaseBean.setSentence(execution)}"
activiti:async=
"true"
/>
<sequenceFlow
id=
"flow2"
sourceRef=
"serviceTask"
targetRef=
"userTask"
/>
<userTask
id=
"userTask"
name=
"Schedule meeting"
/>
<sequenceFlow
id=
"flow3"
sourceRef=
"userTask"
targetRef=
"end"
/>
<endEvent
id=
"end"
/>
</process>
</definitions>
\ No newline at end of file
modules/activiti-webapp-explorer2/pom.xml
浏览文件 @
c70d320c
...
...
@@ -280,10 +280,6 @@
<groupId>
math.geom
</groupId>
<artifactId>
javaGeom
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
</dependency>
<!-- Running example processes -->
<dependency>
...
...
@@ -295,6 +291,7 @@
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/data/dao/BaseDao.java
已删除
100644 → 0
浏览文件 @
b679dd9d
/* 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.editor.data.dao
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
org.activiti.editor.data.model.BaseDatabaseObject
;
import
org.activiti.editor.servlet.listener.EntityManagerListener
;
import
org.codehaus.jackson.map.ObjectMapper
;
/**
* @author Tijs Rademakers
*/
public
abstract
class
BaseDao
{
protected
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
BaseDao
.
class
.
getName
());
protected
ObjectMapper
objectMapper
=
new
ObjectMapper
();
protected
EntityManager
createEntityManager
()
{
return
EntityManagerListener
.
getEntityManagerFactory
().
createEntityManager
();
}
protected
<
T
>
T
getObjectById
(
Class
<
T
>
entityClass
,
long
id
)
{
EntityManager
entityManager
=
createEntityManager
();
T
entity
=
null
;
try
{
entity
=
entityManager
.
find
(
entityClass
,
id
);
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error getting object "
+
entityClass
+
" by id "
+
id
,
e
);
}
finally
{
entityManager
.
close
();
}
return
entity
;
}
protected
<
T
>
T
getSingleResult
(
String
queryString
,
String
key
,
Object
value
,
Class
<
T
>
entityClass
)
{
Map
<
String
,
Object
>
parameterMap
=
new
HashMap
<
String
,
Object
>();
parameterMap
.
put
(
key
,
value
);
return
getSingleResult
(
queryString
,
parameterMap
,
entityClass
);
}
@SuppressWarnings
(
"unchecked"
)
protected
<
T
>
T
getSingleResult
(
String
queryString
,
Map
<
String
,
Object
>
parameterMap
,
Class
<
T
>
entityClass
)
{
EntityManager
entityManager
=
createEntityManager
();
T
result
=
null
;
try
{
Query
query
=
entityManager
.
createQuery
(
queryString
);
if
(
parameterMap
!=
null
)
{
for
(
String
key
:
parameterMap
.
keySet
())
{
query
.
setParameter
(
key
,
parameterMap
.
get
(
key
));
}
}
result
=
(
T
)
query
.
getSingleResult
();
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error query for single result "
+
entityClass
+
" with query "
+
queryString
,
e
);
}
finally
{
entityManager
.
close
();
}
return
result
;
}
protected
<
T
>
List
<
T
>
getQueryResult
(
String
queryString
,
String
key
,
Object
value
,
Class
<
T
>
entityClass
)
{
Map
<
String
,
Object
>
parameterMap
=
new
HashMap
<
String
,
Object
>();
parameterMap
.
put
(
key
,
value
);
return
getQueryResult
(
queryString
,
parameterMap
,
entityClass
);
}
@SuppressWarnings
(
"unchecked"
)
protected
<
T
>
List
<
T
>
getQueryResult
(
String
queryString
,
Map
<
String
,
Object
>
parameterMap
,
Class
<
T
>
entityClass
)
{
EntityManager
entityManager
=
createEntityManager
();
List
<
T
>
result
=
null
;
try
{
Query
query
=
entityManager
.
createQuery
(
queryString
);
if
(
parameterMap
!=
null
)
{
for
(
String
key
:
parameterMap
.
keySet
())
{
query
.
setParameter
(
key
,
parameterMap
.
get
(
key
));
}
}
result
=
(
List
<
T
>)
query
.
getResultList
();
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error query for result "
+
entityClass
+
" with query "
+
queryString
,
e
);
}
finally
{
entityManager
.
close
();
}
return
result
;
}
protected
long
saveObject
(
BaseDatabaseObject
object
)
{
EntityManager
entityManager
=
createEntityManager
();
try
{
entityManager
.
getTransaction
().
begin
();
if
(
object
.
getObjectId
()
>
0
)
{
entityManager
.
merge
(
object
);
}
else
{
entityManager
.
persist
(
object
);
}
entityManager
.
flush
();
entityManager
.
getTransaction
().
commit
();
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error saving object "
+
object
,
e
);
}
finally
{
entityManager
.
close
();
}
return
object
.
getObjectId
();
}
protected
void
deleteObject
(
BaseDatabaseObject
object
)
{
EntityManager
entityManager
=
createEntityManager
();
try
{
entityManager
.
getTransaction
().
begin
();
BaseDatabaseObject
databaseObject
=
entityManager
.
find
(
object
.
getClass
(),
object
.
getObjectId
());
entityManager
.
remove
(
databaseObject
);
entityManager
.
flush
();
entityManager
.
getTransaction
().
commit
();
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error deleting object "
+
object
,
e
);
}
finally
{
entityManager
.
close
();
}
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/rest/model/ModelEditorJsonRestResource.java
浏览文件 @
c70d320c
...
...
@@ -16,8 +16,8 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.e
ditor.data.dao.ModelDao
;
import
org.activiti.e
ditor.data.model.ModelData
;
import
org.activiti.e
ngine.ProcessEngines
;
import
org.activiti.e
ngine.repository.Model
;
import
org.apache.commons.lang.math.NumberUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.node.ObjectNode
;
...
...
@@ -39,14 +39,13 @@ public class ModelEditorJsonRestResource extends ServerResource implements Model
String
modelId
=
(
String
)
getRequest
().
getAttributes
().
get
(
"modelId"
);
if
(
NumberUtils
.
isNumber
(
modelId
))
{
ModelDao
modelDao
=
new
ModelDao
();
ModelData
model
=
modelDao
.
getModelById
(
Long
.
valueOf
(
modelId
));
Model
model
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
().
getModel
(
modelId
);
if
(
model
!=
null
)
{
try
{
modelNode
=
(
ObjectNode
)
objectMapper
.
readTree
(
model
.
getM
odelJson
());
modelNode
.
put
(
MODEL_ID
,
model
.
get
Object
Id
());
ObjectNode
editorJsonNode
=
(
ObjectNode
)
objectMapper
.
readTree
(
model
.
getModelEditorJson
(
));
modelNode
=
(
ObjectNode
)
objectMapper
.
readTree
(
model
.
getM
etaInfo
());
modelNode
.
put
(
MODEL_ID
,
model
.
getId
());
ObjectNode
editorJsonNode
=
(
ObjectNode
)
objectMapper
.
readTree
(
new
String
(
model
.
getEditorSource
(),
"utf-8"
));
modelNode
.
put
(
"model"
,
editorJsonNode
);
}
catch
(
Exception
e
)
{
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/rest/model/ModelSaveRestResource.java
浏览文件 @
c70d320c
...
...
@@ -16,8 +16,9 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.node.ObjectNode
;
import
org.restlet.data.Form
;
...
...
@@ -45,18 +46,20 @@ public class ModelSaveRestResource extends ServerResource implements ModelDataJs
byte[] bpmnBytes = converter.convert();
System.out.println("bpmn " + new String(bpmnBytes));*/
ModelDao
modelDao
=
new
ModelDao
();
ModelData
model
=
modelDao
.
getModelById
(
Long
.
valueOf
(
modelId
));
ObjectNode
modelJson
=
(
ObjectNode
)
objectMapper
.
readTree
(
model
.
getModelJson
());
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
Model
model
=
repositoryService
.
getModel
(
modelId
);
ObjectNode
modelJson
=
(
ObjectNode
)
objectMapper
.
readTree
(
model
.
getMetaInfo
());
modelJson
.
put
(
MODEL_NAME
,
modelForm
.
getFirstValue
(
"name"
));
modelJson
.
put
(
MODEL_DESCRIPTION
,
modelForm
.
getFirstValue
(
"description"
));
model
.
setModelJson
(
modelJson
.
toString
());
model
.
setMetaInfo
(
modelJson
.
toString
());
model
.
setName
(
modelForm
.
getFirstValue
(
"name"
));
model
.
set
ModelEditorJson
(
modelForm
.
getFirstValue
(
"json_xml
"
));
model
.
set
ModelSvg
(
new
String
(
modelForm
.
getFirstValue
(
"svg_xml"
).
getBytes
(
"utf-8"
)
));
model
.
set
EditorSource
(
modelForm
.
getFirstValue
(
"json_xml"
).
getBytes
(
"utf-8
"
));
model
.
set
EditorSourceExtra
(
modelForm
.
getFirstValue
(
"svg_xml"
).
getBytes
(
"utf-8"
));
modelDao
.
saveModel
(
model
);
repositoryService
.
saveModel
(
model
);
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Error saving model"
,
e
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/test/listener/TestDataListener.java
已删除
100644 → 0
浏览文件 @
b679dd9d
/* 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.editor.test.listener
;
import
java.io.InputStream
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.servlet.ServletContextEvent
;
import
javax.servlet.ServletContextListener
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.apache.commons.io.IOUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.node.ObjectNode
;
/**
* @author Tijs Rademakers
*/
public
class
TestDataListener
implements
ServletContextListener
,
ModelDataJsonConstants
{
protected
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
TestDataListener
.
class
.
getName
());
private
ObjectMapper
objectMapper
=
new
ObjectMapper
();
private
ModelDao
modelDao
=
new
ModelDao
();
public
void
contextDestroyed
(
ServletContextEvent
context
)
{
// nothing to do
}
public
void
contextInitialized
(
ServletContextEvent
context
)
{
if
(
LOGGER
.
isLoggable
(
Level
.
INFO
))
{
LOGGER
.
info
(
"Adding test data"
);
}
createModelData
(
"test 1 model"
,
"This is a test model"
,
"test.model.json"
);
}
private
void
createModelData
(
String
name
,
String
description
,
String
jsonFile
)
{
ModelData
model
=
new
ModelData
();
ObjectNode
modelObjectNode
=
objectMapper
.
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
name
);
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
description
);
model
.
setModelJson
(
modelObjectNode
.
toString
());
try
{
InputStream
svgStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"test.svg"
);
model
.
setModelSvg
(
IOUtils
.
toString
(
svgStream
));
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to read SVG"
,
e
);
}
try
{
InputStream
editorJsonStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
jsonFile
);
model
.
setModelEditorJson
(
IOUtils
.
toString
(
editorJsonStream
));
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to read editor JSON"
,
e
);
}
modelDao
.
saveModel
(
model
);
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/ConvertProcessDefinitionPopupWindow.java
浏览文件 @
c70d320c
...
...
@@ -15,16 +15,16 @@ package org.activiti.editor.ui;
import
java.io.InputStream
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.language.json.converter.BpmnJsonConverter
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RuntimeService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.engine.repository.ProcessDefinition
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.NotificationManager
;
import
org.activiti.explorer.ui.custom.PopupWindow
;
import
org.apache.commons.lang.StringUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
...
...
@@ -49,6 +49,7 @@ public class ConvertProcessDefinitionPopupWindow extends PopupWindow implements
private
static
final
long
serialVersionUID
=
1L
;
protected
I18nManager
i18nManager
;
protected
NotificationManager
notificationManager
;
protected
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
protected
RuntimeService
runtimeService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRuntimeService
();
protected
VerticalLayout
windowLayout
;
...
...
@@ -58,6 +59,7 @@ public class ConvertProcessDefinitionPopupWindow extends PopupWindow implements
this
.
processDefinition
=
processDefinition
;
this
.
windowLayout
=
(
VerticalLayout
)
getContent
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
this
.
notificationManager
=
ExplorerApp
.
get
().
getNotificationManager
();
initWindow
();
addConvertWarning
();
...
...
@@ -109,23 +111,28 @@ public class ConvertProcessDefinitionPopupWindow extends PopupWindow implements
public
void
buttonClick
(
ClickEvent
event
)
{
InputStream
bpmnStream
=
repositoryService
.
getResourceAsStream
(
processDefinition
.
getDeploymentId
(),
processDefinition
.
getResourceName
());
BpmnJsonConverter
converter
=
new
BpmnJsonConverter
(
processDefinition
.
getResourceName
(),
bpmnStream
);
ObjectNode
modelNode
=
converter
.
convertToJson
();
ModelData
modelData
=
new
ModelData
();
modelData
.
setModelEditorJson
(
modelNode
.
toString
());
ObjectNode
modelObjectNode
=
new
ObjectMapper
().
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
processDefinition
.
getName
());
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
processDefinition
.
getDescription
());
modelData
.
setModelJson
(
modelObjectNode
.
toString
());
long
modelId
=
new
ModelDao
().
saveModel
(
modelData
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
String
.
valueOf
(
modelId
));
ExplorerApp
.
get
().
getMainWindow
().
open
(
new
ExternalResource
(
ExplorerApp
.
get
().
getURL
().
toString
()
+
"service/editor?id="
+
modelId
));
try
{
InputStream
bpmnStream
=
repositoryService
.
getResourceAsStream
(
processDefinition
.
getDeploymentId
(),
processDefinition
.
getResourceName
());
BpmnJsonConverter
converter
=
new
BpmnJsonConverter
(
processDefinition
.
getResourceName
(),
bpmnStream
);
ObjectNode
modelNode
=
converter
.
convertToJson
();
Model
modelData
=
repositoryService
.
newModel
();
modelData
.
setEditorSource
(
modelNode
.
toString
().
getBytes
(
"utf-8"
));
ObjectNode
modelObjectNode
=
new
ObjectMapper
().
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
processDefinition
.
getName
());
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
processDefinition
.
getDescription
());
modelData
.
setMetaInfo
(
modelObjectNode
.
toString
());
repositoryService
.
saveModel
(
modelData
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
modelData
.
getId
());
ExplorerApp
.
get
().
getMainWindow
().
open
(
new
ExternalResource
(
ExplorerApp
.
get
().
getURL
().
toString
()
+
"service/editor?id="
+
modelData
.
getId
()));
}
catch
(
Exception
e
)
{
notificationManager
.
showErrorNotification
(
"error"
,
e
);
}
}
});
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/CopyModelPopupWindow.java
浏览文件 @
c70d320c
...
...
@@ -13,8 +13,9 @@
package
org.activiti.editor.ui
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
...
...
@@ -45,14 +46,16 @@ public class CopyModelPopupWindow extends PopupWindow implements ModelDataJsonCo
private
static
final
long
serialVersionUID
=
1L
;
protected
Model
Data
modelData
;
protected
Model
modelData
;
protected
I18nManager
i18nManager
;
protected
VerticalLayout
windowLayout
;
protected
Form
form
;
protected
TextField
nameTextField
;
protected
TextArea
descriptionTextArea
;
public
CopyModelPopupWindow
(
ModelData
model
)
{
protected
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
public
CopyModelPopupWindow
(
Model
model
)
{
this
.
modelData
=
model
;
this
.
windowLayout
=
(
VerticalLayout
)
getContent
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
...
...
@@ -123,13 +126,12 @@ public class CopyModelPopupWindow extends PopupWindow implements ModelDataJsonCo
return
;
}
Model
Data
newModelData
=
new
ModelData
();
newModelData
.
set
ModelEditorJson
(
modelData
.
getModelEditorJson
());
newModelData
.
set
ModelSvg
(
modelData
.
getModelSvg
());
Model
newModelData
=
repositoryService
.
newModel
();
newModelData
.
set
EditorSource
(
modelData
.
getEditorSource
());
newModelData
.
set
EditorSourceExtra
(
modelData
.
getEditorSourceExtra
());
ObjectNode
modelObjectNode
=
new
ObjectMapper
().
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
(
String
)
nameTextField
.
getValue
());
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
String
description
=
null
;
if
(
StringUtils
.
isNotEmpty
((
String
)
descriptionTextArea
.
getValue
()))
{
description
=
(
String
)
descriptionTextArea
.
getValue
();
...
...
@@ -137,11 +139,12 @@ public class CopyModelPopupWindow extends PopupWindow implements ModelDataJsonCo
description
=
""
;
}
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
description
);
newModelData
.
setModelJson
(
modelObjectNode
.
toString
());
newModelData
.
setMetaInfo
(
modelObjectNode
.
toString
());
newModelData
.
setName
((
String
)
nameTextField
.
getValue
());
long
modelId
=
new
ModelDao
()
.
saveModel
(
newModelData
);
repositoryService
.
saveModel
(
newModelData
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
String
.
valueOf
(
modelId
));
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
newModelData
.
getId
(
));
}
});
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/DeleteModelPopupWindow.java
浏览文件 @
c70d320c
...
...
@@ -13,8 +13,9 @@
package
org.activiti.editor.ui
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
...
...
@@ -39,9 +40,11 @@ public class DeleteModelPopupWindow extends PopupWindow implements ModelDataJson
protected
I18nManager
i18nManager
;
protected
VerticalLayout
windowLayout
;
protected
Model
Data
modelData
;
protected
Model
modelData
;
public
DeleteModelPopupWindow
(
ModelData
model
)
{
protected
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
public
DeleteModelPopupWindow
(
Model
model
)
{
this
.
modelData
=
model
;
this
.
windowLayout
=
(
VerticalLayout
)
getContent
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
...
...
@@ -91,7 +94,7 @@ public class DeleteModelPopupWindow extends PopupWindow implements ModelDataJson
private
static
final
long
serialVersionUID
=
1L
;
public
void
buttonClick
(
ClickEvent
event
)
{
new
ModelDao
().
deleteModel
(
modelData
);
repositoryService
.
deleteModel
(
modelData
.
getId
()
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
();
}
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionDetailPanel.java
浏览文件 @
c70d320c
...
...
@@ -12,8 +12,9 @@
*/
package
org.activiti.editor.ui
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
...
...
@@ -48,7 +49,7 @@ public class EditorProcessDefinitionDetailPanel extends DetailPanel {
private
static
final
long
serialVersionUID
=
1L
;
// Members
protected
Model
Data
modelData
;
protected
Model
modelData
;
protected
EditorProcessDefinitionPage
processDefinitionPage
;
// Services
...
...
@@ -69,11 +70,13 @@ public class EditorProcessDefinitionDetailPanel extends DetailPanel {
protected
FormPropertiesForm
processDefinitionStartForm
;
protected
EditorProcessDefinitionInfoComponent
definitionInfoComponent
;
public
EditorProcessDefinitionDetailPanel
(
long
modelId
,
EditorProcessDefinitionPage
processDefinitionPage
)
{
protected
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
public
EditorProcessDefinitionDetailPanel
(
String
modelId
,
EditorProcessDefinitionPage
processDefinitionPage
)
{
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
this
.
processDefinitionPage
=
processDefinitionPage
;
this
.
modelData
=
new
ModelDao
().
getModelById
(
modelId
);
this
.
modelData
=
repositoryService
.
getModel
(
modelId
);
initUi
();
}
...
...
@@ -110,7 +113,7 @@ public class EditorProcessDefinitionDetailPanel extends DetailPanel {
exportModelButton
.
addListener
(
new
ExportModelClickListener
(
modelData
));
editModelButton
=
new
Button
(
i18nManager
.
getMessage
(
Messages
.
PROCESS_EDIT
));
editModelButton
.
addListener
(
new
EditModelClickListener
(
modelData
.
get
Object
Id
()));
editModelButton
.
addListener
(
new
EditModelClickListener
(
modelData
.
getId
()));
copyModelButton
=
new
Button
(
i18nManager
.
getMessage
(
Messages
.
PROCESS_COPY
));
copyModelButton
.
addListener
(
new
CopyModelClickListener
(
modelData
));
...
...
@@ -166,7 +169,7 @@ public class EditorProcessDefinitionDetailPanel extends DetailPanel {
details
.
addComponent
(
propertiesLayout
);
// Version
String
versionString
=
i18nManager
.
getMessage
(
Messages
.
PROCESS_VERSION
,
modelData
.
get
Revi
sion
());
String
versionString
=
i18nManager
.
getMessage
(
Messages
.
PROCESS_VERSION
,
modelData
.
get
Ver
sion
());
Label
versionLabel
=
new
Label
(
versionString
);
versionLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_PROCESS_HEADER_VERSION
);
propertiesLayout
.
addComponent
(
versionLabel
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionInfoComponent.java
浏览文件 @
c70d320c
...
...
@@ -19,7 +19,7 @@ import java.io.InputStream;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.activiti.e
ditor.data.model.ModelData
;
import
org.activiti.e
ngine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
...
...
@@ -27,8 +27,6 @@ import org.activiti.explorer.ui.mainlayout.ExplorerLayout;
import
org.apache.batik.transcoder.TranscoderInput
;
import
org.apache.batik.transcoder.TranscoderOutput
;
import
org.apache.batik.transcoder.image.PNGTranscoder
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringUtils
;
import
com.vaadin.terminal.StreamResource.StreamSource
;
import
com.vaadin.ui.ComponentContainer
;
...
...
@@ -52,14 +50,14 @@ public class EditorProcessDefinitionInfoComponent extends VerticalLayout {
protected
I18nManager
i18nManager
;
// Members
protected
Model
Data
modelData
;
protected
Model
modelData
;
// UI
protected
HorizontalLayout
timeDetails
;
protected
VerticalLayout
processImageContainer
;
public
EditorProcessDefinitionInfoComponent
(
Model
Data
model
)
{
public
EditorProcessDefinitionInfoComponent
(
Model
model
)
{
super
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
...
...
@@ -78,8 +76,8 @@ public class EditorProcessDefinitionInfoComponent extends VerticalLayout {
processImageContainer
.
addComponent
(
processTitle
);
StreamSource
streamSource
=
null
;
if
(
StringUtils
.
isNotEmpty
(
modelData
.
getModelSvg
())
)
{
InputStream
svgStream
=
IOUtils
.
toInputStream
(
modelData
.
getModelSvg
());
if
(
modelData
.
getEditorSourceExtra
()
!=
null
)
{
InputStream
svgStream
=
new
ByteArrayInputStream
(
modelData
.
getEditorSourceExtra
());
TranscoderInput
input
=
new
TranscoderInput
(
svgStream
);
PNGTranscoder
transcoder
=
new
PNGTranscoder
();
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/EditorProcessDefinitionPage.java
浏览文件 @
c70d320c
...
...
@@ -15,10 +15,9 @@ package org.activiti.editor.ui;
import
java.util.List
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.navigation.ProcessModelNavigator
;
import
org.activiti.explorer.navigation.UriFragment
;
...
...
@@ -68,7 +67,7 @@ public class EditorProcessDefinitionPage extends AbstractTablePage {
if
(
modelId
==
null
)
{
table
.
select
(
table
.
firstItemId
());
}
else
{
table
.
select
(
Long
.
valueOf
(
modelId
)
);
table
.
select
(
modelId
);
}
}
...
...
@@ -95,7 +94,7 @@ public class EditorProcessDefinitionPage extends AbstractTablePage {
private
static
final
long
serialVersionUID
=
1L
;
public
void
valueChange
(
ValueChangeEvent
event
)
{
showProcessDefinitionDetail
((
Lo
ng
)
event
.
getProperty
().
getValue
());
showProcessDefinitionDetail
((
Stri
ng
)
event
.
getProperty
().
getValue
());
}
});
...
...
@@ -106,9 +105,9 @@ public class EditorProcessDefinitionPage extends AbstractTablePage {
processDefinitionTable
.
addContainerProperty
(
"name"
,
String
.
class
,
null
);
processDefinitionTable
.
setColumnHeaderMode
(
Table
.
COLUMN_HEADER_MODE_HIDDEN
);
List
<
Model
Data
>
modelList
=
new
ModelDao
().
getModels
();
for
(
Model
Data
modelData
:
modelList
)
{
Item
item
=
processDefinitionTable
.
addItem
(
modelData
.
get
Object
Id
());
List
<
Model
>
modelList
=
repositoryService
.
createModelQuery
().
list
();
for
(
Model
modelData
:
modelList
)
{
Item
item
=
processDefinitionTable
.
addItem
(
modelData
.
getId
());
item
.
getItemProperty
(
"name"
).
setValue
(
modelData
.
getName
());
}
...
...
@@ -116,7 +115,7 @@ public class EditorProcessDefinitionPage extends AbstractTablePage {
return
processDefinitionTable
;
}
protected
void
showProcessDefinitionDetail
(
Lo
ng
selectedModelId
)
{
protected
void
showProcessDefinitionDetail
(
Stri
ng
selectedModelId
)
{
detailPanel
=
new
EditorProcessDefinitionDetailPanel
(
selectedModelId
,
this
);
setDetailComponent
(
detailPanel
);
changeUrl
(
""
+
selectedModelId
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/editor/ui/NewModelPopupWindow.java
浏览文件 @
c70d320c
...
...
@@ -13,11 +13,13 @@
package
org.activiti.editor.ui
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.dao.ModelDao
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.NotificationManager
;
import
org.activiti.explorer.ui.custom.PopupWindow
;
import
org.apache.commons.lang.StringUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
...
...
@@ -47,14 +49,18 @@ public class NewModelPopupWindow extends PopupWindow implements ModelDataJsonCon
private
static
final
long
serialVersionUID
=
1L
;
protected
I18nManager
i18nManager
;
protected
NotificationManager
notificationManager
;
protected
VerticalLayout
windowLayout
;
protected
Form
form
;
protected
TextField
nameTextField
;
protected
TextArea
descriptionTextArea
;
protected
RepositoryService
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
public
NewModelPopupWindow
()
{
this
.
windowLayout
=
(
VerticalLayout
)
getContent
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
this
.
notificationManager
=
ExplorerApp
.
get
().
getNotificationManager
();
initWindow
();
addFields
();
...
...
@@ -121,33 +127,38 @@ public class NewModelPopupWindow extends PopupWindow implements ModelDataJsonCon
return
;
}
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectNode
editorNode
=
objectMapper
.
createObjectNode
();
editorNode
.
put
(
"id"
,
"canvas"
);
editorNode
.
put
(
"resourceId"
,
"canvas"
);
ObjectNode
stencilSetNode
=
objectMapper
.
createObjectNode
();
stencilSetNode
.
put
(
"namespace"
,
"http://b3mn.org/stencilset/bpmn2.0#"
);
editorNode
.
put
(
"stencilset"
,
stencilSetNode
);
ModelData
modelData
=
new
ModelData
();
modelData
.
setModelEditorJson
(
editorNode
.
toString
());
ObjectNode
modelObjectNode
=
objectMapper
.
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
(
String
)
nameTextField
.
getValue
());
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
String
description
=
null
;
if
(
StringUtils
.
isNotEmpty
((
String
)
descriptionTextArea
.
getValue
()))
{
description
=
(
String
)
descriptionTextArea
.
getValue
();
}
else
{
description
=
""
;
try
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectNode
editorNode
=
objectMapper
.
createObjectNode
();
editorNode
.
put
(
"id"
,
"canvas"
);
editorNode
.
put
(
"resourceId"
,
"canvas"
);
ObjectNode
stencilSetNode
=
objectMapper
.
createObjectNode
();
stencilSetNode
.
put
(
"namespace"
,
"http://b3mn.org/stencilset/bpmn2.0#"
);
editorNode
.
put
(
"stencilset"
,
stencilSetNode
);
Model
modelData
=
repositoryService
.
newModel
();
modelData
.
setEditorSource
(
editorNode
.
toString
().
getBytes
(
"utf-8"
));
ObjectNode
modelObjectNode
=
objectMapper
.
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
(
String
)
nameTextField
.
getValue
());
modelObjectNode
.
put
(
MODEL_REVISION
,
1
);
String
description
=
null
;
if
(
StringUtils
.
isNotEmpty
((
String
)
descriptionTextArea
.
getValue
()))
{
description
=
(
String
)
descriptionTextArea
.
getValue
();
}
else
{
description
=
""
;
}
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
description
);
modelData
.
setMetaInfo
(
modelObjectNode
.
toString
());
repositoryService
.
saveModel
(
modelData
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
modelData
.
getId
());
ExplorerApp
.
get
().
getMainWindow
().
open
(
new
ExternalResource
(
ExplorerApp
.
get
().
getURL
().
toString
()
+
"service/editor?id="
+
modelData
.
getId
()));
}
catch
(
Exception
e
)
{
notificationManager
.
showErrorNotification
(
"error"
,
e
);
}
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
description
);
modelData
.
setModelJson
(
modelObjectNode
.
toString
());
long
modelId
=
new
ModelDao
().
saveModel
(
modelData
);
close
();
ExplorerApp
.
get
().
getViewManager
().
showEditorProcessDefinitionPage
(
String
.
valueOf
(
modelId
));
ExplorerApp
.
get
().
getMainWindow
().
open
(
new
ExternalResource
(
ExplorerApp
.
get
().
getURL
().
toString
()
+
"service/editor?id="
+
modelId
));
}
});
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/DefaultViewManager.java
浏览文件 @
c70d320c
...
...
@@ -28,6 +28,7 @@ import org.activiti.engine.task.Task;
import
org.activiti.explorer.ui.AbstractTablePage
;
import
org.activiti.explorer.ui.MainWindow
;
import
org.activiti.explorer.ui.management.ManagementMenuBar
;
import
org.activiti.explorer.ui.management.admin.AdministrationPage
;
import
org.activiti.explorer.ui.management.db.DatabasePage
;
import
org.activiti.explorer.ui.management.deployment.DeploymentPage
;
import
org.activiti.explorer.ui.management.identity.GroupPage
;
...
...
@@ -267,6 +268,14 @@ public class DefaultViewManager implements ViewManager {
throw
new
UnsupportedOperationException
();
// Only for alfresco admin app
}
public
void
showAdministrationPage
()
{
switchView
(
new
AdministrationPage
(),
ViewManager
.
MAIN_NAVIGATION_MANAGE
,
ManagementMenuBar
.
ENTRY_ADMIN
);
}
public
void
showAdministrationPage
(
String
managementId
)
{
switchView
(
new
AdministrationPage
(
managementId
),
ViewManager
.
MAIN_NAVIGATION_MANAGE
,
ManagementMenuBar
.
ENTRY_ADMIN
);
}
// Profile
public
void
showProfilePopup
(
String
userId
)
{
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/Messages.java
浏览文件 @
c70d320c
...
...
@@ -216,6 +216,7 @@ public interface Messages {
static
final
String
PROCESS_NO_INSTANCES
=
"process.no.instances"
;
static
final
String
PROCESS_ACTION_VIEW
=
"process.action.view"
;
static
final
String
PROCESS_INSTANCE_ID
=
"process.instance.id"
;
static
final
String
PROCESS_INSTANCE_NAME
=
"process.instance.name"
;
static
final
String
PROCESS_INSTANCE_BUSINESSKEY
=
"process.instance.businesskey"
;
static
final
String
PROCESS_INSTANCE_ACTIONS
=
"process.instance.actions"
;
static
final
String
PROCESS_INSTANCE_VARIABLE_NAME
=
"process.instance.variable.name"
;
...
...
@@ -238,6 +239,7 @@ public interface Messages {
static
final
String
MGMT_MENU_DEPLOYMENTS_UPLOAD
=
"management.menu.deployments.upload"
;
static
final
String
MGMT_MENU_USERS
=
"management.menu.users"
;
static
final
String
MGMT_MENU_GROUPS
=
"management.menu.groups"
;
static
final
String
MGMT_MENU_ADMINISTRATION
=
"management.menu.admin"
;
// Job page
static
final
String
JOB_EXECUTE
=
"job.execute"
;
...
...
@@ -311,6 +313,30 @@ public interface Messages {
static
final
String
GROUP_SELECT_MEMBERS
=
"group.select.members"
;
static
final
String
GROUP_DELETE
=
"group.delete"
;
// Running process instances page
static
final
String
ADMIN_MENU_RUNNING
=
"admin.menu.running"
;
static
final
String
ADMIN_MENU_COMPLETED
=
"admin.menu.completed"
;
static
final
String
ADMIN_MENU_DATABASE
=
"admin.menu.database"
;
static
final
String
ADMIN_RUNNING_TITLE
=
"admin.running.title"
;
static
final
String
ADMIN_RUNNING_NONE_FOUND
=
"admin.running.none.found"
;
static
final
String
ADMIN_COMPLETED_TITLE
=
"admin.completed.title"
;
static
final
String
ADMIN_COMPLETED_NONE_FOUND
=
"admin.completed.none.found"
;
static
final
String
ADMIN_DEFINITIONS
=
"admin.definitions"
;
static
final
String
ADMIN_NR_INSTANCES
=
"admin.nr.instances"
;
static
final
String
ADMIN_STARTED_BY
=
"admin.started.by"
;
static
final
String
ADMIN_START_ACTIVITY
=
"admin.start.activity"
;
static
final
String
ADMIN_FINISHED
=
"admin.finished"
;
// Database settings page
static
final
String
DATABASE_TITLE
=
"database.title"
;
static
final
String
DATABASE_TYPE
=
"database.type"
;
static
final
String
DATABASE_UPDATE
=
"database.update"
;
static
final
String
DATABASE_CONFIG_TYPE
=
"database.config.type"
;
static
final
String
DATABASE_JNDI
=
"database.jndi"
;
static
final
String
DATABASE_DATASOURCE_CLASS
=
"database.datasource.class"
;
static
final
String
DATABASE_DATASOURCE_URL
=
"database.datasource.url"
;
static
final
String
DATABASE_JDBC_URL
=
"database.jdbc.url"
;
// Upload
static
final
String
UPLOAD_SELECT
=
"upload.select"
;
static
final
String
UPLOAD_DROP
=
"upload.drop"
;
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ViewManager.java
浏览文件 @
c70d320c
...
...
@@ -105,6 +105,10 @@ public interface ViewManager {
void
showProcessInstancePage
(
String
processInstanceId
);
void
showAdministrationPage
();
void
showAdministrationPage
(
String
managementId
);
// Profile
void
showProfilePopup
(
String
userId
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/demo/DemoDataGenerator.java
浏览文件 @
c70d320c
...
...
@@ -13,35 +13,46 @@
package
org.activiti.explorer.demo
;
import
java.io.InputStream
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.engine.IdentityService
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.identity.Group
;
import
org.activiti.engine.identity.Picture
;
import
org.activiti.engine.identity.User
;
import
org.activiti.engine.impl.util.IoUtil
;
import
org.activiti.engine.repository.Model
;
import
org.apache.commons.io.IOUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.node.ObjectNode
;
/**
* @author Joram Barrez
*/
public
class
DemoDataGenerator
{
public
class
DemoDataGenerator
implements
ModelDataJsonConstants
{
protected
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
DemoDataGenerator
.
class
.
getName
());
protected
ProcessEngine
processEngine
;
protected
IdentityService
identityService
;
protected
RepositoryService
repositoryService
;
public
void
setProcessEngine
(
ProcessEngine
processEngine
)
{
this
.
processEngine
=
processEngine
;
this
.
identityService
=
processEngine
.
getIdentityService
();
this
.
repositoryService
=
processEngine
.
getRepositoryService
();
initDemoGroups
();
initDemoUsers
();
initProcessDefinitions
();
initModelData
();
}
protected
void
initDemoGroups
()
{
...
...
@@ -130,5 +141,35 @@ public class DemoDataGenerator {
.
addClasspathResource
(
"org/activiti/explorer/demo/process/createTimersProcess.bpmn20.xml"
)
.
deploy
();
}
protected
void
initModelData
()
{
createModelData
(
"Demo model"
,
"This is a demo model"
,
"org/activiti/explorer/demo/model/test.model.json"
);
}
protected
void
createModelData
(
String
name
,
String
description
,
String
jsonFile
)
{
Model
model
=
repositoryService
.
newModel
();
model
.
setName
(
name
);
ObjectNode
modelObjectNode
=
new
ObjectMapper
().
createObjectNode
();
modelObjectNode
.
put
(
MODEL_NAME
,
name
);
modelObjectNode
.
put
(
MODEL_DESCRIPTION
,
description
);
model
.
setMetaInfo
(
modelObjectNode
.
toString
());
try
{
InputStream
svgStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"org/activiti/explorer/demo/model/test.svg"
);
model
.
setEditorSourceExtra
(
IOUtils
.
toByteArray
(
svgStream
));
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to read SVG"
,
e
);
}
try
{
InputStream
editorJsonStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
jsonFile
);
model
.
setEditorSource
(
IOUtils
.
toByteArray
(
editorJsonStream
));
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARNING
,
"Failed to read editor JSON"
,
e
);
}
repositoryService
.
saveModel
(
model
);
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/navigation/NavigatorManager.java
浏览文件 @
c70d320c
...
...
@@ -17,6 +17,7 @@ import java.io.Serializable;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.explorer.ui.management.admin.AdministrationNavigator
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.stereotype.Component
;
...
...
@@ -65,6 +66,7 @@ public class NavigatorManager implements InitializingBean, Serializable {
addNavigator
(
new
JobNavigator
());
addNavigator
(
new
UserNavigator
());
addNavigator
(
new
GroupNavigator
());
addNavigator
(
new
AdministrationNavigator
());
addNavigator
(
new
MyProcessesNavigator
());
}
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/navigation/TaskNavigator.java
浏览文件 @
c70d320c
...
...
@@ -14,7 +14,6 @@
package
org.activiti.explorer.navigation
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
...
...
@@ -23,7 +22,6 @@ import org.activiti.engine.IdentityService;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.TaskService
;
import
org.activiti.engine.identity.Group
;
import
org.activiti.engine.task.IdentityLink
;
import
org.activiti.engine.task.Task
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.Messages
;
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/ManagementMenuBar.java
浏览文件 @
c70d320c
...
...
@@ -33,6 +33,7 @@ public class ManagementMenuBar extends ToolBar {
public
static
final
String
ENTRY_JOBS
=
"jobs"
;
public
static
final
String
ENTRY_USERS
=
"users"
;
public
static
final
String
ENTRY_GROUPS
=
"groups"
;
public
static
final
String
ENTRY_ADMIN
=
"administration"
;
protected
I18nManager
i18nManager
;
protected
ViewManager
viewManager
;
...
...
@@ -51,6 +52,7 @@ public class ManagementMenuBar extends ToolBar {
addJobsToolbarEntry
();
addUsersToolbarEntry
();
addGroupToolbarEntry
();
addAdministrationToolbarEntry
();
}
protected
void
addDatabaseToolbarEntry
()
{
...
...
@@ -95,4 +97,12 @@ public class ManagementMenuBar extends ToolBar {
});
}
protected
void
addAdministrationToolbarEntry
()
{
addToolbarEntry
(
ENTRY_ADMIN
,
i18nManager
.
getMessage
(
Messages
.
MGMT_MENU_ADMINISTRATION
),
new
ToolbarCommand
()
{
public
void
toolBarItemSelected
()
{
viewManager
.
showAdministrationPage
();
}
});
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminCompletedInstancesPanel.java
0 → 100644
浏览文件 @
c70d320c
此差异已折叠。
点击以展开。
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminDatabaseSettingsPanel.java
0 → 100644
浏览文件 @
c70d320c
/* 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.explorer.ui.management.admin
;
import
org.activiti.engine.IdentityService
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.impl.ProcessEngineImpl
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.ui.Images
;
import
org.activiti.explorer.ui.custom.DetailPanel
;
import
org.activiti.explorer.ui.mainlayout.ExplorerLayout
;
import
com.vaadin.ui.Alignment
;
import
com.vaadin.ui.Embedded
;
import
com.vaadin.ui.GridLayout
;
import
com.vaadin.ui.HorizontalLayout
;
import
com.vaadin.ui.Label
;
import
com.vaadin.ui.VerticalLayout
;
import
com.vaadin.ui.themes.Reindeer
;
/**
* @author Tijs Rademakers
*/
public
class
AdminDatabaseSettingsPanel
extends
DetailPanel
{
private
static
final
long
serialVersionUID
=
1L
;
protected
IdentityService
identityService
;
protected
I18nManager
i18nManager
;
protected
ProcessEngineConfigurationImpl
engineConfiguration
;
protected
VerticalLayout
panelLayout
;
protected
HorizontalLayout
detailLayout
;
protected
GridLayout
detailsGrid
;
public
AdminDatabaseSettingsPanel
()
{
ProcessEngineImpl
processEngine
=
(
ProcessEngineImpl
)
ProcessEngines
.
getDefaultProcessEngine
();
engineConfiguration
=
(
ProcessEngineConfigurationImpl
)
processEngine
.
getProcessEngineConfiguration
();
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
init
();
}
protected
void
init
()
{
setSizeFull
();
addStyleName
(
Reindeer
.
PANEL_LIGHT
);
initPageTitle
();
initDatabaseSettingsDetails
();
}
protected
void
initPageTitle
()
{
HorizontalLayout
layout
=
new
HorizontalLayout
();
layout
.
setWidth
(
100
,
UNITS_PERCENTAGE
);
layout
.
addStyleName
(
ExplorerLayout
.
STYLE_TITLE_BLOCK
);
layout
.
setSpacing
(
true
);
layout
.
setMargin
(
false
,
false
,
true
,
false
);
addDetailComponent
(
layout
);
Embedded
databaseImage
=
new
Embedded
(
null
,
Images
.
DATABASE_50
);
layout
.
addComponent
(
databaseImage
);
Label
groupName
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_TITLE
));
groupName
.
setSizeUndefined
();
groupName
.
addStyleName
(
Reindeer
.
LABEL_H2
);
layout
.
addComponent
(
groupName
);
layout
.
setComponentAlignment
(
groupName
,
Alignment
.
MIDDLE_LEFT
);
layout
.
setExpandRatio
(
groupName
,
1.0f
);
}
protected
void
initDatabaseSettingsDetails
()
{
Label
settingsHeader
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
MGMT_MENU_DATABASE
));
settingsHeader
.
addStyleName
(
ExplorerLayout
.
STYLE_H3
);
settingsHeader
.
addStyleName
(
ExplorerLayout
.
STYLE_DETAIL_BLOCK
);
addDetailComponent
(
settingsHeader
);
detailLayout
=
new
HorizontalLayout
();
detailLayout
.
setSpacing
(
true
);
detailLayout
.
setMargin
(
true
,
false
,
true
,
false
);
addDetailComponent
(
detailLayout
);
initSettingsProperties
();
}
protected
void
initSettingsProperties
()
{
detailsGrid
=
new
GridLayout
(
2
,
3
);
detailsGrid
.
setSpacing
(
true
);
detailLayout
.
setMargin
(
true
,
true
,
true
,
false
);
detailLayout
.
addComponent
(
detailsGrid
);
// Database type
Label
typeLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_TYPE
)
+
": "
);
typeLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
typeLabel
);
Label
typeValueLabel
=
new
Label
(
engineConfiguration
.
getDatabaseType
());
detailsGrid
.
addComponent
(
typeValueLabel
);
// Database schema update
Label
schemaUpdateLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_UPDATE
)
+
": "
);
schemaUpdateLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
schemaUpdateLabel
);
Label
schemaUpdateValueLabel
=
new
Label
(
engineConfiguration
.
getDatabaseSchemaUpdate
());
detailsGrid
.
addComponent
(
schemaUpdateValueLabel
);
// Config type
Label
configTypeLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_CONFIG_TYPE
)
+
": "
);
configTypeLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
configTypeLabel
);
String
databaseConfigType
=
getDatabaseType
();
Label
configTypeValueLabel
=
new
Label
(
databaseConfigType
);
detailsGrid
.
addComponent
(
configTypeValueLabel
);
if
(
"JNDI"
.
equals
(
databaseConfigType
))
{
// JNDI
Label
jndiLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_JNDI
)
+
": "
);
jndiLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
jndiLabel
);
Label
jndiValueLabel
=
new
Label
(
engineConfiguration
.
getDataSourceJndiName
());
detailsGrid
.
addComponent
(
jndiValueLabel
);
}
else
if
(
"Datasource"
.
equals
(
databaseConfigType
)){
// Datasource class
Label
datasourceLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_DATASOURCE_CLASS
)
+
": "
);
datasourceLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
datasourceLabel
);
Label
datasourceValueLabel
=
new
Label
(
engineConfiguration
.
getDataSource
().
getClass
().
getName
());
detailsGrid
.
addComponent
(
datasourceValueLabel
);
}
else
{
// JDBC URL
Label
jdbcURLLabel
=
new
Label
(
i18nManager
.
getMessage
(
Messages
.
DATABASE_JDBC_URL
)
+
": "
);
jdbcURLLabel
.
addStyleName
(
ExplorerLayout
.
STYLE_LABEL_BOLD
);
detailsGrid
.
addComponent
(
jdbcURLLabel
);
Label
jdbcURLValueLabel
=
new
Label
(
engineConfiguration
.
getJdbcUrl
());
detailsGrid
.
addComponent
(
jdbcURLValueLabel
);
}
}
protected
String
getDatabaseType
()
{
String
databaseType
=
null
;
if
(
engineConfiguration
.
getDataSourceJndiName
()
!=
null
)
{
databaseType
=
"JNDI"
;
}
else
if
(
engineConfiguration
.
getDataSource
()
!=
null
)
{
databaseType
=
"Datasource"
;
}
else
{
databaseType
=
"JDBC config"
;
}
return
databaseType
;
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdminRunningInstancesPanel.java
0 → 100644
浏览文件 @
c70d320c
此差异已折叠。
点击以展开。
modules/activiti-webapp-explorer2/src/main/java/org/activiti/e
ditor/data/dao/ModelDao
.java
→
modules/activiti-webapp-explorer2/src/main/java/org/activiti/e
xplorer/ui/management/admin/AdministrationNavigator
.java
浏览文件 @
c70d320c
...
...
@@ -10,45 +10,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.explorer.ui.management.admin
;
package
org.activiti.editor.data.dao
;
import
java.util.List
;
import
org.activiti.editor.constants.ModelDataJsonConstants
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.exception.ModelException
;
import
org.codehaus.jackson.JsonNode
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.navigation.ManagementNavigator
;
import
org.activiti.explorer.navigation.UriFragment
;
/**
* @author Tijs Rademakers
*/
public
class
ModelDao
extends
BaseDao
implements
ModelDataJsonConstants
{
public
class
AdministrationNavigator
extends
ManagementNavigator
{
public
ModelData
getModelById
(
long
id
)
{
return
getObjectById
(
ModelData
.
class
,
id
);
}
public
List
<
ModelData
>
getModelByName
(
String
modelName
)
{
return
getQueryResult
(
"FROM ModelData WHERE name like :name"
,
"name"
,
modelName
,
ModelData
.
class
);
}
public
static
final
String
MANAGEMENT_URI_PART
=
"admin_management"
;
public
List
<
ModelData
>
getModels
()
{
return
getQueryResult
(
"FROM ModelData"
,
null
,
ModelData
.
class
)
;
public
String
getTrigger
()
{
return
MANAGEMENT_URI_PART
;
}
public
long
saveModel
(
ModelData
model
)
{
try
{
JsonNode
modelNode
=
objectMapper
.
readTree
(
model
.
getModelJson
());
model
.
setName
(
modelNode
.
get
(
MODEL_NAME
).
getTextValue
());
model
.
setRevision
(
modelNode
.
get
(
MODEL_REVISION
).
getNumberValue
().
intValue
()
);
}
catch
(
Exception
e
)
{
throw
new
ModelException
(
"Model Json tree could not be read"
);
public
void
handleManagementNavigation
(
UriFragment
uriFragment
)
{
String
managementId
=
uriFragment
.
getUriPart
(
1
);
if
(
managementId
!=
null
)
{
ExplorerApp
.
get
().
getViewManager
().
showAdministrationPage
(
managementId
);
}
else
{
ExplorerApp
.
get
().
getViewManager
().
showAdministrationPage
(
);
}
return
saveObject
(
model
);
}
public
void
deleteModel
(
ModelData
model
)
{
deleteObject
(
model
);
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/management/admin/AdministrationPage.java
0 → 100644
浏览文件 @
c70d320c
/* 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.explorer.ui.management.admin
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.I18nManager
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.navigation.UriFragment
;
import
org.activiti.explorer.ui.management.ManagementPage
;
import
com.vaadin.data.Item
;
import
com.vaadin.data.Property
;
import
com.vaadin.data.Property.ValueChangeEvent
;
import
com.vaadin.ui.Table
;
/**
* @author Tijs Rademakers
*/
public
class
AdministrationPage
extends
ManagementPage
{
private
static
final
long
serialVersionUID
=
1L
;
protected
I18nManager
i18nManager
;
protected
String
managementId
;
protected
Table
managementTable
;
public
AdministrationPage
()
{
ExplorerApp
.
get
().
setCurrentUriFragment
(
new
UriFragment
(
AdministrationNavigator
.
MANAGEMENT_URI_PART
));
this
.
i18nManager
=
ExplorerApp
.
get
().
getI18nManager
();
}
public
AdministrationPage
(
String
managementId
)
{
this
.
managementId
=
managementId
;
}
@Override
protected
void
initUi
()
{
super
.
initUi
();
int
index
=
0
;
if
(
managementId
!=
null
)
{
index
=
Integer
.
valueOf
(
managementId
);
}
managementTable
.
select
(
index
);
managementTable
.
setCurrentPageFirstItemId
(
index
);
}
protected
Table
createList
()
{
managementTable
=
new
Table
();
managementTable
.
setEditable
(
false
);
managementTable
.
setImmediate
(
true
);
managementTable
.
setSelectable
(
true
);
managementTable
.
setNullSelectionAllowed
(
false
);
managementTable
.
setSortDisabled
(
true
);
managementTable
.
setSizeFull
();
// Column headers
managementTable
.
addContainerProperty
(
"name"
,
String
.
class
,
null
);
managementTable
.
setColumnHeaderMode
(
Table
.
COLUMN_HEADER_MODE_HIDDEN
);
managementTable
.
addItem
(
new
String
[]
{
i18nManager
.
getMessage
(
Messages
.
ADMIN_MENU_RUNNING
)},
0
);
managementTable
.
addItem
(
new
String
[]
{
i18nManager
.
getMessage
(
Messages
.
ADMIN_MENU_COMPLETED
)},
1
);
managementTable
.
addItem
(
new
String
[]
{
i18nManager
.
getMessage
(
Messages
.
ADMIN_MENU_DATABASE
)},
2
);
// Listener to change right panel when clicked on a user
managementTable
.
addListener
(
new
Property
.
ValueChangeListener
()
{
private
static
final
long
serialVersionUID
=
1L
;
public
void
valueChange
(
ValueChangeEvent
event
)
{
Item
item
=
managementTable
.
getItem
(
event
.
getProperty
().
getValue
());
// the value of the property is the itemId of the table entry
if
(
item
!=
null
)
{
if
(
"0"
.
equals
(
event
.
getProperty
().
getValue
().
toString
()))
{
setDetailComponent
(
new
AdminRunningInstancesPanel
());
}
else
if
(
"1"
.
equals
(
event
.
getProperty
().
getValue
().
toString
()))
{
setDetailComponent
(
new
AdminCompletedInstancesPanel
());
}
else
if
(
"2"
.
equals
(
event
.
getProperty
().
getValue
().
toString
()))
{
setDetailComponent
(
new
AdminDatabaseSettingsPanel
());
}
// Update URL
ExplorerApp
.
get
().
setCurrentUriFragment
(
new
UriFragment
(
AdministrationNavigator
.
MANAGEMENT_URI_PART
,
event
.
getProperty
().
getValue
().
toString
()));
}
else
{
// Nothing is selected
setDetailComponent
(
null
);
ExplorerApp
.
get
().
setCurrentUriFragment
(
new
UriFragment
(
AdministrationNavigator
.
MANAGEMENT_URI_PART
,
managementId
));
}
}
});
return
managementTable
;
}
public
void
notifyGroupChanged
(
String
managementId
)
{
// Clear cache
managementTable
.
removeAllItems
();
// select changed group
managementTable
.
select
(
Integer
.
valueOf
(
managementId
));
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/ProcessDefinitionImageStreamResourceBuilder.java
浏览文件 @
c70d320c
...
...
@@ -91,6 +91,27 @@ public class ProcessDefinitionImageStreamResourceBuilder {
}
return
imageResource
;
}
public
StreamResource
buildStreamResource
(
String
processInstanceId
,
String
processDefinitionId
,
RepositoryService
repositoryService
,
RuntimeService
runtimeService
)
{
StreamResource
imageResource
=
null
;
ProcessDefinitionEntity
processDefinition
=
(
ProcessDefinitionEntity
)
((
RepositoryServiceImpl
)
repositoryService
).
getDeployedProcessDefinition
(
processDefinitionId
);
if
(
processDefinition
!=
null
&&
processDefinition
.
isGraphicalNotationDefined
())
{
InputStream
definitionImageStream
=
ProcessDiagramGenerator
.
generateDiagram
(
processDefinition
,
"png"
,
runtimeService
.
getActiveActivityIds
(
processInstanceId
));
StreamSource
streamSource
=
new
InputStreamStreamSource
(
definitionImageStream
);
// Create image name
String
imageExtension
=
extractImageExtension
(
processDefinition
.
getDiagramResourceName
());
String
fileName
=
processInstanceId
+
UUID
.
randomUUID
()
+
"."
+
imageExtension
;
imageResource
=
new
StreamResource
(
streamSource
,
fileName
,
ExplorerApp
.
get
());
}
return
imageResource
;
}
protected
String
extractImageExtension
(
String
diagramResourceName
)
{
String
[]
parts
=
diagramResourceName
.
split
(
"."
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/CopyModelClickListener.java
浏览文件 @
c70d320c
package
org.activiti.explorer.ui.process.listener
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.ui.CopyModelPopupWindow
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
com.vaadin.ui.Button.ClickEvent
;
...
...
@@ -14,9 +14,9 @@ import com.vaadin.ui.Button.ClickListener;
public
class
CopyModelClickListener
implements
ClickListener
{
private
static
final
long
serialVersionUID
=
1L
;
private
Model
Data
modelData
;
private
Model
modelData
;
public
CopyModelClickListener
(
Model
Data
model
)
{
public
CopyModelClickListener
(
Model
model
)
{
this
.
modelData
=
model
;
}
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/DeleteModelClickListener.java
浏览文件 @
c70d320c
package
org.activiti.explorer.ui.process.listener
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.ui.DeleteModelPopupWindow
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
com.vaadin.ui.Button.ClickEvent
;
...
...
@@ -15,9 +15,9 @@ public class DeleteModelClickListener implements ClickListener {
private
static
final
long
serialVersionUID
=
1L
;
protected
Model
Data
modelData
;
protected
Model
modelData
;
public
DeleteModelClickListener
(
Model
Data
model
)
{
public
DeleteModelClickListener
(
Model
model
)
{
this
.
modelData
=
model
;
}
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/DeployProcessDefinitionClickListener.java
浏览文件 @
c70d320c
...
...
@@ -15,11 +15,11 @@ package org.activiti.explorer.ui.process.listener;
import
org.activiti.bpmn.converter.BpmnXMLConverter
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.language.json.converter.BpmnJsonConverter
;
import
org.activiti.engine.ProcessEngines
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.repository.Deployment
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.NotificationManager
;
...
...
@@ -40,9 +40,9 @@ public class DeployProcessDefinitionClickListener implements ClickListener {
protected
RepositoryService
repositoryService
;
protected
NotificationManager
notificationManager
;
protected
Model
Data
modelData
;
protected
Model
modelData
;
public
DeployProcessDefinitionClickListener
(
Model
Data
model
)
{
public
DeployProcessDefinitionClickListener
(
Model
model
)
{
this
.
repositoryService
=
ProcessEngines
.
getDefaultProcessEngine
().
getRepositoryService
();
this
.
notificationManager
=
ExplorerApp
.
get
().
getNotificationManager
();
...
...
@@ -52,7 +52,7 @@ public class DeployProcessDefinitionClickListener implements ClickListener {
public
void
buttonClick
(
ClickEvent
event
)
{
try
{
ObjectNode
modelNode
=
(
ObjectNode
)
new
ObjectMapper
().
readTree
(
modelData
.
get
ModelEditorJson
());
ObjectNode
modelNode
=
(
ObjectNode
)
new
ObjectMapper
().
readTree
(
modelData
.
get
EditorSource
());
BpmnModel
model
=
new
BpmnJsonConverter
().
convertToBpmnModel
(
modelNode
);
byte
[]
bpmnBytes
=
new
BpmnXMLConverter
().
convertToXML
(
model
);
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/EditModelClickListener.java
浏览文件 @
c70d320c
...
...
@@ -16,9 +16,9 @@ public class EditModelClickListener implements ClickListener {
private
static
final
long
serialVersionUID
=
1L
;
protected
NotificationManager
notificationManager
;
protected
lo
ng
modelId
;
protected
Stri
ng
modelId
;
public
EditModelClickListener
(
lo
ng
modelId
)
{
public
EditModelClickListener
(
Stri
ng
modelId
)
{
this
.
notificationManager
=
ExplorerApp
.
get
().
getNotificationManager
();
this
.
modelId
=
modelId
;
...
...
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/ui/process/listener/ExportModelClickListener.java
浏览文件 @
c70d320c
...
...
@@ -20,8 +20,8 @@ import java.util.logging.Logger;
import
org.activiti.bpmn.converter.BpmnXMLConverter
;
import
org.activiti.bpmn.model.BpmnModel
;
import
org.activiti.editor.data.model.ModelData
;
import
org.activiti.editor.language.json.converter.BpmnJsonConverter
;
import
org.activiti.engine.repository.Model
;
import
org.activiti.explorer.ExplorerApp
;
import
org.activiti.explorer.Messages
;
import
org.activiti.explorer.NotificationManager
;
...
...
@@ -43,9 +43,9 @@ public class ExportModelClickListener implements ClickListener {
protected
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ExportModelClickListener
.
class
.
getName
());
protected
NotificationManager
notificationManager
;
protected
Model
Data
modelData
;
protected
Model
modelData
;
public
ExportModelClickListener
(
Model
Data
model
)
{
public
ExportModelClickListener
(
Model
model
)
{
this
.
notificationManager
=
ExplorerApp
.
get
().
getNotificationManager
();
this
.
modelData
=
model
;
}
...
...
@@ -58,12 +58,11 @@ public class ExportModelClickListener implements ClickListener {
@Override
public
DownloadStream
getStream
()
{
String
editorJson
=
modelData
.
getModelEditorJson
();
DownloadStream
ds
=
null
;
try
{
BpmnJsonConverter
jsonConverter
=
new
BpmnJsonConverter
();
JsonNode
editorNode
=
new
ObjectMapper
().
readTree
(
editorJson
);
JsonNode
editorNode
=
new
ObjectMapper
().
readTree
(
modelData
.
getEditorSource
()
);
BpmnModel
bpmnModel
=
jsonConverter
.
convertToBpmnModel
(
editorNode
);
BpmnXMLConverter
xmlConverter
=
new
BpmnXMLConverter
();
byte
[]
bpmnBytes
=
xmlConverter
.
convertToXML
(
bpmnModel
);
...
...
modules/activiti-webapp-explorer2/src/main/resources/META-INF/persistence.xml
已删除
100644 → 0
浏览文件 @
b679dd9d
<persistence
xmlns=
"http://java.sun.com/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version=
"2.0"
>
<persistence-unit
name=
"org.activiti.jpa"
transaction-type=
"RESOURCE_LOCAL"
>
<provider>
org.hibernate.ejb.HibernatePersistence
</provider>
<class>
org.activiti.editor.data.model.ModelData
</class>
<exclude-unlisted-classes>
true
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.dialect"
value=
"org.hibernate.dialect.HSQLDialect"
/>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create"
/>
<property
name=
"hibernate.connection.driver_class"
value=
"org.h2.Driver"
/>
<property
name=
"hibernate.connection.url"
value=
"jdbc:h2:mem:activiti"
/>
<property
name=
"hibernate.connection.username"
value=
"sa"
/>
<property
name=
"hibernate.connection.password"
value=
""
/>
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
modules/activiti-webapp-explorer2/src/main/resources/log4j.xml
已删除
100644 → 0
浏览文件 @
b679dd9d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration
xmlns:log4j=
"http://jakarta.apache.org/log4j/"
>
<appender
name=
"CONSOLE"
class=
"org.apache.log4j.ConsoleAppender"
>
<param
name=
"Target"
value=
"System.out"
/>
<layout
class=
"org.apache.log4j.PatternLayout"
>
<param
name=
"ConversionPattern"
value=
"%d{DATE} [%t] %5p %C:%L - %m%n"
/>
</layout>
</appender>
<root>
<priority
value=
"INFO"
/>
<appender-ref
ref=
"CONSOLE"
/>
</root>
</log4j:configuration>
\ No newline at end of file
modules/activiti-webapp-explorer2/src/main/resources/messages.properties
浏览文件 @
c70d320c
...
...
@@ -180,7 +180,7 @@ process.edit = Edit model
process.copy
=
Copy model
process.delete
=
Delete model
process.new
=
New model
process.deploy
=
Deploy
process definition
process.deploy
=
Deploy
process.convert
=
Convert to editable model
process.export
=
Export to BPMN 2.0
process.toxml.failed
=
Create of BPMN XML failed
...
...
@@ -198,6 +198,7 @@ process.instances = Process instances
process.no.instances
=
No process instances found for this process definition
process.action.view
=
view
process.instance.id
=
ID
process.instance.name
=
Name
process.instance.businesskey
=
Business key
process.instance.actions
=
Actions
process.instance.variable.name
=
Name
...
...
@@ -220,6 +221,7 @@ management.menu.deployments.upload = Upload new
management.menu.jobs
=
Jobs
management.menu.users
=
Users
management.menu.groups
=
Groups
management.menu.admin
=
Administration
# Job page
job.execute
=
Execute
...
...
@@ -293,6 +295,30 @@ group.no.members = This group has no members
group.select.members
=
Select members for {0} group
group.delete
=
Delete group
# Running process instances page
admin.menu.running
=
Running process instances
admin.menu.completed
=
Completed process instances
admin.menu.database
=
Database settings
admin.running.title
=
Process definitions of running instances
admin.definitions
=
Process Definitions
admin.running.none.found
=
No running process instances found
admin.completed.title
=
Process definitions of completed instances
admin.completed.none.found
=
No completed process instances found
admin.nr.instances
=
Nr of instances
admin.started.by
=
Started by
admin.start.activity
=
Start activity id
admin.finished
=
Finished
# Database settings page
database.title
=
Database settings
database.type
=
Database type
database.update
=
Database schema update
database.config.type
=
Database configuration
database.jndi
=
JNDI name
database.datasource.class
=
Data source class
database.datasource.url
=
Data source url
database.jdbc.url
=
JDBC URL
# Upload
upload.select
=
Choose a file
upload.drop
=
Drop a file here
...
...
modules/activiti-webapp-explorer2/src/main/resources/test.model.json
→
modules/activiti-webapp-explorer2/src/main/resources/
org/activiti/explorer/demo/model/
test.model.json
浏览文件 @
c70d320c
文件已移动
modules/activiti-webapp-explorer2/src/main/resources/test.svg
→
modules/activiti-webapp-explorer2/src/main/resources/
org/activiti/explorer/demo/model/
test.svg
浏览文件 @
c70d320c
文件已移动
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
浏览文件 @
c70d320c
...
...
@@ -48,46 +48,18 @@
<!-- Custom form types -->
<bean
id=
"userFormType"
class=
"org.activiti.explorer.form.UserFormType"
/>
<!-- DEVELOPMENT PROFILE -->
<beans
profile=
"dev"
>
<bean
id=
"dataSource"
class=
"org.apache.commons.dbcp.BasicDataSource"
>
<property
name=
"driverClassName"
value=
"org.h2.Driver"
/>
<property
name=
"url"
value=
"jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000"
/>
<property
name=
"username"
value=
"sa"
/>
<property
name=
"password"
value=
""
/>
<property
name=
"defaultAutoCommit"
value=
"false"
/>
</bean>
</beans>
<!-- PRODUCTION PROFILE -->
<beans
profile=
"prod"
>
<bean
id=
"dbProperties"
class=
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
<property
name=
"location"
value=
"classpath:db.properties"
/>
<!-- Allow other PropertyPlaceholderConfigurer to run as well -->
<property
name=
"ignoreUnresolvablePlaceholders"
value=
"true"
/>
</bean>
<bean
id=
"dataSource"
class=
"org.apache.commons.dbcp.BasicDataSource"
>
<property
name=
"driverClassName"
value=
"${jdbc.driver}"
/>
<property
name=
"url"
value=
"${jdbc.url}"
/>
<property
name=
"username"
value=
"${jdbc.username}"
/>
<property
name=
"password"
value=
"${jdbc.password}"
/>
<property
name=
"defaultAutoCommit"
value=
"false"
/>
</bean>
<!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/activiti?autoReconnect=true" />
<property name="username" value="activiti" />
<property name="password" value="activiti" />
<property name="defaultAutoCommit" value="false" />
</bean> -->
<bean
id=
"dbProperties"
class=
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
<property
name=
"location"
value=
"classpath:db.properties"
/>
<!-- Allow other PropertyPlaceholderConfigurer to run as well -->
<property
name=
"ignoreUnresolvablePlaceholders"
value=
"true"
/>
</bean>
</beans>
<bean
id=
"dataSource"
class=
"org.apache.commons.dbcp.BasicDataSource"
>
<property
name=
"driverClassName"
value=
"${jdbc.driver}"
/>
<property
name=
"url"
value=
"${jdbc.url}"
/>
<property
name=
"username"
value=
"${jdbc.username}"
/>
<property
name=
"password"
value=
"${jdbc.password}"
/>
<property
name=
"defaultAutoCommit"
value=
"false"
/>
</bean>
</beans>
\ No newline at end of file
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/web.xml
浏览文件 @
c70d320c
...
...
@@ -26,14 +26,6 @@
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<listener>
<listener-class>
org.activiti.editor.servlet.listener.EntityManagerListener
</listener-class>
</listener>
<listener>
<listener-class>
org.activiti.editor.test.listener.TestDataListener
</listener-class>
</listener>
<servlet>
<servlet-name>
Vaadin Application Servlet
</servlet-name>
<servlet-class>
org.activiti.explorer.servlet.ExplorerApplicationServlet
</servlet-class>
...
...
pom.xml
浏览文件 @
c70d320c
...
...
@@ -435,11 +435,6 @@
<artifactId>
javaGeom
</artifactId>
<version>
0.11.0
</version>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
<version>
4.1.4.Final
</version>
</dependency>
<!-- Webapps -->
<dependency>
<groupId>
com.vaadin
</groupId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录