About Configured Resources

Configured resources are resources that, depending on the context, enable an app to behave differently based on configuration options.

Using EKL with configured resources lets you:

  • Activate a Configured Resource mode that takes the input of a Product Configuration, a Product Revision, or a Persistent Filter.
  • In Configured Resources mode, access a resource according to the Product Configuration or Revision previously provided.
Note: You can use configured resources mode with:
  • The AccessResource, ManageInstance, InstantiateTemplate and CreateSheet, ManageInstance, CreateOrModifyTemplate, CreateXMLDocument functions.
  • Operations using resource paths that allow you to compose commands in Know-how Apps Components: Knowledge Certify, Instantiate Template and Instantiate Engineering Template.
  • Knowledge Relation and Web Dialog operations in Know-how Apps Components
  • The Create Action command in the Know-how Apps User Experience.

The procedure described below is based on the AccessResource function. It is broken down into 4 steps.

This page discusses:

See Also
Functions Taking Resources in Input

Retrieve a Configuration (Product Configuration or a Product Revision)

To retrieve a configuration, call the following EKL methods:

// Create a query to retrieve the product configuration
let query (PLMQuery)
query = CreatePLMQuery("Product Configuration")
query->AddCriterion("name", "configName")

// Run the query
let queryResultsList (List)
queryResultsList = query->RunQuery()

// Get the product configuration
let prodConf (`Product Configuration`)
let myQueryResult(PLMQueryResult)
if queryResultsList->Size() == 1
{
	myQueryResult = queryResultsList[1]
	set prodConf = myQueryResult->LoadResult(TRUE)
}

Activate the Configured Resource Mode

To activate the Product Configuration for future calls to AccessResource, enter:

// Activate Configured Resources
ActivateConfiguredResources(prodConf)

Call the Existing AccessResource Method to Retrieve the Required Resource

To specify a resource in a basic context (without a Product Configuration or a Product Revision), enter a path as the first argument of the AccessResource method.

Deactivate the Configured Resource Mode When not Needed

To deactivate the current Product Configuration when next calling AccessResource call, enter:

// deactivate product configuration if not needed anymore
DeactivateConfiguredResources()

Activating and deactivating a product configuration works as a stack. As a result, when you call the AccessResource method, the last activated product configuration is used. If there is no product configuration in the stack, the root container is not filtered and the first resource that matches the provided name is returned, if any.

ActivateConfiguredResources(prodConf1)
AccessResource("... > ...", "VPMReference") // prodConf1 is used to filter
AccessResource("... > ...", "VPMReference") // prodConf1 is used to filter
               ActivateConfiguredResources(prodConf2)
               AccessResource("… > …", "VPMReference") // prodConf2 is used to filter
               DeactivateConfiguredResources()
AccessResource("... > ...", "VPMReference") // prodConf1 is used to filter
DeactivateConfiguredResources()