CompanionCompanion
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
  • Companion for Integration

    • Introduction
    • Getting Started
    • Configuration
    • Excel templating
    • How it works
  • YAML Configuration

    • Principles
    • Syntax
    • Validation
  • Custom Functions

    • Summary
    • arrayToJSON
    • bool
    • concatValueAndUnit
    • convertUnit
    • currentContextId
    • exportTime
    • eval
    • firstNonEmpty
    • getContextName
    • getEvents
    • getLastEventTime
    • getReferencesByAttributeGroup
    • getStoredValue
    • getWorkspaceId
    • hash
    • hasStoreKey
    • if
    • integer
    • join
    • mergeInheritedValues
    • multiValuesToJSON
    • number
    • nodeList
    • order
    • resolveUnitLabel
    • serializeAssetPushLocationsToJSON
    • serializeAttributeLinksToJSON
    • serializeContextReferenceToJSON
    • serializeContextReferencesToJSON
    • serializeContextValuesToJSON
    • serializeDataContainerToJSON
    • serializeDataContainersToJSON
    • serializeListOfValueValuesToJSON
    • serializeReferencesToJSON
    • serializeReferenceToJSON
    • serializeValuesToJSON
    • store
    • toXML
    • uppercase
  • Execution

    • Summary
    • Composite
    • From STEP
    • Standalone
    • Performance statistics
  • Configuration

    • ActiveMQ extension
    • Amazon AWS extension (SNS, SQS, Kinesis, S3)
    • ElasticSearch/OpenSearch extension
    • File extension (Excel, CSV, JSON, XML, JSONL, XMLL)
    • Kafka extension
    • Kafka Core extension
    • MongoDB/Cosmos DB extension
    • SQL extension
    • REST extension
    • Google Pub/Sub extension
  • c4i SaaS

    • Introduction
    • Managing jobs
    • Managing executions
    • Managing users
    • Changelog
  • Changelog

    • Core features changelog
    • ActiveMQ extension changelog
    • Amazon AWS extension changelog
    • Composite extension changelog
    • ElasticSearch extension changelog
    • File extension changelog
    • Kafka extension changelog
    • Kafka Core extension changelog
    • MongoDB/Cosmos DB extension changelog
    • SQL extension changelog
    • REST extension changelog
    • Google Pub/Sub extension changelog

store

The store function is used to store a key-value pair in memory, to be used later with the getStoredValue function.

Syntax

c4i:store(key, value [, order])

Parameters

key

The key. It is recommended to force a string key using the string function.

value

The value to store. It can be a simple value (string, number, ...) or a JSON structure

order (optional)

The order to execute the function. If not specified, it will be 1. All other operations (excluding other store functions) will be executed later.

Return value

The value. If you do not wish to see this value in the output message, use the dot notation in the destination name to ignore the output.

Example

Given the following STEP XML :

<STEP-ProductInformation>
    <Products>
        <Product ID="PRD1">
            <Name>Some product</Name>
        </Product>
        <Product ID="PRD2">
            <ProductCrossReference Type="Replacement" ProductID="PRD1"/>
        </Product>
    </Products>
</STEP-ProductInformation>

The following YAML configuration will produce the following output :

- Product:
    .product[_id]:
      - ./@ID: _id
      - c4i:store(string(./@ID), Name/text()): name

- Product:
    product[_id]:
      - ./@ID: _id
      - c4i:getStoredValue(string(ProductCrossReference[@Type="Replacement"][1]/@ProductID)): replacement_name
{
    "_id" : "PRD2",
    "replacement_name" : "Some product"
}
Last Updated: 8/4/23, 1:12 PM
Prev
serializeValuesToJSON
Next
toXML