1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

docs(variants): conflicting overrides; rm usage

This commit is contained in:
Thomas Heartman 2021-12-08 10:08:35 +01:00
parent b5b8c5eb2d
commit a761bf2cc7

View File

@ -58,15 +58,19 @@ For instance, if you have three variable weight variants and two fixed weight va
#### Overrides #### Overrides
:::note
Overrides are intended to be used for one-off exceptions during development and may not be suitable for other use cases.
:::
The weighting system automatically assigns users to a specific group for you. If you want to make sure that a specific user or group of users receives a certain variant, though, you can use the override functionality to achieve that. The weighting system automatically assigns users to a specific group for you. If you want to make sure that a specific user or group of users receives a certain variant, though, you can use the override functionality to achieve that.
When adding an override, you choose a [field from the Unleash Context](../user_guide/unleash_context) and specify that if a context contains one of a given list of values, then the current variant should always activate. When adding an override, you choose a [field from the Unleash Context](../user_guide/unleash_context) and specify that if a context contains one of a given list of values, then the current variant should always activate.
You can use both standard and custom context fields when creating overrides. You can use both standard and custom context fields when creating overrides.
Each variant can have multiple overrides, so you can use any number of context fields you want to group people. Each variant can have multiple overrides, so you can use any number of context fields you want to create overrides.
If two variants have the same override, then ... Note that if multiple variants use overrides that affect the same user, then Unleash can not guarantee which override will take effect. We recommend that you do not use multiple overrides that can conflict in this way, as it will probably not do what you expect.
### Variant payload ### Variant payload
@ -104,17 +108,6 @@ This is a fallback variant that Unleash uses to represent the lack of a variant.
Note: The actual representation of the built-in fallback variant in the client SDK will vary slightly, to honor best practices in various languages. Note: The actual representation of the built-in fallback variant in the client SDK will vary slightly, to honor best practices in various languages.
## Usage example
The exact usage will vary depending on your SDK, so make sure to consult its documentation, but a simple use case would usually look a little something like this:
_Java SDK example:_
```java
Variant variant = unleash.getVariant("toggle.name", unleashContext);
System.out.println(variant.getName());
```
## Client SDK Support {#client-sdk-support} ## Client SDK Support {#client-sdk-support}
To make use of toggle variants, you need to use a compatible client. Client SDK with variant support: To make use of toggle variants, you need to use a compatible client. Client SDK with variant support: