public class SimpleConfiguration
extends Object
integrationConfiguration.setProperties(
textProperty("name")
.label("Name")
.build(),
integerProperty("height")
.label("Height")
.build(),
integerProperty("age")
.label("Age")
.build(),
booleanProperty("requiresParentApproval")
.label("Requires Parent Approval")
.isReadOnly(true)
.build());
Integer age = integrationConfiguration.getValue("age");
if (age != null)
integrationConfiguration.setValue("requiresParentalApproval", age < 18);
Integer heightInInches = integrationConfiguration.getValue("height");
if (heightInInches != null && heightInInches < 60)
integrationConfiguration.setError("height", "You are not tall enough to ride.");
Supports:
setProperties(PropertyDescriptor...)
must be called per invocation of
SimpleConnectedSystemTemplate.getConfiguration(SimpleConfiguration, ExecutionContext)
and
SimpleIntegrationTemplate.getConfiguration(SimpleConfiguration, SimpleConfiguration, PropertyPath, ExecutionContext)
As designers provide values, the SimpleConfiguration can be dynamically updated to display additional configuration options, fill in dropdown choices, and set default values.
*Modifier and Type | Method and Description |
---|---|
static SimpleConfiguration |
from(ConfigurationDescriptor configDescriptor,
com.appian.connectedsystems.simplified.sdk.configuration.TypePropertyFactory typePropertyFactory,
ExecutionContext executionContext) |
List<PropertyDescriptor> |
getProperties()
Properties define how fields are displayed.
|
PropertyDescriptor |
getProperty(String key)
Properties define how fields are displayed.
|
<T> T |
getValue(PropertyPath propertyPath)
Gets a value stored anywhere in the configuration.
|
<T> T |
getValue(String key)
Gets a value stored in the configuration
All values inside the configuration can be null.
|
SimpleConfiguration |
setErrors(List<String> errors)
Set errors at the highest level of the configuration
Use this method to show invalid configurations in the connected system
or errors resulting from an invalid combination of multiple fields' configurations
|
SimpleConfiguration |
setErrors(PropertyPath propertyPath,
List<String> errors)
Sets an error anywhere in the configuration.
|
SimpleConfiguration |
setErrors(String key,
List<String> errors)
Sets an error in the configuration.
|
SimpleConfiguration |
setProperties(PropertyDescriptor... properties)
Defines the UI and data structure of the Appian object
integrationConfiguration.setProperties(
textProperty("name")
.label("Name")
.instructionText("Please enter your first and last name")
.build(),
integerProperty("height")
.label("Height")
.build(),
integerProperty("age")
.label("Age")
.build(),
booleanProperty("requiresParentApproval")
.label("Requires Parent Approval")
.description("If true, you need to ask your parents first!")
|
SimpleConfiguration |
setValue(PropertyPath propertyPath,
Object value)
Sets a value stored anywhere in the configuration.
|
SimpleConfiguration |
setValue(String key,
Object value)
Sets a value stored in the configuration.
|
ConfigurationDescriptor |
toConfiguration() |
public SimpleConfiguration setProperties(PropertyDescriptor... properties)
integrationConfiguration.setProperties( textProperty("name") .label("Name") .instructionText("Please enter your first and last name") .build(), integerProperty("height") .label("Height") .build(), integerProperty("age") .label("Age") .build(), booleanProperty("requiresParentApproval") .label("Requires Parent Approval") .description("If true, you need to ask your parents first!") .displayMode(BooleanDisplayMode.CHECKBOX) .isReadOnly(true) .build() )
This method must be called per invocation of SimpleConnectedSystemTemplate.getConfiguration(SimpleConfiguration, ExecutionContext)
and SimpleIntegrationTemplate.getConfiguration(SimpleConfiguration, SimpleConfiguration, PropertyPath, ExecutionContext)
Properties define how fields are displayed.
Each editable (non-read-only and non-hidden) property represents data the designer can configure.
Values can be modified using setValue(String, Object)
or retrieved using getValue(String)
.
All existing values are migrated to the new data structure based on the property keys. Newly added fields are set to default values defined by SystemType
.
properties
- fields to be displayed in the UIpublic List<PropertyDescriptor> getProperties()
Properties define how fields are displayed.
Each editable (non-read-only and non-hidden) property represents data the designer can configure.
Values can be modified using setValue(String, Object)
or retrieved using getValue(String)
.
public PropertyDescriptor getProperty(String key)
Properties define how fields are displayed.
Each editable (non-read-only and non-hidden) property represents data the designer can configure.
Values can be modified using setValue(String, Object)
or retrieved using getValue(String)
.
key
- property key uniquely identifying the property.public <T> T getValue(String key)
This value could be:
SystemType
setValue(String, Object)
key
- property key uniquely identifying the propertypublic <T> T getValue(PropertyPath propertyPath)
This value could be:
SystemType
setValue(String, Object)
Fetch the value of height inside local property "personType"
PropertyPath path = new PropertyPath("personType", "height"); Integer height = integrationConfiguration.getValue(path);
propertyPath
- list of property keys locating the propertypublic SimpleConfiguration setValue(String key, Object value)
key
- property key uniquely identifying the propertyvalue
- value to insert at the keythis
public SimpleConfiguration setValue(PropertyPath propertyPath, Object value)
PropertyPath path = new PropertyPath("personType", "height"); int heightInInches = 72; integrationConfiguration.setValue(path, heightInInches);
propertyPath
- list of property keys locating the propertyvalue
- value to insert at the keythis
public SimpleConfiguration setErrors(List<String> errors)
errors
- the errors to displaythis
public SimpleConfiguration setErrors(String key, List<String> errors)
key
- property key uniquely identifying the propertyerrors
- list of validationsthis
public SimpleConfiguration setErrors(PropertyPath propertyPath, List<String> errors)
propertyPath
- list of property keys locating the propertyerrors
- list of validationsthis
public ConfigurationDescriptor toConfiguration()
public static SimpleConfiguration from(ConfigurationDescriptor configDescriptor, com.appian.connectedsystems.simplified.sdk.configuration.TypePropertyFactory typePropertyFactory, ExecutionContext executionContext)
Copyright © 2018-present Appian Corporation. All Rights Reserved.