Goto is not Evil

Those of you who tried to convert BPMN to BPEL know the “Goto”-Problem which stems from the fact that BPMN is graph oriented while BPEL is block oriented.
This makes it hard to transform one into the other and causes pain in todays BPMN undertakings.
Although goto is banned in modern programming languages, business-like modeling languages definitely need it.
The upcoming version of Windows Workflow Foundation with its Flowchart support gives a good example how this could look like.
In his blog Maurice De Beijer has a nice image how this looks like in the Visual Studio.NET Workflow Designer.

Dehydrating long running Groovy DSLs

In my recent article about Domain Specific Languages (DSLs) published in the 12/2009 issue of Javamagazin I described how to implement DSLs using Groovy.
In the article I mentioned that dehydration (state persistence) could be added to the DSL runtime if needed to support long running processes.
I’ve created a Groovy script dehydration.groovy to illustrate how this could be achieved.
Basically the Groovy script is stopped by terminating the executing thread and the state is pulled out.
Later on the state is injected and the remaining part of the script is executed.
This approach can be used to process any kind of long running scripts, especially if they have to wait for external events.