Resistors color codes and voltage = kilohms × milliamps / Watts
JBPM console how to attach your custom form template to your custom process
If you are playing with jbpm_cosole like I am then the of of the first question will be – how can I attach my own form template (ftl).
Why I did not use guvnor? The reasone was that it did not work on my environment – Mac Os X and I also tried on Centos 6.x. I was getting all the time I started Jboss server to log:
14:08:30,328 INFO [org.drools.repository.RulesRepositoryConfigurator] (http-localhost-127.0.0.1-8080-12) Creating an instance of the RulesRepositoryConfigurator.
14:08:33,202 INFO [stdout] (http-localhost-127.0.0.1-8080-12) =============== session-admin-4
14:08:33,826 ERROR [org.jbpm.integration.console.shared.GuvnorConnectionUtils] (http-localhost-127.0.0.1-8080-8) Error retriving packages from guvnor: Invalid argument
So I discovered where jbpm_console looking for form templates and the place was – WEB-INF/lib/ on the deployed jbpm-gwt-console-server.war
* I created form template for my task – DemoHumanTask.ftl (DemoHumanTask – taskname in bpmn), process start form template – com.sample.demo.bpmn.ftl (com.sample.demo.bpmn is process id)
* make jar :
margusja@IRack:~/Downloads/jbpm-installer/jboss-as-7.1.1.Final/standalone/dev_war/dev_jar/margusja$ jar cvf MargusjademoProcess.jar .
added manifest
adding: com.sample.demo.bpmn.ftl(in = 317) (out= 212)(deflated 33%)
adding: DemoHumanTask.ftl(in = 1418) (out= 487)(deflated 65%)
* go back to the place where did you unpack your jbpm-gwt-console-server.war and copy created jar file to the right place:
cp ./dev_jar/margusja/MargusjademoProcess.jar ./WEB-INF/lib/
* update jbpm-gwt-console-server.war file
margusja@IRack:~/Downloads/jbpm-installer/jboss-as-7.1.1.Final/standalone/dev_war$ jar uvf jbpm-gwt-console-server.war WEB-INF/lib/MargusjademoProcess.jar
adding: WEB-INF/lib/MargusjademoProcess.jar(in = 7722) (out= 7396)(deflated 4%)
* copy updated war file to the jboss deployments directory
* restart jboss server (they say that jboss should handle on the fly new deployed wars but in my case I got errors)
* after restart I managed to see new forms generated from my form templates:
JBPM console – edit default form template (DefaultTask.ftl)
My first coal was create own form template to my process.
But I managed to change defaultTask template and demo process’ task (Performance Evaluation.ftl) template.
Make backup from original jbpm-gwt-console-server.war – otherwise if you mess up your war file you have to install all the jboss server again.
* copy jbpm-gwt-console-server.war somewhere you can play with it. in my example iI put it /Users/margusja/Downloads/jbpm-installer/jboss-as-7.1.1.Final/standalone/dev_war
* unpack your war – jar xvf jbpm-gwt-console-server.war
* You will find WEB-INF/lib/jbpm-gwt-form-5.4.0.Final.jar
* copy it somewhere where you can play with it – in my case I created a new directory : dev_jar and copied it there
* cd into your new directory and unpack jar – jar xvf jbpm-gwt-form-5.4.0.Final.jar
* You will find form templates like DefaultTask.ftl, Performance Evaluation.ftl and com.sample.evaluation.ftl
* modify them like you wish fish – Do not change Form action
* pack the stuff again to the jar:
margusja@IRack:~/Downloads/jbpm-installer/jboss-as-7.1.1.Final/standalone/dev_war/dev_jar/dev_jbpm-gwt-form$ jar cvf jbpm-gwt-form-5.4.0.Final.jar .
added manifest
adding: classlist.mf(in = 282) (out= 101)(deflated 64%)
adding: com.sample.evaluation.ftl(in = 346) (out= 231)(deflated 33%)
adding: DefaultTask.ftl(in = 281) (out= 197)(deflated 29%)
adding: FormBuilder.properties(in = 61) (out= 54)(deflated 11%)
ignoring entry META-INF/
ignoring entry META-INF/MANIFEST.MF
adding: META-INF/maven/(in = 0) (out= 0)(stored 0%)
adding: META-INF/maven/org.jbpm/(in = 0) (out= 0)(stored 0%)
adding: META-INF/maven/org.jbpm/jbpm-gwt-form/(in = 0) (out= 0)(stored 0%)
adding: META-INF/maven/org.jbpm/jbpm-gwt-form/pom.properties(in = 112) (out= 108)(deflated 3%)
adding: META-INF/maven/org.jbpm/jbpm-gwt-form/pom.xml(in = 1319) (out= 422)(deflated 68%)
adding: META-INF/services/(in = 0) (out= 0)(stored 0%)
adding: META-INF/services/org.jboss.bpm.console.server.plugin.FormDispatcherPlugin(in = 58) (out= 56)(deflated 3%)
adding: org/(in = 0) (out= 0)(stored 0%)
adding: org/jbpm/(in = 0) (out= 0)(stored 0%)
adding: org/jbpm/integration/(in = 0) (out= 0)(stored 0%)
adding: org/jbpm/integration/console/(in = 0) (out= 0)(stored 0%)
adding: org/jbpm/integration/console/forms/(in = 0) (out= 0)(stored 0%)
adding: org/jbpm/integration/console/forms/AbstractFormDispatcher$1.class(in = 1700) (out= 782)(deflated 54%)
adding: org/jbpm/integration/console/forms/AbstractFormDispatcher.class(in = 6061) (out= 2703)(deflated 55%)
adding: org/jbpm/integration/console/forms/ConfigurationUtils.class(in = 3788) (out= 1906)(deflated 49%)
adding: org/jbpm/integration/console/forms/FormDispatcherComposite$1.class(in = 982) (out= 527)(deflated 46%)
adding: org/jbpm/integration/console/forms/FormDispatcherComposite.class(in = 2073) (out= 872)(deflated 57%)
adding: org/jbpm/integration/console/forms/ProcessFormDispatcher.class(in = 1250) (out= 584)(deflated 53%)
adding: org/jbpm/integration/console/forms/TaskFormDispatcher.class(in = 4070) (out= 2002)(deflated 50%)
adding: Performance Evaluation.ftl(in = 1461) (out= 500)(deflated 65%)
* go back where did you unpacked your war file
* copy new jar file to the right place – cp ./dev_jar/dev_jbpm-gwt-form/jbpm-gwt-form-5.4.0.Final.jar ./WEB-INF/lib/jbpm-gwt-form-5.4.0.Final.jar
* update your original war – jar uvf jbpm-gwt-console-server.war WEB-INF/lib/jbpm-gwt-form-5.4.0.Final.jar
* put a updated war to jboss deployments/ directory – cp jbpm-gwt-console-server.war ../deployments/
In my case I restarted jboss and after it started up I logged to jbpm_console: http://localhost:8080/jbpm-console/ and opened user task I saw that my changes I made are deployed :
JBPM2 – deploy a new process into JBoss server
…
Create jar from your assets
Create war from jar (jar cvf name.war [jar file])
Put it into JBoss deployments directory
Into JBoss server log have to appear something like
16:34:43,931 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of “YOURWARNAME.war”
16:34:44,057 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /YOURPROCESS
16:34:44,086 INFO [org.jboss.as.server] (DeploymentScanner-threads – 1) JBAS018559: Deployed “YOURWARNAME.war”
Copy your bpmn file to the right place. Right place you can find from jbpm-installer build.xml ( -Djbpm.console.directory )
cat build.xml | grep “Djbpm.console.directory”
in my case cp ../../Documents/workspace/drools_process_hello_world/src/main/java/com/sample2/DemoProcess.bpmn ./sample/evaluation/src/main/resources/ – Tegelikult piisab protsessi alustamiseks JBPM serveris (GUI http://127.0.0.1:8080/jbpm-console) ainult bpmn faili kopeerimisest.
ant stop.demo
ant start.demo
login your jbpm-console/ and open Process Overview -> Refresh and you will (if all previous steps are correct) your new process.
Start it.
My process is very simpel. Only prints text to console.
…
Kui tegu on human taskiga, siis peaks saama protsessi käivitada ja jbpm-console peal nägema, et protsess käib.
Lisaks, kui task in/out actionisse on kirjutatud debug – System.out.println(“mingi debug infi”); siis peaks ka see olema näha jboss serveri logis.
Tõestuseks Varullale, et Margusja pampu ei häbene
temperatuurimõõtmise nurgake
Selenium RC headless server setup (CentOS 6)
# yum install xorg-x11-server-Xvfb.x86_64
# yum install firefox.x86_64
# Xvfb :99 -screen 0 800x600x16 (käivitame virtuaalse X’i)
# export DISPLAY=:99 (et RC teaks millist akent kasutada)
# java -jar selenium-server-standalone-2.28.0.jar (käivitame seleniumi teste serveeriva teenuse)
…
Edasi on juba testimine, näiteks:
[margusja@vm37 selenium_tests]$ python ./test.py
.
———————————————————————-
Ran 1 test in 8.501s
OK
[margusja@vm37 selenium_tests]$
Minu IT-alast kaks raamatut
Hackers – by Steven Levy
Mõned aastad tagasi sai antud teos läbi loetud. Lugesin seda oma mobiiltelefonis. Olin raamatust nii sisse võetud, et mind võis näha pea igal pool mobiiltelefoni vahtimas. Ka magama jäin seda teost lugedes.
Hackers annab väga hea ülevaate IT-maailma (vabatarkvara pooldavatest) tegelastest, raud- ja tarkvara kujunemisest. Kui ma näiteks ei oleks seda raamatut eelnevalt läbi lugenud, enne kui ma Steve Jobs’i eluloo kallale asusin, siis sorry Steve, sinu elulugu oleks väga palju mööda läinud. Nüüd, omades eelnevat väga põhjaliku tausta, oli hea siduda teatud sündmusi teistega.
Raamat on ka seetõttu huvitav, et temast õhkub just seda vabadust, mida, mulle tundub, et tollel ajal justkui rohkem oli. Samuti võib sellest raamatust tõelist häkkeriloomust kogeda. Kui oluline oli mälu ja arvuti aeg. Seda rohkem hinnati, kui mingi kavala nipiga õnnestus mingi koodijupp natukenegi optimaalsemalt toimima saada.
Meenutan oma IT-aja algust ja esimest arvutit Krista-2 (venelaste toodetud), siis oli see väga tänapäevane masin TX-0 ja PDP seeria masinatega võrreldes, mida selle raamatu kangelased kasutasid.
Huvitav oli ka suhtumine masina multitaskingusse – esialgu negatiivne. Täna seda enam ei tunneta, pigem on see huvitav.
Hämmastav oli MIT tegelastel võime paari ööga uue raua peale assembler portida. Täna tagasi vaadates võib mõelda, et omal ajal oli neil väga palju uut avastada ja seeläbi oma nimi IT-ajalukku maha kirjutada. Täna oleks seda raskem teha. Samas on see vale võrdlus, nii ei saa mõelda, aeg on teine. Ma usun, et täna on samasugune võimalus oma nime jäädvustada.
Meile IT-ärimaailmast tuntud tegelased nagu Bill Gates oma kuulsate kirjadega on kenasti esile toodud. Kindlasti jätab tema suhtumine antud raamatus negatiivse kuvandi. Steve Jobsi tegemisi kajastatakse väga vähe. Samas ei olnud ta ka väga väljapaistev raua- või tarkvaraspetsialist. Apple kambast kindlasti Steve Wozneak saab kenasti kajastatud ja õigustatult, kuna tegu oli ja on tänagi väga väljapaistva häkkerikultuuri esindajaga.
Igaljuhul IT-maailmas figureerivale inimesele, eriti veel, kui ta ennast mingilgi moel häkkeriks sooviks mõelda, kohustuslik kirjandus!
Teine raamat, mis ilmselt ei ole üheski IT-alases nõutud raamatute nimekirjas, on minule oluline raamat – “Selles mängus ei hüpata ” by Juhan Habicht (https://www.raamatukoi.ee/cgi-bin/raamat?keywords=14785&ost=14787)
Minu jaoks oli see vist isegi korralik tõuge IT-ala valikul.
Raamat on ajast, kus nõugogude aeg hakkas Eestis lõppema ja tegutsesid koperatiivid ja dressipükstes kantpead.
Arvutid olid uued asjad ja ühele logardist ehitusmehele, kes ehitamise asemel avastas, et ta jube kenasti saab hakkama arvutimängudega ja ka nendest sohiga (debuggeriga) otseteid leida oskas.
Tegelane jäi silma ühele maffiabossile, kes võistles teise maffiabossiga kosmoseseikluse nimelise mängu läbimängimises.
Sisu kunstilise külje pealt väga mõttetu, kuid arvestades antud ajajärku, kirjutada arvutitest (386) oli väga tegija masin selles raamatus, siis on minule väga muljetavaldav kirjandus.
Raamatu alguses mängitakse ka Larry-1 mängu, mille peale ma jala 25km käisin, et see mäng 7 floppiketta peal Raplast kopeerida 🙂