锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
鎵╁睍榪佺Щ閫昏緫
The migration logic is written in such a way, that it is easy to extend to suit your needs. The source code is available as a Maven 2 project in the srcsubfolder of the downloaded zip file. To build a new zip file, after having changed or extended the logic, simply execute a
榪佺Щ閫昏緫鍙互緙栧啓錛屼互渚胯交鏉懼湴婊¤凍浣犵殑闇姹傘傛簮浠g爜鍦ㄦ墍涓嬭澆zip鏂囦歡閲宻rc瀛愭枃浠跺す閲屼綔涓涓狹aven 2欏圭洰鏉ヤ嬌鐢ㄣ備負(fù)浜?jiǎn)鏋勫晦Z竴涓柊鐨剒ip鏂囦歡錛屽湪宸茬粡鏀瑰彉鎴栬呮墿灞曢昏緫涔嬪悗錛岀畝鍗曟墽琛屼笅闈㈡寚浠?/p>
to produce a new zip file in the target folder.
鍦╰arget鏂囦歡涓嬩駭鐢熶竴涓柊鐨剒ip鏂囦歡銆?
Following picture gives a high-level overview of the classes in the migration logic.
涓嬪浘鎻愪緵浜?jiǎn)鍦q佺Щ閫昏緫閲岀被鐨勯珮灞傛姒傝矊銆?
ServiceFactory.configureFromProperties(jbpmDbProperties, activitiDbProperties);
1 public void execute() throws IOException {
2
3 // convert processes
4 ServiceFactory serviceFactory = createServiceFactory();
5 ProcessConversionService processConversionService = serviceFactory.getProcessConversionService();
6 Map<String, Document> migratedProcesses = processConversionService.convertAllProcessDefinitions();
7
8 // write results to bpmn20.xml files
9 writeConvertedProcesses(migratedProcesses, workingDir);
10
11 // Deploy processes to Activiti
12 ActivitiService activitiService = serviceFactory.getActivitiService();
13 activitiService.deployConvertedProcesses(migratedProcesses);
14
15 // data migration
16
17 }
The ActivitiService offers operation needed to get the migrated data in the Activiti tables. For example, deploying the converted process definitions is such an operation
ProcessConversionService 鏄竴涓寘鍚祦紼嬭漿鎹㈠拰鏁版嵁?huà)個(gè)绱㈢殑嫻佺▼瀹氫箟鍊熷彛銆傚畠浣跨敤浜?Jbpm3Dao.鐨勫疄鐜般傝繖涓被鐨勭己鐪佸疄鐜頒嬌鐢ㄤ簡(jiǎn)Hibernate鐨?strong>SessionFactory浠巎BPM 3鐨勬暟鎹簱琛ㄩ噷媯(gè)绱㈡墍鏈夌殑鏁版嵁銆?
ActivitiService 鎻愪緵闇瑕佷粠Activiti鏁版嵁搴撹〃榪佺Щ鏁版嵁鐨勬搷浣溿備緥濡傦紝閮ㄧ講杞崲涔嬪悗鐨勬祦紼嬪畾涔夊氨鏄姝ょ殑鎿嶄綔銆?
1 public ProcessConversionService getProcessConversionService() {2 if (processConversionService == null) {
3 this.processConversionService = createDefaultProcessConversionService();
4 }
5 return processConversionService;
6 }
7
8 protected ProcessConversionService createDefaultProcessConversionService() {
9 ProcessConversionServiceImpl service = new ProcessConversionServiceImpl(getJbpm3Dao());
10 return service;
11 }
Table of Contents
鐩綍琛?
鏁版嵁榪佺Щ
嫻佺▼杞崲
鎵╁睍榪佺Щ閫昏緫
The jBPM migration is considered [EXPERIMENTAL].
jBPM榪佺Щ浠呬綔[EXPERIMENTAL]涔嬬敤銆?
It is possible to migrate an existing installation of jBPM version 3 to Activiti. The migration includes both process definition conversion (ie. from JPDL 3 to BPMN 2.0) and data migration.
灝嗕竴涓凡瀹夎鐨刯BPM 鐗堟湰3榪佺Щ鍒癆ctiviti鏄湁鍙兘鐨勩傝縼縐誨寘鎷祦紼嬪畾涔夎漿鎹紙渚嬪浠嶫PDL3鍒癇PMN 2.0錛夊拰鏁版嵁榪佺Щ銆?
The migration tool is currently offered as a 'preview' only! The migration coverage is at this point in time not sufficient to be usable on production process definitions and databases. Also note that the migration is a 'best effort', which means that you may need to extend the migration logic to cover all your use cases.
榪佺Щ宸ュ叿鐩墠鍙綔涓?#8216;棰勮’涔嬬敤錛?/strong>褰撳墠榪佺Щ涓嶈兘瑕嗙洊鍒頒駭鍝佺殑嫻佺▼瀹氫箟鍜屾暟鎹備篃瑕佹敞鎰忚縼縐繪槸‘鏈澶х殑鍔姏’錛岃繖鎰忓懗鐫浣犲彲浠ラ渶瑕?#8216;鎵╁睍榪佺Щ閫昏緫’鏉ユ帶鍒朵綘鎵鏈夌殑鐢ㄤ緥銆?
The migration tool is separately availbale as a zip file from the activiti.org download site. Once you have unzipped this file, you will see following files and folders:
榪佺Щ宸ュ叿浠?a >activiti.org涓嬭澆绔欑偣浠ip鏂囦歡鏂瑰紡鍒嗗紑涓嬭澆銆備竴鏃﹀姞鍘嬭繖涓枃浠訛紝鏂囦歡鍜屾枃浠跺す濡備笅鎵紺猴細(xì)
鏁版嵁搴撹縼縐?/strong>
It is possible to migrate the data in the jBPM 3 database tables to the Activiti database schema. To do this, following properties files must be changed to point at the right database:
灝唈BPM3鏁版嵁搴撹〃榪佺Щ鍒癆ctiviti鏁版嵁搴搒chema鏄湁鍙兘鐨勩備負(fù)浜?jiǎn)瀹屾垚杩欎釜鋼Q鍔★紝蹇呴』鏀瑰彉?shù)笅闈㈢殑properties鏂囦歡錛屾寚鍚戞紜殑鏁版嵁搴擄細(xì)
The database migration will use the data in the jBPM 3 tables to:
鏁版嵁榪佺Щ灝嗕嬌鐢╦BPM3鏁版嵁搴撹〃鐨勬暟鎹潵鍋氾細(xì)
The data is retrieved from the jBPM 3 tables using Hibernate queries and the Hibernate mappings of jBPM itself.
浣跨敤Hibernate鏌ヨ鍜宩BPM鑷韓鐨凥ibernate鏄?
灝勶紝鍙互浠巎BPM 3鏁版嵁搴撹〃閲屾绱㈠埌榪欎簺鏁版嵁銆?
嫻佺▼杞崲
It is possible to only convert the process definitions xml from JPDL to BPMN 2.0 that can be executed on the Activiti engine. To do this, place the jBPM 3 processes inside the processes folder. There can be any number of (nested) subfolders, the tool will scan every (sub)folder inside processes to discover processdefinition.xml files (file name must be processdefinition.xml!).
鍙皢JPDL鐨勬祦紼嬪畾涔墄ml杞崲涓鴻兘鍦ˋctiviti寮曟搸鎵ц鐨凚PMN 2.0鏄湁鍙兘鐨勩備負(fù)浜?jiǎn)瀹屾垚杩欎釜鋼Q鍔★紝璇峰皢jBPM 3鏀劇疆鍒皃rocess 鏂囦歡澶廣傚彲浠ユ湁浠諱綍鏁伴噺錛堝唴緗級(jí)瀛愭枃浠跺す錛屽伐鍏峰皢鎵弿process姣忎釜錛堝瓙錛夋枃浠跺す錛屾潵鍙戠幇processdefinition.xml鏂囦歡錛堟枃浠跺悕蹇呴』鏄痯rocessfinition.xml!錛夈?
The discovered processes will be parsed and deployed to an in-memory databse, such that the logic of reverse engineering the process definition from the jBPM deployment tables contained in the database migration is used for both cases.
琚彂鐜扮殑嫻佺▼灝嗚瑙f瀽騫墮儴緗插埌涓涓唴瀛樻暟鎹簱錛屼互渚垮鍖呭惈鍦ㄦ暟鎹簱榪佺Щ鐨刯BPM閮ㄧ講鏁版嵁搴撹〃鐨勬祦紼嬪畾涔夎繘琛屽弽鍚戝伐紼嬶紝浠ヤ負(fù)瑙f瀽鍜岄儴緗蹭箣鐢ㄣ?
Once the jBPM 3 processes are placed in the processes folder, execute the convert.processes target in the root of the unzipped migration tool folder:
涓鏃BPM 3嫻佺▼琚斁緗埌process鏂囦歡澶癸紝閭d箞鎵ц鍦ㄨВ鍘嬩箣鍚庣殑榪佺Щ宸ュ叿鏂囦歡澶規(guī)牴鐩綍涓嬬殑convert.processes鐩爣銆?
ant convert.processes
During conversion, you will see plenty logging passing by describing where and how the process conversion is being executed. At the end of the conversion, you will see following logging appear:
鍦ㄨ漿鎹㈣繃紼嬩腑錛岄氳繃鎻忚堪嫻佺▼杞崲鎵ц鏄綍鍦板拰浣曟椂杞崲鐨勬柟寮忥紝鍙互瑙傚療鍒板ぇ閲忕殑鏃ュ織銆傚湪杞崲鐨勬湯灝撅紝灝嗚瀵熷埌涓嬪垪鏃ュ織鍑虹幇錛?
As shown in the logging, the resulting BPMN 2.0 processes can be find in the converted-process-xxxx folder, where the xxxx is the timestamp of the conversion.
姝e鏃ュ織鎵紺猴紝BPMN 2.0嫻佺▼鐨勭粨鏋滃彲浠ュ湪converted-process-xxxx鏂囦歡澶歸噷鎵懼埌錛岃繖閲寈xxx鏄漿鎹㈢殑鏃墮棿鎴熾?
In this release, only limited support for start, end, wait state and task-nodes is implemented. In the future, this coverage will expand.
鍦ㄦ湰嬈″彂甯冮噷錛屽彧瀹炵幇浜?jiǎn)瀵瑰紑濮嬶紝緇撴潫錛岀瓑寰呭拰浠誨姟鑺傜偣鐨勬湁闄愭敮鎸併傚湪灝嗘潵錛岃繖涓鐩栬寖鍥村皢瑕佹墿鍏呫?
Grails is a dynamic web application framework built on Java and Groovy, leveraging best of breed APIs from the Java EE sphere including Spring, Hibernate and SiteMesh. Grails brings to Java and Groovy developers the joys of convention-based rapid development while allowing them to leverage their existing knowledge and capitalize on the proven and performant APIs Java developers have been using for years.
Grails 1.3.7 now bundles Groovy 1.7.8.
When Grails logs a stacktrace, the log message may include the names and values of all of the request parameters for the current request. To mask out the values of secure request parameters, specify the parameter names in the grails.exceptionresolver.params.exclude
config property:
grails.exceptionresolver.params.exclude = ['password', 'creditCard']
Request parameter logging may be turned off altogether by setting thegrails.exceptionresolver.logRequestParameters
config property to false
. The default value is true
when the application is running in DEVELOPMENT mode and false
for all other modes.
grails.exceptionresolver.logRequestParameters = false
Table of Contents
Overview錛堟榪幫級(jí)
Changing the database錛堝彉鏇存暟鎹簱錛?
Activiti KickStart is a webbased tool to quickly create 'adhoc' business processes using a subset of constructs available to the Activiti engine. KickStart provides a simple UI that doesn't require to learn BPMN or any modeling environment, as it works with concepts that are familiar to every business user. However, the processes that are created using KickStart, are fully BPMN 2.0 compliant and can be used as a starting point for more complex BPM endeavours.
Activiti KickStart鐨勬槸涓涓熀浜嶹eb鐨勫伐鍏鳳紝鐢ˋctiviti寮曟搸鍙敤鐨勬瀯浠訛紙constructs錛夌殑瀛愰泦鎻愪緵緇欏揩閫熷垱寤?#8220;鍗沖腑錛坅dhoc錛?#8221;鐨勪笟鍔℃祦紼嬨侹ickstart鎻愪緵浜?jiǎn)涓嶅繀瀛︿範(fàn)BPMN鎴栬呬換浣曞緩妯$幆澧冪殑綆鍗昒I錛屽洜涓哄畠鏍?wèi)绔嬩簡(jiǎn)姣忎釜涓氬姟鐢ㄦ埛閮界啛鎮(zhèn)夌殑姒傚奎c(diǎn)備絾鏄紝閫氳繃KickStart鍒涘緩鐨勭殑嫻佺▼錛屾槸鍜孊PMN 2.0鍏煎錛屽茍鍙綔涓烘洿涓哄鏉侭PM鍔姏鐨勮搗鐐廣?
KickStart integrates perfectly with the Activiti engine. As such, processes created with KickStart are immediataly usable in Activiti Explorer and are visible in Probe.
KickStart鑳藉拰Activiti寮曟搸瀹岀編闆嗘垚銆傚洜姝わ紝閲囩敤KickStart鍒涘緩鐨勬祦紼嬪湪Activiti Explorer绔嬪嵆鍙敤錛屽茍鍦≒robe閲岄潰鍙銆?
KickStart serves many business cases, but the following three are probably the most common:
KickStart鏈嶅姟璁稿鍟嗕笟妗堜緥錛屼絾浠ヤ笅涓変釜鍙兘鏄渶甯歌錛?
Following screenshots show the capabilities of Activiti KickStart. Take for example the next picture. It shows how an expense process is created in a matter of a few minutes.
涓嬪垪灞忓箷鎴浘灞曠ず浜?jiǎn)Activiti KickStart鐨勮兘鍔涖備笅鍥句綔涓虹ず渚嬨傚畠灞曠ず濡備綍鍦ㄥ嚑鍒嗛挓涔嬪唴鍒涘緩涓涓粯璐規(guī)祦紼嬨?
After clicking the save button, the process is immediately usable in Activiti Explorer:
鍦ㄧ偣鍑?#8220;淇濆瓨”鎸夐挳涔嬪悗錛岃繖涓祦紼嬬珛鍗沖湪Activiti Explorer鍙敤銆?
KickStart also allows to define forms for every task:
KickStart涔熷厑璁鎬負(fù)姣忎釜浠誨姟瀹氫箟琛ㄥ崟錛?
Which are obviously directly usable in Activiti Explorer:
榪欎簺鏄庢樉鐩存帴鍦ˋctiviti Explorer鍙敤錛?
At any time during process creation, it is possible to view the corresponding BPMN 2.0 diagram of the business process:
鍦ㄦ祦紼嬪緩绔嬬殑浠繪剰鏃墮棿錛屽畠鍙互鏌ョ湅鐩稿簲鐨凚PMN2.0涓氬姟嫻佺▼鍥俱?
Whenever it is required, the processes defined with KickStart can be opened up and modified:
姣忓綋瀹冩槸蹇呴渶錛屼笌KickStart鐨勫畾涔夌殑嫻佺▼鍙鎵撳紑鍜屼慨鏀癸細(xì)
Processes created with KickStart are fully compliant with the BPMN 2.0 XML, which means that the process can be imported into any BPMN 2.0 editor:
鐢↘ickStart鐨勫垱寤虹殑嫻佺▼鏄畬鍏ㄧ鍚圔PMN2.0鐨刋ML錛岃繖鎰忓懗鐫璇ユ祦紼嬪彲浠ョ敱浠諱綍鍏煎鐨凚PMN2.0緙栬緫鍣ㄨ緭鍏ワ細(xì)
Changing the database錛堝彉鏇存暟鎹簱錛?/strong>
Activiti KickStart is currently not yet using the REST API, but uses the service API by including the Activiti engine as a library. While Explorer, Probe and Cycle use the same mechanism for changing the database (see here), the same does not yet apply for KickStart.
Activiti KickStart褰撳墠榪樻病鏈変嬌鐢≧EST API錛岃屾槸閫氳繃鍖呮嫭浜?jiǎn)Activiti寮曟搸浣滀負(fù)綾誨簱浣跨敤鏈嶅姟API銆傝櫧鐒禘xplorer錛孭robe鍜孋ycle浣跨敤鐩稿悓鐨勬満鍒舵敼鍙樻暟鎹紙鍙傝榪欓噷錛夛紝浣嗚繖涓嶉備簬KickStart銆?
To change the database that KickStart uses in the demo setup, generate a new activiti.cfg.jar, and place it in the apps/apache-tomcat-6.x/webapps/activiti-kickstart/WEB-INF/lib folder.
涓轟簡(jiǎn)鏀瑰彉婕旂ず瀹夎閲孠ickStart浣跨敤鐨勬暟鎹簱錛屼駭鐢熶竴涓柊鐨刟ctiviti.cfg.jar,騫跺皢瀹冩斁緗埌apps/apache-tomcat-6.x/webapps/activiti-kickstart/WEB-INF/lib鏂囦歡澶廣?