BPMN DSL

This DSL will bring your domain into your BPMN-Process.

Its elements are more or less constructors with the same structure:

BPMN_ELEMENT(
  id: String,
  in: Input,
  out: Output,
  descr: Optable[String]
)

So each BPMN Element has:

Here is an example:

process(
  id = InvoiceReceiptPIdent,
  descr = "This starts the Invoice Receipt Process.",
  in = InvoiceReceipt(),
  out = InvoiceReceiptCheck() // just for testing
)

The element is a process with its inputs and outputs. As we also want to test its execution, we defined also an output, also the process does not have one.

If your element has no Input and/or Output, just leave it empty, as this is the default case.

process(
  id = MyDoItItselfProcess
)

We only support elements you can interact with. The next subchapters describe them with an example.

Process

We already showed a process example above. Here the sub process Review Invoice:

process(
  id = "example-invoice-c7-review",
  descr = "This starts the Review Invoice Process.",
  in = InvoiceReceipt(),
  out = InvoiceReviewed()
)

Business Rule Tasks (Decision DMNs)

We support only Decision DMNs. The input is always a domain object (each field must be a simple value that matches a column of the dmn). As simple values we support:

A domain object is a case class as described in the Specification, with the exception, that each field must be a simple value that matches a column of the dmn.

Inputs are always domain objects.

In the DSL we have an element for each of the four different return types - so you don't mix up the types 😊.

singleEntry

This is a single result with one simple value.

singleEntry(
    decisionDefinitionKey = "singleEntry",
    in = Input("A"),
    out = 1
  )

singleResult

This is a single result with more than one value (domain object).

singleResult(
    decisionDefinitionKey = "singleResult",
    in = Input("A"),
    out = ManyOutResult(1, "🤩")
)

collectEntries

This is a list of simple values.

collectEntries(
    decisionDefinitionKey = "collectEntries",
    in = Input("A"),
    out = Seq(1, 2)
  )

resultList

This is a list of domain objects.

resultList(
    decisionDefinitionKey = "resultList",
    in = Input("A"),
    out = List(ManyOutResult(1, "🤩"), ManyOutResult(2, "😂"))
  )

User Task

A User Task describes its form values that it offers and the values it must be completed with.

userTask(
    id = "ApproveInvoiceUT",
    descr = "Approve the invoice (or not).",
    in = InvoiceReceipt(),
    out = ApproveInvoice()
  )

Receive Message Event

A Receive Message Event represents a catching message event. The input defines the message you expect. This works only as intermediate event. As we don't support throwing Message events we can simplify this to messageEvent:

lazy val messageExample = messageEvent(
  "message-for-example",
  in = MessageExampleIn(),
)

Receive Signal Event

A Receive Signal Event represents a catching signal event. The input defines the signal you expect. This works only as intermediate event. As we don't support Throwing Signal events we can simplify this to signalEvent:

lazy val signalExample = signalEvent(
  "signal-for-example",
  in = SignalExampleIn(),
)

Timer Event

A Timer Event represents a timer event. There is no input needed, you can use it to describe the timers in your API doc, or using them in the Simulations to execute the job of the timer immediately. This works only as intermediate event.

lazy val timerExample = timerEvent(
  "timer-for-example",
)