




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、jbpm5持久化及流轉(zhuǎn)流程剖析1 jbpm5持久化結(jié)構(gòu)圖jbpm5實(shí)例流程圖下面的文檔講解了基丁該流程的步驟流程2第一步啟動(dòng)任務(wù)流程吋序圖:第一步人工任務(wù)執(zhí)行時(shí)序圖taskciient(taskciianlhandler1啟動(dòng)taskserver.持久化organizat iona頂層包:外部系統(tǒng)2.啟動(dòng)流出2. 1耕析bpmn2文件;2.2開啟事務(wù)2. 3 ksession開始執(zhí)j亍任務(wù)2. 3 1 執(zhí)行startnode,執(zhí)fbeforenode攔截器尊: _2. 3. 2 執(zhí)行l(wèi)iumantasknode* 執(zhí)行beforenode攔 18器等) ! !3.初始化handler3.1初始
2、化client3.2建立minn通佶連絃3.3注冊(cè)妙件complete3.4注冊(cè)班件fiii 135注冊(cè)爭(zhēng)件skip4.調(diào)用exculdiorkllea方法匚二4. 1初始化task任務(wù)和息ftt調(diào)用client添加任務(wù)信總!|4 3 addtaskrequest4.5 addtaskresponse;46返回 4.7返回i5關(guān)閉事務(wù);ii6 1 ultflhimantaskafternode 攔彊器6. 2 執(zhí)fistartafternode攔截25i6.3 持久化 process info, work 11i6.3 ksession. dispose02.1 啟動(dòng) taskserver使用
3、線程丿動(dòng)taskserver,初始化持久化organizationentity,將流程中需要使用到的 groupld, actorld.全部初始化到表中。2.2啟動(dòng)流程1)根據(jù)路徑解析*.bpmn2或*.bpmn文件,放入到內(nèi)存中。在該類注冊(cè)了相關(guān)的對(duì)象 org.jbpm.bpmn2.xml.bpmnsemanticmodule addhandler(nprcpercyu r nevz propertyhandler();addhandler(nlanenz new 匚anehandler();addhandler(”弓匸己二匸三匸呂口匸", new starteventhandle
4、r();addhandler(匸"卩 nevz endevenhandler();addhandler(r,exclj3lvegatewayn z new excl3lvega*ewayhaedler();addhandler (n2.nclejslvegatewayn f new zncl3lvega*ewayhaedler (); addhandler(nparallelgaewayr, z new parallelgatewayhandler();addhandler ("刁巴口匚2ei3£dg己匸e討己了” 營(yíng) nevz ezencsasedgaceway
5、handler (); addhandler (ncciriplexgace/7ayn new coir.plexgacewayhandler ();addhandler (nscrlp"ctasknz new scriptaskhandler ();addhandler (r,tasknz new taskhandler ();addhandler (n-jsertaskn f new usertaskhandlex ();addhandler (nrsan j.alzaskn z new man'jaltakhandler ();addhandler (r,ser*7lc
6、eta3knf new serviceia3khandler ();addhandler(n3endta3knr new sendta3khandler();addhandler (nreoe2_veta3kn f new recei*7eta3khadler ();addhadler (,lb j3lr.e33r,j.leta3knz new 33lr.e33r-j±eta3khandler ();addhandler (ncallact2_vitynz new callactivityhandler ();addhandler (n3,.ibproce33nf new sbpro
7、cesshandler ();addhandler(11 adhocsbfrcce33n, new adhoc5bproce3 3andler();addhandler ("二二匸呂二mwci二&匸:ce匸三寸e:n匸”' new znterir.ediatecatcheventhandler (); addhandler ("二二匸呂二mwci二&匸巳二上二c專三寸e:n匸”' new znterir.ediatetr:rcweventhanciler (); addhandler (ribcndaryeventf, a new bcnda
8、ryeventhandler ();addhandler (r,d&taob; ectn r new da*acbjecthandler ();addhandler (r,tran3&ct-cnn f nevz trar.3acticnhand.ler ();addhandler (n3eqj.enceflcwr,z new seqier.ceflowhandler ();addhandler (n-ceidef-n2.tlcnn f new itemdefinitlonhandler ();addhandler (,lir.es3agen, new messagehandle
9、r ();addhandler (,lnterfacer,/ new interfaceandler ();addhandler (,cperatlcnn/ new operationhar,dler ();addhandler (nr2-ie33agerefrr z new inme33agerefhandler ();addhandler (,le3calationn, new e3calationhandler ();addhandler (,lerrcruf new errcrhandler ();addhandler (,ld&t.a5tcreri/ new datastor
10、eandler ();addhandler (,la33ccla*lonnf new a33cclaticnhandler ();handlersbyclass.p-jt (split. class, new splirhandler ();handler33ycla3s.p'jt (jom.classz new joinhandler (); handlerssyclass.put(eventmcde.class, new eventmodehandler(); handlerssyclass.pt(timermcde.class, nevz timernodehandler();h
11、aedlex53yclass .p*jc (endljode. class new endnodehardler (); handlersbyslass(fa二二匸nccie class, new r aul-cmodehaedler ();riancilerssyclass .p-jt (wcrkzcernmcde class, new wcr clterr-iodehandler (); handlers3yclas5.put(acicnncde.class, new acxonncdehandler(); handlersbydass.put (statemcdeclass, nevz
12、staemodehandler ():;riandlersbyslass.p-jt (conxcslteccerexnode.classf new coinposltecontextmodehandler (); handlers3yclass.pt(foreachnode.classz new foreachmcdehandler();2.2.1開啟事務(wù)222 ksession開始執(zhí)行任務(wù)在 org.drools.persistence.singlesessioncommandservice 中 execute 扌丸彳亍, public synchronized <t>
13、7; execre (conzr:ai:d<t> cczrand) ; try rxm.begln();二匚2.tkse33lon ( this . sessonlnfo . cetld () rthis .rr.ax3halllnchelper cer?cba3e () f this .rr.arsnallinqhelper cetcc匚f ();this. jpin.beginccirir.andscopedentitymanacer ();/thisappscopedentitymanager.jointransaction(); reciscerrollbacksync()
14、;txiu. comml'c ();根據(jù)不同的command可以實(shí)現(xiàn)ksession的交互return re3ulr;catch (runciir.eexcepclon re) rcllbacktran3action(re);throvz re; catch ( exception zl ) rcllbacktransaction(tl);tbrow nevz r*jinclir.eexceprlon (n?jrapped excepcicn see ca-j3er,/ 1); finally if ( ccirir.and instanceof dbpobeccnuland ) th
15、is. jpm.dispose ();type hi erarchy o£ org drools<=() andl generivgener i cc omm and<?t > 一 org .drools. comm an d. implabortprocessinstancecommand - mandtabortworkltemcommand 一 org drools command .runtimg.addeventlistenercommand - org drools. command .runti_ agendagroupsetfocuscommand
16、一 org.drools. command. r asser tequals 一 org drools command ass er tion,bt chexecu tio ncommandlmpl - org .drools .command. rui cl ear ac ti va tio ngroupcommand 一 org. drools, command, i cle aragendac omm and - org drools. command .runtime, ri cl e ar agendagr oupc omm and - org. drools. command .r
17、un tj clearruleflowgroupcommand 一 org.drools. command, rm completeworkltemcommand - org drools. command .run tj creatancecommand - org. drools, command. di eposecommand - org drools command .runtimewfhess ctrq-i to see the suwztypw hi"aixhy流程實(shí)例為 oigjbpm.ruleflow.instance.ruleflowprocessinstance
18、 的對(duì)象進(jìn)入 cess.statlprocesscommand 中執(zhí)彳亍 excutepublic processxcstance execute(context cccexislaefulkrovledgcsessxon ksession - ( (knowledgecccnndcocexx) coszexr)gezstazeflkcvledesessioc ():if (data nail)(for (ctojecc o: dy <k99910q二匕上匸(0;>froce9匕匕uq匕ee) ::(fzuu電9二d. fatare二色=):(zxe
19、clonkes-lzzrl (<knowledgecczznazicxzex < ocnzexr ez£xecuzionkeslzs( » gezres-lls i 1 puz(th】9ourzdenclfler, w4.看豆了我程啟乞方式.執(zhí)行慕疹久化的szezbeledcesd 賠翔忌縛嚴(yán)> retnrn prccessznjance;223 執(zhí)行 startnode執(zhí)行startnode,結(jié)點(diǎn)任務(wù)public prccesslnsc&nce startprocedalastance(iona proceaszcatancezd) try &l
20、t;kruntiroe startcperation();if ( !jcruntxzie.gecicrioxigene()xaeccy() ) :kruntme.exeuxitequemedact丄ox:9 ():processinstance processinstance gecfxacessinatance(proceslstacceld);return pracesslnstance;1 w8執(zhí)行“5入克 2開til執(zhí)行期 finally icrunixe .eudopenno:!();任務(wù)流轉(zhuǎn)核心方法public final void rz.gger (mcdelnscance f
21、rom, scrig 匸¥?巳)boolean hidden = false;if (getnode() .getmetadaca ()get (hidden11) != null) hidden true;znterralkncwledcerncirse ic二二二匸二me = gefrocessistance (:cerkncwledcer-ncirr.e (); if (!hidden) (inernalprocessrut-me) krunt-meqe匚ezrocmssr二n匸二u包() 進(jìn)入結(jié)點(diǎn)攔戳器getfrocessevents-pport().flre3eforeno
22、detriggered(tbis, kruntime);i&二二二三qqer (fzruir.p二vp巳);i 流程流轉(zhuǎn)核心揑制器if (!hidden) (znernalfrocessrlmt-me 1 1c二二二匚二me qe匚emocessr二n匸二u乞()getprocessevens-pport () freaferncdetriggered (this, kr-jncime);退岀結(jié)點(diǎn)攔截器cermodelsanceconcalner ()1找到結(jié)點(diǎn)的出口cermodelsanceconcalner ()protected void triggerccir.pleted(s
23、tring type, boolean remove) if (remove) (orc jbpn:討o二cf二o討三二呂匚auug .nude二口3匸&二ceuor:匸ainem : remcvemodelscance(this);node node = getmode();list:<connec<cion> connections = null;if (nod色! null) | coxinec匕丄ons nodegetoacgoingcon0eucions(cype);if (connections = null | connections.isenpcy (
24、) (org bpm>rorcf二o討二二3匚auue .nude二ns匸&二ceuor:匸aiuem :ncdezns-aceccrnpleced(this, 二ype); else for (ccnneccicn connection: connecc.ons) / stop if this process instance has been aborted / completedif (getfrocessinscance () getsate () ! process instance staflaut 工 ve) return;2.連接結(jié)點(diǎn)控制protected voi
25、d triqaercc&ctctioa(cocntction conn«ctio&> < boolean nidden falm; if <q«thod«()q«tx«t«daao' null> hidden true;interaalzncvledgerurtiffic krufitxoe getprccessznstaoe() if (!hldde2> (xntezaalprccessruatmel kruatxsegetproceaseventsppcrt < >
26、幺qtbi.;i2栓否看jl&5用戶電/ check fcr exclmive grcxxp first ncdelnszanceccszaxner p®-e"- - qe二nude:ru5=e=ccuy 二二e= > : if (parent instanceof ccczexzzsazaxceccntaxnerli9z<cqszexzis9?«cce> cokzcxzxn3z«scc9 -<cox-exzxnazazcecczzaizexi parexzi -gezcczzexzizazazcea i£xcl
27、axve3xc-p:it (conzexzlnszance ,w null! for (conr«xz:n«z*nc conc<xz:nft«nc«: new xrraylx9<co&z«xz:s二:xaqccu二!(;:!;二uc«)( exciu«iv«group:n«?«nc< groupls«t*sc« iexcl«xv«3rcp:c二cc«>二it <gro;pln.cosifmnoa】匕二)
28、63;ror (ncdelnstanct ncd«lq匸匕c«: grcplc"匕x匕二-sx(門 < if (ncdelnttance ! thit> 1 (osq:bpsvo:rkncv二cc4e:l9ance).cancel(>(contexti&tta&cecoscaintr) paz«&t> s«asv«ccstext:z匸uuao畫復(fù)£xc二迂 5rwp, contextxctta&ct):93執(zhí)行下個(gè)虛ire方渣/ trigger next node(0x
29、9:eps.vesrkflo廿ix二made:c®to:ue) < (srg:bp=vorkflcw二匕9=二匸它!<0<1亡:二9=二=亡二0匕:二二©=tetnodelsstaccecostaiser () i fethcdelaatanceiccnbection.gettoq)<trigger(thi», cc&aectioa>gextotyyq >:(i internalfrcceasrnzxrae) jrruu二二n gu=p:ro=es3r:=x=eq).gezfrsceaatvczzs'ippcrz
30、 (» .fizeafzergseleft «xhisr 1ttzzx=c» :4 如:開至 w三 1?*旦岑224 流程執(zhí)行 humantasknode流程執(zhí)行到humantask任務(wù)結(jié)點(diǎn),引擎會(huì)執(zhí)行org jbpm. workflow . instance . node worki temnode instance 這彳實(shí)彳列類(l勺 internal trigger 方法,并持久化 workiteminfopublic void xnternaltriggex(final ncdelnszance frcs. spring type) super匕ype);
31、/ tooo this should be included for ruleflov only, not for bpelif (ozq dtools .process !.:$匸ouce 討osrlctreno wotklregi); catch (worklcerahandlernocfoundexcepcion wihnfe) (2 4yorkxt«»ss> shsitsikfiznfiftgecfrocestlnstance () . secstate ( prcceiilnicance. sratzasorrzd ):wrkltmthrow wihnfe;
32、if (!workitenirode.iawaxtforcoapletxon()( triggerccnpleced 0 :this.v/oriciuenzci wcrkltemgerhd(): nodeconnectxon_default_type.equalm(type) throw new illegalargusentexception(a worklterenode only accepts default mcomicg connections * *);norkhendcde womk"ercncde ();| uzeete閤orklteruworkxtenhode);
33、| iorkltif (worjcitersitode!,9*bixfo:rh:qple"o:u) adcworklteslxstener():>if (xsinversionofcontrok) (proceaainstance) getproceaazndtance()getknowledgeruatine() update(processlnstance) qetprocesalnstance()gecknowledgeruntirce()gefacthandle<tbis), this>:i else <try (pobxia void interft
34、ixkxecutemorirxtmkvorkxtmi vorirxteii) eavireemst «rv tbit4fvarklvuoco wor*:t«a:&fo n«w yorkxtwzaco <vorkzt«mr an :ex.peraiaz (worirzze&icfo):fersxsenceccntexccxexjfer sx sxezcecc 二 f mamk 二» env.f” i 再久化»arkitei lycrkzesiisii vorklt<ai 9etld<vozlr:tesx
35、l£fcvorirztenzsfc update () j£xvxrs=eztxa=e ) .gex*=ars<:ei5er3i9ezcecexxexx < > ;if (tble.wxtenj nolli (thiaw:匸 n«w k4>nxap<lon9* xorirzcmuctox)j )vorteltes匸nt qwor:resge=xd(), vorirlteainfol:wcric:<=h*!:51«r nadl« iv:ic:z0u4:r) tbit. -t二&二haat,);lazdl
36、er.exerexsricxzeskxsridzez thist :throworicic«n2totfeu&dzmc«pciod( werklttm ): g二 kuo 莒 ldgrnn 二二 () g二前 orkxfrnm:g匕 o ) internaxexecuzeworklten (2.3 初始化 handler官方默認(rèn)提供了 workltemhandler的實(shí)現(xiàn),com.carefx.workflow.handleccommandbascdwshumantaskhandler。這個(gè) handler 就類似人 工任務(wù)的范本,如果業(yè)務(wù)系統(tǒng)要做其他事情,可以適當(dāng)
37、的修改這個(gè)類就可以,例如:與外 部組織機(jī)構(gòu)交互等。2.3.1 初始化 client初始化taskclient.用于client與 服務(wù)端server交互2.3.2建立mina通信連接jbpm5默認(rèn)以mina作為通信持久化通信橋梁2.3.3 注冊(cè)事件 complete2.3.4注冊(cè)事件fail2.3.5注冊(cè)事件skip初始化commandbasedwshumantaskhandler方法時(shí),山客丿端發(fā)起,向服務(wù)端中注冊(cè)任務(wù)事件(taskcompletedevent, taskfailedevent, taskskippedevent, taskclaimedevent 等)。 客戶端(通過(guò)min
38、a發(fā)起):public void() if (cl丄色nt null) client = new taskclient (new mxnataslcclieszconnecccr("cr g dxcola .pmuuess .homic 二二 y匸.nshuxartankhandler*1.new misataskclie&tmandler(syateseventliatenerfactory ;ttsys?eszventxutener():boolean ccsn«ct<d cliest.connect (xpaddros, pert):if ("
39、connected) <throw new xllegalarguseszexcepzios( acould not cos&ect task client*);>注冊(cè)tasiceventicey key new taskeveatkey (taskccnpleedevent-1);tasjrccsqpletedhandler eventresponsehandler new taskccnpletedhandler(client(statefulknowledgesession)ksession); client.zegi.9匸亡匕匸(key. false, eventr
40、eapoasehandler): key new task!venkey(taskfaxled£vent.classr -1);u二二仝二二.reglsterfczlten*(jceyz false, evenxrespc*sehandler):key new taskzvexzey(tasksk-ppei£ven.class. -1);clienz二匸exfu二三y仝二匸(味乞丫, false, evenzresposehanler):服務(wù)端(通過(guò)mina接收):case rsgistsrforevsntrzqiiqst: response = coirir.andnai
41、r.e. evsntxri r 殳 spxs?;eventkey key = (eventkey) cmd.gerargmenrs().get(o); boolean remove = (boolean) emd. getaraent3 () . get (1);sri匚q h二二d = (string) emd. cezkrcnzs () . cez (2); clients .pj匸(wld, 3e33ion);eventra匚spo二匸 ra匚spo二匸 = nev7 eventranspcrcind. getld () f client3z remove);3erv2.ee cetev
42、entkey3 () reci3ter (key, tra匚匸); break;2.4 調(diào)用 excuteworkltem 方法調(diào)用excuteworkltem方法,目的初始化任務(wù)信息(任務(wù)名稱、任務(wù)優(yōu)先級(jí)、處理任務(wù)人員 分配籌),將得到的任務(wù)信息一并發(fā)送到服務(wù)端進(jìn)行持久化overridepublic void exec*-iteworkltem(wcrkzteir. wcrklten, wcrklterrl-ianacer n;anacer) coe匚eut ();ta3k t&3k = new t&3k();srrz.ng askmair.e = (string) wok二
43、匕em匚etealzmirete二("tasknajre”);2.4.1初始化task任務(wù)信息2.4.2調(diào)用client添加任務(wù)信息2.4.3 addtaskrequest由客戶端(taskclicnt)向服務(wù)端(taskscrvcr)轉(zhuǎn)發(fā)持久化task請(qǐng)求該方法最后一行通過(guò)發(fā)送addtaskrequest請(qǐng)求,發(fā)送到服務(wù)端,由服務(wù)端持久化 task 和 content 信息client.addtask(task, content, null);2.4.4持久化task服務(wù)端(org.jbpm.task.service.taskserverhandler)接收到客戶端發(fā)送來(lái)的消息 a
44、ddtaskrequest,1)持久化 task 信息,插入相關(guān)的農(nóng)(peopleassignments_potowners,peopleassignments_exclowners, peopleassignments_stakeholders, peopleassignments_bas, peopleassignments_recipients,task, 118ntext)2.4.5 addtaskresponse通過(guò)addtaskresponse,山服務(wù)端(taskserver)發(fā)起請(qǐng)求通知客廣端(taskclient),通知客 戶端(org.jbpm.task. service.t
45、askclienthandler)添加任務(wù)完畢,持久化processinstanceln£o, workiteminfo 數(shù)據(jù)此時(shí)路程已經(jīng)執(zhí)行到了 humantask任務(wù)結(jié)點(diǎn)上,同時(shí)分配了任務(wù)給具體的人。進(jìn)行了持 久化操作。接著等待人員觸發(fā)該任務(wù)2.4.6返回任務(wù)結(jié)束返冋sessionld,proceslnstanceld給用八,外部系統(tǒng)保持以便獲取持久化信息。2.5關(guān)閉事務(wù)(提交事務(wù))持久化 processlnfo,workitem 等,并対 sessioninfo 解鎖2.6執(zhí)行流程的后續(xù)操作261 執(zhí)行 humantaskafternode 攔截器2.6.2 執(zhí)行 starta
46、fternode 攔截器2.6.3 執(zhí)行 humantaskafternode 攔截器2.6.4 ksession.disponse()釋放 ksession3第二步人工任務(wù)流程時(shí)序圖:warkl;lowlnt"facoi; i rm kncr itdskcli ml (taskcl ieiill i in idler)1. jc動(dòng)tasics、.兒久organization2.說(shuō)川人工仟?jiǎng)?wù)執(zhí)汀按口a外和系統(tǒng)3解析bjxnn24. ifijiksessionldij;取嗆“sion5.知妞化cl iont5. 1建立mimi週侑連接5.2注冊(cè)珈件conplete5.3汴冊(cè)爭(zhēng)ftfai
47、l5.3注沏爭(zhēng)件skip5. 4返冋6 registerwork7-發(fā)超存詢?nèi)藖A任務(wù)諂求7. 1. qtierytnsksassignedpotentinlowncr7. 2. qurryttiksunitfiryrcnpnnsrwa. 4返冋99發(fā)虎2誡功完成人.任務(wù)i與求(gwlqle7.3返回人丄任務(wù)伯息8發(fā)拗開始執(zhí)行任務(wù)請(qǐng)求(start)8. 1 operationrequest&2淹程實(shí)例狀態(tài)改空為inpraccss8.3 ojx?rat ionresponse9. 2 eventtri ggerresponsetw9 3 ojwrat innresppnse9. 4 grt
48、taykrequest9.5 gettaskrespons-fw9.6 getcontentrequestt-9. 7 getcont entresponse9. i oprrat ioncqucst9. 25返冋<-9. 8 w ftjwork 11 emit h! siconp 1 et ework 11 emit 口1-9.9 kgswion幵啟爭(zhēng)務(wù)9.11開貽結(jié)點(diǎn)進(jìn)轉(zhuǎn)jllunantaskhttnd i or(初始化9 17 executework i ten9. 23返回9.24 1p務(wù)提交9. 13 初始化client9. i i 注shepleteevenl9.15 itm
49、failevent9. 16 注mskipevcnt9. 18初妬化下個(gè)結(jié)點(diǎn).的tosk9. 19發(fā)迖創(chuàng)住任務(wù)持久化謂求9.20 addtaskrequest9. 21 adrfrakkcspannc9. 22返|叫3.1 啟動(dòng) taskservertaskserver保持啟動(dòng)狀態(tài),或者至新丿占動(dòng)一個(gè)線程亦可。3.2調(diào)用人工任務(wù)執(zhí)行接口外部系統(tǒng)通過(guò)該接口實(shí)現(xiàn)人工任務(wù)的交互3.3 解析 bpmn2讀収原來(lái)流程的bpmn2文件并解析到j(luò)bpm5框架中3.4 通過(guò) kessionld 獲取 ksession通過(guò)第一步返冋的sessionld.獲取到持久化的sessioninfo信息,以及proces
50、sinstance信息。 同時(shí)proccsslnstancc流程實(shí)體采用數(shù)據(jù)鎖,保證并發(fā)女全性f ex»e iicse33icn s ijpakncwledg*service二01:19二3二仝于:;二?(?:二羅二仝么孑仝0仝53二0::(幺9仝99二:二二4"0“9仝"二:二g,仝二:3.5初始化client3.5.1建立mina通信連接初始化taskclient,建立起mina連接3.5.2 注冊(cè)事件 complete3.5.3注冊(cè)事件fail3.5.4注冊(cè)事件skip同時(shí)山客八端(taskclient)發(fā)起,須向服務(wù)端(taskserver)中注冊(cè)任務(wù)事件
51、(taskcompletedevent, taskfailedevent, taskskippedevent, taskclaimedevent)注冊(cè)兒個(gè)事件, 就需要發(fā)起兒個(gè)mina請(qǐng)求幺戶端(通過(guò)mina發(fā)起):public void ccnnec* « if (cl丄enc null) client = new tasjcclxenr r.ev minatasjccliezconnec'ucr i"erg drccls .emuuenn 肓ur k二二 en =9上二二new hx*&t&sjrcli.enha*dler (syaerzveci
52、iscenerf&cory yersystex£venrlisrer:er( : o ;boolean ccnxecred client.coanecc(xpaddress, port);if ("connected) throw now illegalaxgusenexcefxcn(could net connect task client");>/注冊(cè)taslceventkey key new taskeventkey(taskccnpxeedevent.cla.】):taskconqpletedhandler eventrespon new t
53、lcccnl<t«dhandl«r (clxeaz, (statefulknowledgesei.on)cs&on); clientzeg丄sterfozeye匕匸(key. false, eventreapondehandler):key new taskeventxeydaskfailedevent .class, -1):client :rg二匸:rfosreveur tfalso, eventresponsehandler):key new taskeve*txey(ta9kskxppedevest.class, -1);client.register
54、forevent(keyr false, eventresponsehandler):服務(wù)端(通過(guò)mina接收):case rejisterforeventeuest: response = ccirir.andnair.e eventtriggerrzsponsz;eventkey key = (eventkey) cmd. getarcents () .get(o); boo 1 巳an remove = (boolean) emd. cezarcrr.enzs () . cez (1); string id = (string) emd. getaraent3 () . get (2);
55、 cllenr3 .“匸(二二二6 3e33ion);eventtrauspo二匸 trauspo二匸 = nevz eventtransportcmd. geid () f clients, remove);servicegeteventkeys()register(keyr transport);break;3.5.5返回3.6 registerworkltemhandler (容器注冊(cè)人工任務(wù)handler)通過(guò)handler注冊(cè)后,jbpm5會(huì)自動(dòng)實(shí)現(xiàn)與業(yè)務(wù)系統(tǒng)的交互3.7發(fā)起查詢?nèi)斯と蝿?wù)請(qǐng)求轉(zhuǎn)發(fā)請(qǐng)求査詢?nèi)斯と蝿?wù)請(qǐng)求到taskclient3.7.1 querytasksassigned
56、aspotentialowner客戶端(taskclient)向服務(wù)端(taskserver)發(fā)送請(qǐng)求。發(fā)起querytasksassignedaspotentialowner查詢請(qǐng)求:查詢分配的用戶任務(wù)列農(nóng)taskclienc getasksassiqnedaspotentialowner cdserorgro-dpidccnzanzsen ukf re3ponsehandler);:<sresp?r:5ehadler = new 31coklata3k5'jrmaryre3cor.3ehadler :;根據(jù)港在用戶查詢待處理的任務(wù)"結(jié)果返回包含在 responsem
57、&ndler312.5*<tasksummary> results = responsehandler .qmtres二二匸s ();responsehandler. waittilldcne (contanzs tilltzle) ;|public void cectaskba33igr.eda3poterlalc77er (string 二se二二d“string language,ta3<s*jrrn:aryrebgonsemaucile二 re3pcn3ehandler) li5t<0b:ecc> args = new arraylist<object>( 2 );args add( us
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 法學(xué)概論考試的整體規(guī)劃與試題及答案
- 2025屆新疆烏魯木齊仟葉學(xué)校七下數(shù)學(xué)期末達(dá)標(biāo)檢測(cè)模擬試題含解析
- 計(jì)算機(jī)二級(jí)VB考試知名試題及答案
- 財(cái)務(wù)業(yè)務(wù)工作目標(biāo)規(guī)劃計(jì)劃
- 軟件水平考試經(jīng)典試題及答案解析
- 2024年西安碑林區(qū)友誼小學(xué)招聘筆試真題
- 2024年溫州榕園學(xué)校引進(jìn)教育人才筆試真題
- 2024年海南省農(nóng)業(yè)農(nóng)村廳下屬事業(yè)單位真題
- 2024年秦皇島事業(yè)單位招聘筆試真題
- 2024年甘肅省應(yīng)急管理廳下屬事業(yè)單位真題
- 醫(yī)療器械勞動(dòng)合同范本
- 數(shù)字華容道-1課時(shí)
- 2024-2029年中國(guó)醇類燃料行業(yè)深度調(diào)研及投資前景預(yù)測(cè)研究報(bào)告
- 相約勞動(dòng)智慧樹知到期末考試答案章節(jié)答案2024年陜西鐵路工程職業(yè)技術(shù)學(xué)院
- MOOC 人工智能:模型與算法-浙江大學(xué) 中國(guó)大學(xué)慕課答案
- 奇異的仿生學(xué)智慧樹知到期末考試答案2024年
- 2024年國(guó)家義務(wù)教育質(zhì)量監(jiān)測(cè)心理健康和德育考試試題及答案
- 24春國(guó)家開放大學(xué)《農(nóng)業(yè)推廣》調(diào)查報(bào)告參考答案
- 企業(yè)借款申請(qǐng)書(2篇)
- 新生兒更換尿不濕的課件
- 2024屆廣東省惠州市高三上學(xué)期第一次調(diào)研考試數(shù)學(xué)試題
評(píng)論
0/150
提交評(píng)論