Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
5beba0ff
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,发现更多精彩内容 >>
提交
5beba0ff
编写于
4月 27, 2011
作者:
J
jbarrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: adding demo data
上级
dc21ccc9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
82 addition
and
10 deletion
+82
-10
modules/activiti-engine/src/main/java/org/activiti/engine/impl/mail/MailScanSchedulerThread.java
...rg/activiti/engine/impl/mail/MailScanSchedulerThread.java
+12
-9
modules/activiti-webapp-explorer2/src/main/java/demo/DemoMailScanner.java
...-webapp-explorer2/src/main/java/demo/DemoMailScanner.java
+50
-0
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/demo/DemoDataGenerator.java
...in/java/org/activiti/explorer/demo/DemoDataGenerator.java
+16
-1
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
...-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
+4
-0
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/impl/mail/MailScanSchedulerThread.java
浏览文件 @
5beba0ff
...
...
@@ -32,7 +32,7 @@ public class MailScanSchedulerThread extends Thread {
private
static
Logger
log
=
Logger
.
getLogger
(
MailScanSchedulerThread
.
class
.
getName
());
protected
boolean
isActive
=
false
;
protected
int
idleWaitInMillis
=
2
000
;
protected
int
idleWaitInMillis
=
10
000
;
protected
MailScanner
mailScanner
;
protected
CommandExecutor
commandExecutor
;
protected
Map
<
String
,
MailScanCmd
>
allMailScansCmds
=
Collections
.
synchronizedMap
(
new
HashMap
<
String
,
MailScanCmd
>());
...
...
@@ -58,15 +58,17 @@ public class MailScanSchedulerThread extends Thread {
public
void
run
()
{
isActive
=
true
;
log
.
fine
(
getClass
().
getName
()+
" is started"
);
while
(
mailScanner
.
isActive
()
)
{
while
(
isActive
)
{
MailScanCmd
mailScanCmd
=
getNextMailScanCmd
();
try
{
commandExecutor
.
execute
(
mailScanCmd
);
}
catch
(
Exception
e
)
{
// users need to logout and login if they want to re-enable mail scanning after a failure
String
userId
=
mailScanCmd
.
getUserId
();
allMailScansCmds
.
remove
(
userId
);
log
.
log
(
Level
.
SEVERE
,
"couldn't check todo mail for "
+
userId
+
": "
+
e
.
getMessage
(),
e
);
if
(
mailScanCmd
!=
null
)
{
try
{
commandExecutor
.
execute
(
mailScanCmd
);
}
catch
(
Exception
e
)
{
// users need to logout and login if they want to re-enable mail scanning after a failure
String
userId
=
mailScanCmd
.
getUserId
();
allMailScansCmds
.
remove
(
userId
);
log
.
log
(
Level
.
SEVERE
,
"couldn't check todo mail for "
+
userId
+
": "
+
e
.
getMessage
(),
e
);
}
}
}
log
.
fine
(
getClass
().
getName
()+
" is stopping"
);
...
...
@@ -81,6 +83,7 @@ public class MailScanSchedulerThread extends Thread {
Thread
.
sleep
(
idleWaitInMillis
);
}
catch
(
InterruptedException
e
)
{
log
.
fine
(
"sleep got interrupted"
);
return
null
;
}
}
if
(
nextMailScanCmds
.
isEmpty
())
{
...
...
modules/activiti-webapp-explorer2/src/main/java/demo/DemoMailScanner.java
0 → 100644
浏览文件 @
5beba0ff
/* 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
demo
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.impl.ProcessEngineImpl
;
import
org.activiti.engine.impl.mail.MailScanner
;
import
org.springframework.beans.factory.InitializingBean
;
/**
* @author Joram Barrez
*/
public
class
DemoMailScanner
implements
InitializingBean
{
protected
ProcessEngine
processEngine
;
protected
MailScanner
mailScanner
;
public
void
afterPropertiesSet
()
throws
Exception
{
mailScanner
=
((
ProcessEngineImpl
)
processEngine
)
.
getProcessEngineConfiguration
()
.
getMailScanner
();
mailScanner
.
start
();
mailScanner
.
addUser
(
"tom"
,
null
);
}
public
void
shutdown
()
{
mailScanner
.
shutdown
();
}
public
ProcessEngine
getProcessEngine
()
{
return
processEngine
;
}
public
void
setProcessEngine
(
ProcessEngine
processEngine
)
{
this
.
processEngine
=
processEngine
;
}
}
modules/activiti-webapp-explorer2/src/main/java/org/activiti/explorer/demo/DemoDataGenerator.java
浏览文件 @
5beba0ff
...
...
@@ -13,6 +13,8 @@
package
org.activiti.explorer.demo
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.logging.Logger
;
import
org.activiti.engine.IdentityService
;
...
...
@@ -144,13 +146,26 @@ public class DemoDataGenerator {
createUser
(
identityService
,
"julie"
,
"Julie"
,
"Hall"
,
"julie"
,
"julie.hall@alfresco.com"
,
"org/activiti/explorer/images/julie.jpg"
);
createUser
(
identityService
,
"erik"
,
"Erik"
,
"Winlof"
,
"erik"
,
"erik.witloof@alfresco.com"
,
"org/activiti/explorer/images/erik.jpg"
);
//
Additional info
//
Joram
identityService
.
setUserInfo
(
"joram"
,
"birthDate"
,
"10-10-1985"
);
identityService
.
setUserInfo
(
"joram"
,
"jobTitle"
,
"Activiti core developer"
);
identityService
.
setUserInfo
(
"joram"
,
"location"
,
"Welle, Belgium"
);
identityService
.
setUserInfo
(
"joram"
,
"phone"
,
"+32485869655"
);
identityService
.
setUserInfo
(
"joram"
,
"twitterName"
,
"jbarrez"
);
identityService
.
setUserInfo
(
"joram"
,
"skype"
,
"joram.barrez"
);
// Tim
String
accountUsername
=
System
.
getProperty
(
"user"
);
String
accountPassword
=
System
.
getProperty
(
"pwd"
);
if
(
accountUsername
==
null
||
accountPassword
==
null
)
{
throw
new
RuntimeException
(
"'user' and 'pwd' system property must be set"
);
}
Map
<
String
,
String
>
accountDetails
=
new
HashMap
<
String
,
String
>();
accountDetails
.
put
(
"toDoFolderName"
,
"Cases"
);
accountDetails
.
put
(
"toDoInActivitiFolderName"
,
"CasesInActiviti"
);
accountDetails
.
put
(
"imapHost"
,
"imap.gmail.com"
);
accountDetails
.
put
(
"imapProtocol"
,
"imaps"
);
identityService
.
setUserAccount
(
"tom"
,
null
,
"mailscan"
,
accountUsername
,
accountPassword
,
accountDetails
);
}
protected
void
createUser
(
IdentityService
identityService
,
String
userId
,
String
firstName
,
String
lastName
,
...
...
modules/activiti-webapp-explorer2/src/main/webapp/WEB-INF/applicationContext.xml
浏览文件 @
5beba0ff
...
...
@@ -10,6 +10,10 @@
<bean
id=
"demoDataGenerator"
class=
"org.activiti.explorer.demo.DemoDataGenerator"
>
<property
name=
"processEngine"
ref=
"processEngine"
/>
</bean>
<bean
id=
"demoMailScanner"
class=
"demo.DemoMailScanner"
destroy-method=
"shutdown"
>
<property
name=
"processEngine"
ref=
"processEngine"
/>
</bean>
<context:component-scan
base-package=
"org.activiti.explorer"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录