A process scripting language that makes developers and business experts happier!

Tech Preview

Factscript is a process scripting language designed to make developers and business experts happier. It is currently implemented in pure Kotlin for the Java platform and available as a Tech Preview. Factscript is an "internal" domain specific language specialized to express non-atomic, multi-step business or software processes directly as code. Factscript allows to define the process flow in a type-safe manner and include all data aspects needed to control the flow. The scripts can be automatically rendered as standardized visual diagrams "on the fly" and are directly executable, e.g. with a workflow engine.

Factscript is a process scripting language designed to make developers and business experts happier. It is currently implemented in pure Kotlin for the Java platform and available as a Tech Preview. Factscript is an "internal" domain specific language specialized to express non-atomic, multi-step business or software processes directly as code. Factscript allows to define the process flow in a type-safe manner and include all data aspects needed to control the flow. The scripts can be automatically rendered as standardized visual diagrams "on the fly" and are directly executable, e.g. with a workflow engine.

Code - Visualize - Execute

 
 
 
 
 

Code a Factscript

This Factscript contains all the important process and data handling logic needed to execute it. There is just a little bit more wiring needed, as you will e.g. need to code the message classes used in the script (like e.g. the command class 'FulfillOrder', in Kotlin a one-line data class).
 
 
 
 
 

Render a Factscript diagram

Let’s walk through this automatically rendered, ISO standardized BPMN diagram together: whenever a 'Fulfill order' command is received, the fulfillment is confirmed by emitting an 'Order fulfillment started' event. After this, two commands ('Fetch goods from inventory' and 'Retrieve payment') are issued in parallel and it is waited whether their execution succeeds or not. In case a 'Payment failed' failure event is observed, the fulfillment would be rolled back with a command 'Return goods to inventory' and finished unsuccessfully by emitting a final 'Order not fulfilled' event. But in case both commands ('Fetch goods from inventory' and 'Retrieve payment') succeed, an 'Order ready to be shipped' event is emitted and a last command 'Ship goods' is issued and it is waited until it is executed. Once this succeeds the process is finished successfully by emitting a final 'Order fulfilled' event.
 
 
 
 
 

Execute a Factscript

A Factscript defines the lifecycle of a participant (process entity) 'Fulfillment', which will over time walk through a series of incoming and outgoing messages:

'2020-12-01 09:45:17' incoming 'FulfillOrder' command -> observed by [new] 'Fulfillment' participant [123]
'2020-12-01 09:45:17' outgoing 'FulfillmentOrderPlaced' event <- produced by 'Fulfillment' participant [123]
'2020-12-01 09:45:17' outgoing 'FetchGoods' command <- produced by 'Fulfillment' participant [123]
'2020-12-01 09:45:17' outgoing 'RetrievePayment' command <- produced by 'Fulfillment' participant [123]
'2020-12-01 09:46:01' incoming 'PaymentRetrieved' event -> observed by 'Fulfillment' participant [123]
'2020-12-01 12:15:03' incoming 'GoodsFetched' event -> observed by 'Fulfillment' participant [123]
'2020-12-01 12:15:03' outgoing 'OrderReadyToBeShipped' event <- produced by 'Fulfillment' participant [123]
'2020-12-01 12:15:03' outgoing 'ShipParcel' command <- produced by 'Fulfillment' participant [123]
'2020-12-02 17:39:20' incoming 'ParcelShipped' event -> observed by 'Fulfillment' participant [123]
'2020-12-02 17:39:20' outgoing 'OrderFulfilled' event <- produced by 'Fulfillment' participant [123]

By the way: the underlying principle of treating all incoming and outgoing messages as facts of a participant’s subjective history is what gave Factscript its name.

The concept and design of Factscript as well as its implementation in Kotlin is done by Martin Schimak, plexiti GmbH.


Factscript and its scientific environment is analyzed and described by Maxim Vidgof, Philipp Waibel and Jan Mendling, WU.


Factscript execution environments are extended and supported by Alex Seik and Peter Queteschiner, PHACTUM GmbH.

Publications

A Code-efficient Process Scripting Language

Business process management systems are an important piece of infrastructure for digital transformation initiatives. Rapid development of executable business processes is a key requirement in this context. Even though there are various process modeling languages available, none of them is designed with the ambition to be code efficient and expressive at the same time. In this paper, we investigated the research question how a process scripting language can be defined that addresses the four requirements of code efficiency, control flow expressiveness, data processing and event processing. To this end, we designed and implemented a process scripting language based on Kotlin. To analyze the language regarding the four requirements, we use the language in a case study of a real-world process of our industry partner.

A Process Scripting and Execution Environment

Many companies rely on business process management systems and business processes for their digital transformation initiatives. Despite the variety of business process modeling languages, there is a gap between having an executable modeling language with data processing support and powerful abstractions for development. To overcome this gap, we developed a process scripting language called Flow Language. In this paper, we present the language environment that provides the means to script processes in the Flow Language, to deploy them in an external process execution engine, and to execute the processes.

Get in Touch