CompanionCompanion
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
Log out
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

serializeAssetPushLocationsToJSON

The serializeAssetPushLocationsToJSON function is used to serialize the asset push locations of an asset.

Syntax

c4i:serializeAssetPushLocationsToJSON(asset)

Parameters

asset

Xpath to an asset, usually ".".

Return value

A JSON document containing the Asset Push locations indexed by ID

Example

Given the following STEP XML:

<STEP-ProductInformation ExportTime="2020-06-05 10:15:28" ContextID="FR" WorkspaceID="Main">
    <Assets>
        <Asset ID="MyAsset" UserTypeID="AssetObjectType">
            <Name>My Asset</Name>
            <AssetPushLocation ConfigurationID="AssetPushLocation_1" Status="OK_FILTERED"></AssetPushLocation>
            <AssetPushLocation ConfigurationID="AssetPushLocation_2" Status="OK_DOWNLOADED">my/asset/push/location/2/MyAsset.jpg</AssetPushLocation>
            <AssetPushLocation ConfigurationID="AssetPushLocation_3" Status="OK_DOWNLOADED">my/asset/push/location/3/MyAsset.jpg</AssetPushLocation>
        </Asset>
    </Assets>
</STEP-ProductInformation>

The following YAML configuration will produce the following output

- c4i:serializeAssetPushLocationsToJSON(.)
{
  "AssetPushLocation_1": {
    "status": "OK_FILTERED"
  },
  "AssetPushLocation_2": {
    "status": "OK_DOWNLOADED",
    "location" : "my/asset/push/location/2/MyAsset.jpg"
  },
  "AssetPushLocation_3": {
    "status": "OK_DOWNLOADED",
    "location": "my/asset/push/location/3/MyAsset.jpg"
  }
}
Last Updated: 7/31/23, 10:35 AM
Prev
resolveUnitLabel
Next
serializeAttributeLinksToJSON