Üks pilt minu harilikust igapäevasest töömasinast
If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time
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:
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 :
…
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.
Asümeetriline:
1. Loo võtmepaar
openssl genrsa -out private.pem 1024
openssl rsa -in private.pem -out public.pem -outform PEM -pubout
2. Jaga oma avaliku võtit partneriga
3. Partner krüpteerib avaliku võtmega
openssl rsautl -encrypt -inkey public.pem -pubin -in file.txt -out file.ssl
4. Ava salajase võtmega
openssl rsautl -decrypt -inkey private.pem -in file.ssl -out decrypted.txt
Sümeetriline:
Krüpteerimine
openssl aes-256-cbc -salt -a -e -in saladus.txt -out encrypted.txt
enter aes-256-cbc encryption password:
Verifying – enter aes-256-cbc encryption password:
Dešifreerimiseks:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
enter aes-256-cbc decryption password:
Signeerimine:
Allkirjastame
openssl rsautl -sign -in saladus.txt -out saladus.signed -inkey private.pem
Partner saab kontrollida
openssl rsautl -verify -in saladus.signed -out saladus.verified -pubin -inkey public.pem
Räsi genereerimiseks on tänaseks MD5 saatanast 128b on ilmselgelt liialt vähe.
> openssl sha1 saladus.txt
või
> shasum -a 256 saladus.txt
Order deny,allow
Deny from all
AuthType Basic
AuthUserFile /www/.site_htpasswd
AuthName "Protected Area"
require valid-user
Allow from 1.2.3.4 2.3.4.5
Satisfy Any
[16:55:57 root@xen1 ~ :/root]# mdadm --detail /dev/md2
/dev/md2:
Version : 0.90
Creation Time : Wed Apr 13 13:26:33 2011
Raid Level : raid1
Array Size : 9213120 (8.79 GiB 9.43 GB)
Used Dev Size : 9213120 (8.79 GiB 9.43 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Tue Mar 6 16:55:41 2012
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 1
Spare Devices : 0
UUID : c19b28c1:ecbdf4f8:1a597600:a2292b4d
Events : 0.55948
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 0 0 1 removed
2 8 17 - faulty spare /dev/sdb1
[16:56:01 root@xen1 ~ :/root]# mdadm --remove /dev/md2 /dev/sdb1
mdadm: hot removed /dev/sdb1
[16:56:37 root@xen1 ~ :/root]# mdadm --detail /dev/md2
/dev/md2:
Version : 0.90
Creation Time : Wed Apr 13 13:26:33 2011
Raid Level : raid1
Array Size : 9213120 (8.79 GiB 9.43 GB)
Used Dev Size : 9213120 (8.79 GiB 9.43 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Tue Mar 6 16:56:37 2012
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
UUID : c19b28c1:ecbdf4f8:1a597600:a2292b4d
Events : 0.55948
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 0 0 1 removed
[16:56:40 root@xen1 ~ :/root]# mdadm --add /dev/md2 /dev/sdb1
mdadm: re-added /dev/sdb1
[16:57:08 root@xen1 ~ :/root]# mdadm --detail /dev/md2
/dev/md2:
Version : 0.90
Creation Time : Wed Apr 13 13:26:33 2011
Raid Level : raid1
Array Size : 9213120 (8.79 GiB 9.43 GB)
Used Dev Size : 9213120 (8.79 GiB 9.43 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Tue Mar 6 16:57:06 2012
State : clean, degraded, recovering
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1
Rebuild Status : 2% complete
UUID : c19b28c1:ecbdf4f8:1a597600:a2292b4d
Events : 0.55948
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 spare rebuilding /dev/sdb1