Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for kotlin usage #394 #426

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions docs/user-guide/examples-kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = stringVariable("orderId").nonNull
val CUSTOMER_ID: VariableFactory<String?> = stringVariable("orderId")
}
```

##

## Read variable from Java delegate

``` kotlin
Expand Down
Loading