Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
353afd98
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
353afd98
编写于
10月 19, 2010
作者:
K
kristin.polenz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed method getArtifactLinks and addArtifactLinks and return type of these.
上级
194cf948
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
26 deletion
+63
-26
modules/activiti-cycle/src/main/java/org/activiti/cycle/CycleService.java
...-cycle/src/main/java/org/activiti/cycle/CycleService.java
+5
-5
modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/db/CycleServiceDbXStreamImpl.java
...org/activiti/cycle/impl/db/CycleServiceDbXStreamImpl.java
+52
-15
modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/db/DummyBaseCycleService.java
...ava/org/activiti/cycle/impl/db/DummyBaseCycleService.java
+6
-6
未找到文件。
modules/activiti-cycle/src/main/java/org/activiti/cycle/CycleService.java
浏览文件 @
353afd98
...
...
@@ -37,12 +37,12 @@ public interface CycleService {
/**
* add given link to Cycle
*/
public
void
addLink
(
Artifact
link
);
public
void
addLink
(
RepositoryArtifactLink
link
);
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
);
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
);
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
String
type
);
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
,
String
type
);
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
);
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
);
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
String
type
);
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
,
String
type
);
public
void
deleteLink
(
long
linkId
);
...
...
modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/db/CycleServiceDbXStreamImpl.java
浏览文件 @
353afd98
...
...
@@ -3,19 +3,19 @@ package org.activiti.cycle.impl.db;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
javax.servlet.http.HttpSession
;
import
org.activiti.cycle.ArtifactRevision
;
import
org.activiti.cycle.Cycle
;
import
org.activiti.cycle.CycleConfig
;
import
org.activiti.cycle.Artifact
;
import
org.activiti.cycle.CycleLink
;
import
org.activiti.cycle.CycleService
;
import
org.activiti.cycle.RepositoryArtifact
;
import
org.activiti.cycle.RepositoryArtifactLink
;
import
org.activiti.cycle.RepositoryConnector
;
import
org.activiti.cycle.RepositoryException
;
import
org.activiti.cycle.impl.RepositoryArtifactLinkImpl
;
import
org.activiti.cycle.impl.conf.ConfigurationContainer
;
import
org.activiti.cycle.impl.conf.CycleDbSqlSessionFactory
;
import
org.activiti.cycle.impl.connector.demo.DemoConnectorConfiguration
;
...
...
@@ -41,6 +41,7 @@ public class CycleServiceDbXStreamImpl extends DummyBaseCycleService implements
private
XStream
xStream
=
new
XStream
();
private
String
processEngineName
=
null
;
private
static
Long
DEFAULT_REVISION
=
new
Long
(
0
);
private
static
String
DEFAULT_ENGINE
=
"DEFAULT_PROCESS_ENGINE"
;
private
static
HashMap
<
String
,
CycleDbSqlSessionFactory
>
dbFactories
=
new
HashMap
<
String
,
CycleDbSqlSessionFactory
>();
...
...
@@ -144,35 +145,71 @@ public class CycleServiceDbXStreamImpl extends DummyBaseCycleService implements
return
(
ConfigurationContainer
)
configXML
;
}
/**
*
* Should be the parameter connectorId and artifactId or is the sourceArtifactId parameter composed of
* connectorId and artifactId??
* If yes, how can I split the sourceArtifactId in connectorId and artifactId? Only with String-Operation?
*/
@Override
public
void
addArtifactLink
(
String
sourceArtifactId
,
String
targetArtifactId
)
{
SqlSessionFactory
sqlMapper
=
getSessionFactory
();
//TODO: select before insert! check, if sourceArtifact exists as Artifact object in datbabase.
Artifact
artifact
=
new
Artifact
();
artifact
.
setId
(
sourceArtifactId
);
CycleLink
cycleLink
=
new
CycleLink
();
cycleLink
.
setSourceArtifact
(
artifact
);
cycleLink
.
setId
(
targetArtifactId
);
CycleLink
link
=
new
CycleLink
();
// link.setSourceConnectorId(sourceConnectorId);
// link.setTargetConnectorId(targetConnectorId);
link
.
setSourceArtifactId
(
sourceArtifactId
);
link
.
setTargetArtifactId
(
targetArtifactId
);
SqlSession
session
=
sqlMapper
.
openSession
();
session
.
insert
(
"org.activiti.cycle.CycleLink.insertCycleLink"
,
cycleL
ink
);
session
.
insert
(
"org.activiti.cycle.CycleLink.insertCycleLink"
,
l
ink
);
session
.
commit
();
}
/**
* Should be the parameter connectorId and artifactId or is the sourceArtifactId parameter composed of
* connectorId and artifactId??
* If yes, how can I split the sourceArtifactId in connectorId and artifactId? Only with String-Operation?
*/
@Override
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
)
{
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
)
{
List
<
RepositoryArtifactLink
>
repositoryArtifactLinkList
=
new
ArrayList
<
RepositoryArtifactLink
>();
SqlSessionFactory
sqlMapper
=
getSessionFactory
();
SqlSession
session
=
sqlMapper
.
openSession
();
try
{
List
<
Artifact
>
artifactResultList
=
session
.
selectList
(
"org.activiti.cycle.Artifact.selectArtifact"
,
sourceArtifactId
);
return
artifactResultList
;
List
<
CycleLink
>
linkResultList
=
session
.
selectList
(
"org.activiti.cycle.CycleLink.selectArtifactLinkForSourceArtifact"
,
sourceArtifactId
);
if
(
linkResultList
!=
null
&&
!
linkResultList
.
isEmpty
())
{
for
(
CycleLink
cycleLink
:
linkResultList
)
{
RepositoryArtifactLink
repositoryArtifactLink
=
new
RepositoryArtifactLinkImpl
();
repositoryArtifactLink
.
setId
(
cycleLink
.
getId
());
repositoryArtifactLink
.
setSourceElementId
(
cycleLink
.
getSourceElementId
());
repositoryArtifactLink
.
setTargetElementId
(
cycleLink
.
getTargetElementId
());
repositoryArtifactLink
.
setSourceElementName
(
cycleLink
.
getSourceElementName
());
repositoryArtifactLink
.
setTargetElementName
(
cycleLink
.
getTargetElementName
());
repositoryArtifactLink
.
setSourceRevision
(
cycleLink
.
getSourceRevision
());
repositoryArtifactLink
.
setTargetRevision
(
cycleLink
.
getTargetRevision
());
repositoryArtifactLink
.
setDescription
(
cycleLink
.
getDescription
());
repositoryArtifactLink
.
setLinkType
(
cycleLink
.
getLinkType
());
repositoryArtifactLink
.
setLinkedBothWays
(
cycleLink
.
isLinkedBothWays
());
//TODO: How can I get the connector to create a new RepositoryArtifact?
// RepositoryArtifact sourceRepositoryArtifact = new RepositoryArtifactLinkImpl(cycleLink.getSourceConnectorId(), cycleLink.getSourceArtifactId(), );
// RepositoryArtifact targetRepositoryArtifact = new RepositoryArtifactLinkImpl(cycleLink.getTargetConnectorId(), cycleLink.getTargetArtifactId(), );
// repositoryArtifactLink.setSourceArtifactId(sourceRepositoryArtifact);
// repositoryArtifactLink.setTargetArtifactId(targetRepositoryArtifact);
repositoryArtifactLinkList
.
add
(
repositoryArtifactLink
);
}
}
return
repositoryArtifactLinkList
;
}
finally
{
session
.
close
();
}
...
...
modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/db/DummyBaseCycleService.java
浏览文件 @
353afd98
...
...
@@ -2,9 +2,9 @@ package org.activiti.cycle.impl.db;
import
java.util.List
;
import
org.activiti.cycle.Artifact
;
import
org.activiti.cycle.CycleService
;
import
org.activiti.cycle.CycleTag
;
import
org.activiti.cycle.RepositoryArtifactLink
;
import
org.activiti.cycle.RepositoryNodeNotFoundException
;
import
org.activiti.cycle.impl.connector.demo.DemoConnector
;
...
...
@@ -18,7 +18,7 @@ public abstract class DummyBaseCycleService implements CycleService {
public
void
addArtifactLink
(
String
sourceArtifactId
,
String
targetArtifactId
)
{
}
public
void
addLink
(
Artifact
link
)
{
public
void
addLink
(
RepositoryArtifactLink
link
)
{
}
public
void
addTag
(
String
nodeId
,
String
tagName
)
{
...
...
@@ -41,19 +41,19 @@ public abstract class DummyBaseCycleService implements CycleService {
return
null
;
}
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
)
{
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
)
{
return
null
;
}
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
)
{
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
)
{
return
null
;
}
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
String
type
)
{
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
String
type
)
{
return
null
;
}
public
List
<
Artifact
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
,
String
type
)
{
public
List
<
RepositoryArtifactLink
>
getArtifactLinks
(
String
sourceArtifactId
,
Long
sourceRevision
,
String
type
)
{
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录