Skip to content

Commit

Permalink
Merge pull request #426 from holunda-io/feature/add_kotlin_docs
Browse files Browse the repository at this point in the history
Add docs for kotlin usage #394
  • Loading branch information
p-wunderlich authored Feb 19, 2024
2 parents a687c20 + be38ae1 commit fe322b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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

0 comments on commit fe322b3

Please sign in to comment.