From be38ae1cd4011bbbca31d27d6d27679518a8d6d1 Mon Sep 17 00:00:00 2001 From: Patrick Schalk Date: Fri, 16 Feb 2024 13:29:51 +0100 Subject: [PATCH] Add docs for kotlin usage #394 --- README.md | 5 +++++ docs/user-guide/examples-kotlin.md | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index cc88ac42..bd9583ce 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,11 @@ public class ApproveOrderTaskControllerTest { } ``` +### Kotlin + +If you use kotlin, there is an own collection of factory methods by simple using `CamundaBpmDataKotlin` instead of `CamundaBpmData`. +For usage examples, see here: [Examples Kotlin](https://www.holunda.io/camunda-bpm-data/snapshot/user-guide/examples-kotlin.html) + ### Further documentation For further details, please consult our [Quick Start](https://www.holunda.io/camunda-bpm-data/snapshot/quick-start) diff --git a/docs/user-guide/examples-kotlin.md b/docs/user-guide/examples-kotlin.md index 8bf493cd..582754d9 100644 --- a/docs/user-guide/examples-kotlin.md +++ b/docs/user-guide/examples-kotlin.md @@ -15,6 +15,23 @@ object Variables { } ``` +### Define nonNull variable + +**IMPORTANT:** Since 1.5.0 all predefined variable types are nullable by default. (For more information, see here: [Github Issue](https://github.com/holunda-io/camunda-bpm-data/issues/394)) +If you want to define a variable to be non-null-able, please call nonNull on variable factory as shown in the example below. + +``` kotlin + +import io.holunda.data.CamundaBpmDataKotlin + +object Variables { + val ORDER_ID: VariableFactory = stringVariable("orderId").nonNull + val CUSTOMER_ID: VariableFactory = stringVariable("orderId") +} +``` + +## + ## Read variable from Java delegate ``` kotlin