jython in workflow and rules engines
DESCRIPTION
TRANSCRIPT
![Page 1: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/1.jpg)
1
--a powerful scripting language for workflow and rules engines
Václav TunkaSoftware engineer, JBoss by Red HatTwitter: @vtunka
@naPyVo28.2.2013
Jython
![Page 2: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/2.jpg)
Is JVM an unusual place?
![Page 3: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/3.jpg)
3
Why Jython?
No Global Interpreter Lock => true parallelism and concurrency.
![Page 4: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/4.jpg)
4
Why Jython?
![Page 5: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/5.jpg)
Why Jython?
• Usage of the best Garbage Collectors including several concurrent GCs.
• Native access to Java API.
• Access to Java Concurrency libraries with support for concurrent collections.
• Polyglot JVM – use the best tools for the job eg. Clojure for functional programming, Jython for scripting, etc.
![Page 6: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/6.jpg)
Monitoring and profiling
• VisualVM, jprofiler, NetBeans, and other JVM tools enabling:– CPU, memory and thread monitoring.– Heap analysis,– Etc.
• Need to have minimal memory consumption in Cloud -> JVM tools might help.
![Page 7: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/7.jpg)
![Page 8: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/8.jpg)
Long time ago, in a galaxy..
• I used to work as a core developer on unnamed “dark-side” closed source platform:– ITIL compatible ERP platform with support
for workflow and rules engine.– Written in Java, Jython used as scripting
language for the workflow and rules engine.
– Nice data integration solution.
![Page 9: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/9.jpg)
Workflow engines
• Similar to state machines: defined states, transition rules, inputs & outputs etc.
• Standardization process in place, mainly BPMN standard in 2.0 release.
• Can be used for easy creation of Information systems & UI dialogs based on simple process definition.
![Page 10: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/10.jpg)
Jython in Worfklow engines
• Used to script custom tasks mainly because:– Python is easily readable,– Forces users to format their code properly,– Dynamic typing & better scripting
capabilities than Java,– Runs on multiple platforms inside JVM.
![Page 11: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/11.jpg)
Rules engines
• Provide a declarative way to solve various repeating rule based tasks including NP problems, eg. Travelling salesman.
• You declaratively define rules, for example in Jython.
• The rules engine provides the resolution for you automatically.
![Page 12: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/12.jpg)
12
Questions?
![Page 13: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/13.jpg)
13
![Page 14: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/14.jpg)
On unrelated note - Project Odd
• Project by Red Hat that aims to support dynamic languages running on JBoss Application Server for better asynchronous programming & concurrency support etc..
• Provides native API for dynamic languages.
• Currently: TorqueBox for Ruby, Dyn.JS for Javascript, Immutant for Closure.
![Page 15: Jython in workflow and rules engines](https://reader034.vdocuments.net/reader034/viewer/2022051610/548c4a2db479590d2b8b47ac/html5/thumbnails/15.jpg)
Image References
• Slide 7 image Courtesy of project presentations
• Jython logo – slide 2: jython.org
• PyVo community logo, courtesy of python.cz
• Lock image from slide 3
• Python image from slide 1 Courtesy of Michael Cvet