Knowledge Base - API

UpdateConfiguration

Method

UpdateConfiguration(UpdateConfigParameters parameters)

This method updates the configuration by applying a series of changes to the configuration (i.e. adding options, removing options, setting property values). The changes will be applied to the configuration in the order they are provided.

By default, each change is applied consecutively and an implicit update and recalculation is performed between each one. In previous versions, this update would not occur between each change. If the IndividualizeChanges property of the UpdateConfigParameters is set to False, each change is applied in succession without the recalculation. This may enable higher performance by reducing the overall number of operations against the configuration, but be aware that this may cause some issues; for instance, the configurator may reject adding a selection to the configuration because it was originally excluded and is not yet available because the configuration has not yet been updated.

 

For example, suppose your configuration has two options: OPT1 and OPT2 and OPT2 is excluded. Adding OPT1 will allow OPT2. If your set of changes adds both OPT1 and OPT2, the configurator would reject the adding of OPT2. Despite having added OPT1 to satisfy the rule, the configuration has not recalculated. For this purpose, a ApplyUpdatesChange type is defined to allow you to selectively “insert” a recalculation at strategic points in your list of changes. See below for details.

 

var parameters = newUpdateConfigParameters() {
    Changes = new ConfigChange() {
        SelectionChange.Add("OPT1"),
        new ApplyUpdatesChange(),
        SelectionChange.Add("OPT2"),
    }
};
 
var result = client.UpdateConfiguraiton (parameters);

Additionally, the UpdateConfigParameters object supports an IndividualizeChanges property. When true (which is the default when using the Contracts DLL), the system will implicitly insert am ApplyUpdatesChange between each change provided. This will ensure that the configuration is updated between each operation.

Parameters

The UpdateConfiguration method requires a parameters parameter of type UpdateConfigParameters.

UpdateConfigParameters

An instance of UpdateConfigParameters is passed into the UpdateConfiguration method. It contains contextual information necessary information for making changes to a configuration.

Constructors

UpdateConfigParameters()

UpdateConfigParameters(ConfigChange change)

UpdateConfigParameters(ConfigChange[] changes)

UpdateConfigParameters(ConfigChange[] changes, bool individualizeChanges)

Properties

Data Type

Property

Description

ConfigChange[]

Changes

Returns or sets a set of changes to apply to the configuration

ConfigContextProperty[]

ContextProperties

Returns or sets the context properties (Inbound Properties) passed into the configurator to be evaluated during initialization.

bool

IndividualizeChanges

If true, an implied instance of UpdateConfigurationChange is executed between each change and the configuration will be updated and recalculated between each change.

If false, the configuration will not be updated between changes, improving performance but potentially introducing problems with rules logic.

AutoUpdateConfigurationType

AutoUpdateConfiguration

Returns or sets whether the configuration should be automatically evaluated, executing rules and applying them when the configuration is replaced.

 

Valid values include:

  • None

  • All

Inheritance

ConfigParameters

The ConfigParameters class represents contextual information needed by the integration libraries for the Web Configurator Service.

Constructors

ConfigParameters()

ConfigParameters(ConfigHeader header)

Properties

Data Type

Property

Description

ConfigHeader

Header

Returns or sets the header (type and id) of the record in the host system being configured.

Inheritance

ParametersBase

The ParametersBase class is the base class for the parameters types that are passed in to various methods on the service. All parameters-derived types have the parameters listed below.

Properties

Data Type

Property

Description

bool

OmitConfigurationXmlFromResult

Returns or sets whether or not the configuration xml should be omitted from the result object.

In general, the various methods that interact with the service will cause the configuration XML to be returned to the caller each time. It can be bandwidth and processing intensive to recreate the XML for each call. By setting this property to True, those steps will be skipped resulting in less data being transmitted and less server-side processing.

OperationsBehaviors

OperationBehaviors

This property is used to provide additional contextual behaviors to the service call. Provide an instance of the OperationBehaviors class with properties set to identify whether the configuration should be saved (via the Stateless services) or whether a StateGraph should be returned with the result of the web service call.

DiagnosticOutput

DiagnosticOutput

Specifies the type of diagnostic information that should be returned as a result of the service call.

Available values include:

  • None

  • RulesExecuted

  • RulesMessages

  • RulesChanges

This provides access to the rules that were executed along with their associated messages and changes. If set to a value other than None, the DiagnosticData property of the various Result objects will be populated.

bool

ValidateRequiredProperties

Returns or sets a value indicating whether the configuration should be validated for required Property values. The default value is true.

Returns

UpdateConfigurationResult

An instance of UpdateConfigurationResult is returned by the Undo method. It does not contain any unique properties.

Inheritance

ConfigurationResult

The returned ConfigurationResult object contains general information about the configuration. It is a base class inherited many of the "result" objects, such as SaveConfigurationResult or CreateConfigurationResult.

Properties

Data Type

Property

Description

ConfigHeader

Header

Returns or sets the Config Header (ID + entity type).

ConfigurationResultCode

ResultCode

 

Possible Values:

  • Success

  • Failure

Returns or sets whether the operation was successful and without errors.

ConfigurationResultMessage[]

ResultMessages

Returns or sets resulting messages from the configuration action.

ConfigurationFailureCode

FailureCode

 

Possible Values:

  • None

  • SiteUnderMaintenance

  • CompatEngineNotInitialized

  • ServiceDisabled

  • InvalidArgument

  • InvalidOperation

In the event the ResultCode is Failure, returns a code identifying the type of failure

int

LineItemId

Returns or sets the line item id of the configuration. This is valid when the ConfigResult instance is a result of the IWebConfig.SaveConfiguration() or the IWebConfig.FixConfiguration() methods, otherwise the value is -1.

Configuration

Configuration

Returns or sets a Configuration object containing various properties relating to the current configuration. This will only ever be assigned if the Configuration is relevant to the operation that was executed.

ConfigurationStateGraphBase

StateGraph

Returns or sets a StateGraph object containing various properties relating to the current configuration. This will only ever be assigned if the ConfigParameters.OperationBehaviors.StateGraphParameters property is provided on the request.

DiagnosticData

DiagnosticData

Returns the DiagnosticData associated with the operation. This will only ever be assigned if theConfigParameters.DiagnosticOutput property is provided on the request.

SessionContext

SessionContext

Returns a SessionContext object containing server-side properties that pertain to the current configuration session.