SlideShare a Scribd company logo
@naPyVo
                                                   28.2.2013




Jython
--a powerful scripting language
for workflow and rules engines
                     Václav Tunka
                     Software engineer, JBoss by Red Hat
                     Twitter: @vtunka

                                                           1
Is JVM an unusual place?
Why Jython?




       No Global
       Interpreter Lock =>
       true parallelism and
       concurrency.
                          3
Why Jython?




              4
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.
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.
Jython in workflow and rules engines
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.
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.
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.
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.
Questions?




             12
13
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.
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

More Related Content

PDF
High-Performance Computing with C++
PDF
Fintech and Data Protection by Balint Halasz and Zoltan Tarjan 25 10 2016
PDF
What's all the data about? - Linking and Profiling of Linked Datasets
PDF
Big Data Profiling
PPTX
Spark Summit Keynote by Suren Nathan
PDF
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
ODP
Django on Jython, PyCon 2009
PDF
Northwest Python Day 2009
High-Performance Computing with C++
Fintech and Data Protection by Balint Halasz and Zoltan Tarjan 25 10 2016
What's all the data about? - Linking and Profiling of Linked Datasets
Big Data Profiling
Spark Summit Keynote by Suren Nathan
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Django on Jython, PyCon 2009
Northwest Python Day 2009

Similar to Jython in workflow and rules engines (20)

PDF
A Quick Tour of JVM Languages
PPTX
Jython for Embedded Software Validation
PDF
Jython: Integrating Python and Java
PDF
Ola Bini Evolving The Java Platform
PPT
Mixing Python and Java
PPT
Communication between Java and Python
PDF
Exploiting Concurrency with Dynamic Languages
ODP
Django On Jython (for Portland and Boulder Python user groups presentations)
PDF
Java: Rumours of my demise are greatly exaggerated
PDF
Building Languages for the JVM - StarTechConf 2011
PDF
Why don't you Groovy?
PDF
Python Django Intro V0.1
PPT
BP203 limitless languages
PDF
Jax keynote
PPTX
GOTO Night with Charles Nutter Slides
PDF
10 Reasons Why Java Now Rocks More Than Ever
PDF
Beyond JVM - YOW Melbourne 2013
PDF
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
DOC
Resume_YanyanYu
PPTX
MWLUG - Universal Java
A Quick Tour of JVM Languages
Jython for Embedded Software Validation
Jython: Integrating Python and Java
Ola Bini Evolving The Java Platform
Mixing Python and Java
Communication between Java and Python
Exploiting Concurrency with Dynamic Languages
Django On Jython (for Portland and Boulder Python user groups presentations)
Java: Rumours of my demise are greatly exaggerated
Building Languages for the JVM - StarTechConf 2011
Why don't you Groovy?
Python Django Intro V0.1
BP203 limitless languages
Jax keynote
GOTO Night with Charles Nutter Slides
10 Reasons Why Java Now Rocks More Than Ever
Beyond JVM - YOW Melbourne 2013
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
Resume_YanyanYu
MWLUG - Universal Java
Ad

Jython in workflow and rules engines

  • 1. @naPyVo 28.2.2013 Jython --a powerful scripting language for workflow and rules engines Václav Tunka Software engineer, JBoss by Red Hat Twitter: @vtunka 1
  • 2. Is JVM an unusual place?
  • 3. Why Jython? No Global Interpreter Lock => true parallelism and concurrency. 3
  • 5. 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.
  • 6. 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.
  • 8. 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.
  • 9. 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.
  • 10. 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.
  • 11. 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.
  • 13. 13
  • 14. 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.
  • 15. 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