Resolution Class

Resolution of a resolution strategy, which conditionally invokes default domain logic, logic provided by an extension provider, or no logic.

Namespace

CommerceExtension

Example

public class TaxServiceExtensionResolverSample extends commercestoretax.TaxService implements CommerceExtension.ResolutionStrategy {
    public CommerceExtension.Resolution resolve() {
        // The Sample Extension Provider registered with developer name as 'tax_extension_provider_for_us' will be selected for execution for en_US locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_US') {
            return new CommerceExtension.Resolution('tax_extension_provider_for_us');
        }
        // The Sample Extension Provider registered with developer name as 'tax_extension_provider_for_canada' will be selected for execution for en_CA locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_CA') {
            return new CommerceExtension.Resolution('tax_extension_provider_for_canada');
        }
        // The default Salesforce Internal Tax Api will return an empty response for German locale
        if(CommerceExtension.ExtensionInfo.getLocaleString() == 'de') {
            return new CommerceExtension.Resolution(CommerceExtension.ResolutionStates.OFF);
        }
        // The default Salesforce Internal Tax Api will be selected for execution for all other locales than US, Canada and Germany
        return new CommerceExtension.Resolution();
    }
}

Resolution Constructors

The following are constructors for Resolution.

Resolution(resolutionState)

Constructor that takes a CommerceExtension.ResolutionStates object as an argument.

Signature

public Resolution(CommerceExtension.ResolutionStates resolutionState)

Parameters

resolutionState
Type: CommerceExtension.ResolutionStates
Resolution state.

Resolution(providerName)

Constructor that takes the name of an extension provider as an argument.

Signature

public Resolution(String providerName)

Parameters

providerName
Type: String
Name of the extension provider.

Resolution()

Default constructor for the Resolution class.

Signature

public Resolution()

Resolution Methods

The following are methods for Resolution.

getProviderName()

Returns the name of an extension provider.

Signature

public String getProviderName()

Return Value

Type: String

Name of an extension provider.

getResolutionState()

Returns the resolution state of the resolution.

Signature

public CommerceExtension.ResolutionStates getResolutionState()

Return Value

Type: CommerceExtension.ResolutionStates

Resolution state of the resolution.