GetProductAttributesTask
Introduction
The GetProductAttributesTask uses the OMN API to collect attributes at the target object (product/article/variant) and expose results in multiple formats for downstream processing.
This task is particularly useful in translation workflows and other scenarios where you need to analyze or modify product attributes systematically.
Usage
Input is the ID of the product/article/variant to read and optionally filter criteria. The task automatically detects the scope (product, article, or variant) and handles inheritance from parent levels.
The task provides two complementary output formats: a map for analysis and inspection, and a list for direct persistence operations.
Input Variables
| Name | Description | Type | Required | Default Value |
|---|---|---|---|---|
|
Id of product/article/variant to read |
Long |
Required |
- |
|
Filter list of attribute identifiers; |
List<String> or String |
Optional |
All attributes |
|
Include inherited values from parent levels (Product → Article → Variant) |
Boolean |
Optional |
true |
|
Also include effective fields with defaulted values |
Boolean |
Optional |
false |
|
Controls which outputs are written: |
String |
Optional |
map |
|
Filters attributes based on scope access: |
String |
Optional |
write |
Output Variables
| Name | Description | Type |
|---|---|---|
|
Map keyed by attribute identifier with rich metadata (identifier, dataType, multi, languageDependent, inheritance info, values) |
Map<String, Object> |
|
Normalized list usable by SetProductAttributesTask - one row per attribute and locale |
List<Map<String, Object>> |
|
The HTTP Status Code of the REST API Call |
Integer |
|
The HTTP Response Body of the REST API Call |
String/JSON |
Usage Notes
Map vs List Output:
-
Use
mapfor analysis/inspection (O(1) lookups, rich metadata) -
Use
listfor direct persistence via SetProductAttributesTask -
Use
bothwhen you first analyze via the map and then persist via the list
Inheritance Handling:
-
When
includeInherited=true, values flow from Product → Article → Variant levels -
The task respects attribute inheritance configuration (editable, visible, not visible)
Access Control:
-
attributeAccessMode=writefilters to only writable attributes (recommended for modification workflows) -
attributeAccessMode=readincludes all readable attributes
Target Scope:
-
The
productIdcan represent product, article, or variant - the task auto-detects the scope -
Full product tree is retrieved to determine the correct scope and handle inheritance
Example Usage
The task is commonly used in multi-instance subprocess to collect attributes for multiple products:
<serviceTask id="getProductAttributes" name="Get Product Attributes"
camunda:delegateExpression="${getProductAttributesTask}">
<extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="productId">${productId}</camunda:inputParameter>
<camunda:inputParameter name="attributeIdentifiers">${execution.getVariable('ext.ai-translation.attributes')}</camunda:inputParameter>
<camunda:inputParameter name="includeInherited">true</camunda:inputParameter>
<camunda:inputParameter name="attributeAccessMode">write</camunda:inputParameter>
<camunda:inputParameter name="outputMode">both</camunda:inputParameter>
</camunda:inputOutput>
</extensionElements>
</serviceTask>
Output Format
The task can emit its results in two complementary shapes. Both contain the same information; the list form is normalized for direct piping into SetProductAttributesTask.
Map format (productAttributes)
Keyed by identifier: productAttributes[<identifier>] = entry
Common fields on each entry:
-
identifier: String -
dataType: String (e.g.,text,number,date,boolean,table,referenceTable) -
multi: Boolean (attribute is multi-valued) -
languageDependent: Boolean -
localizedDomainValue: Boolean -
required: Boolean -
attributeProductType: String (P,A, orV) -
inheritanceType: String (editable,visible,not_visible) -
hasDefaultValue: Boolean -
defaultValueLanguageDependent: Boolean -
readableAtScope: Boolean -
writableAtScope: Boolean
Values on each entry:
-
If
languageDependent=false:-
value: List<String> -
If
resolveDefaultValues=true:effectiveValue: List<String>
-
-
If
languageDependent=true:-
valuesByLocale: Map<String, List<String>> (keys are language tags likede-DE) -
If
resolveDefaultValues=true:effectiveValuesByLocale: Map<String, List<String>>
-
{
"Title": {
"identifier": "Title",
"dataType": "text",
"multi": false,
"languageDependent": true,
"localizedDomainValue": false,
"required": false,
"attributeProductType": "P",
"inheritanceType": "editable",
"hasDefaultValue": false,
"defaultValueLanguageDependent": true,
"readableAtScope": true,
"writableAtScope": true,
"valuesByLocale": {
"en-EN": ["English Title"],
"de-DE": ["German Title"]
}
},
"Weight": {
"identifier": "Weight",
"dataType": "number",
"multi": false,
"languageDependent": false,
"localizedDomainValue": false,
"required": false,
"attributeProductType": "P",
"inheritanceType": "editable",
"hasDefaultValue": false,
"defaultValueLanguageDependent": false,
"readableAtScope": true,
"writableAtScope": true,
"value": ["1.5"]
}
}
List format (productAttributesList)
Each row corresponds to one attribute and one locale (for language-dependent)
or a non-localized value (locale=null). The same metadata fields as above are
included on each row.
Fields per row:
-
identifier: String -
value: List<String> -
locale: String or null (e.g.,de-DE) -
plus:
dataType,multi,languageDependent,inheritanceType,attributeProductType,readableAtScope,writableAtScope, …
[
{
"identifier": "Title",
"dataType": "text",
"multi": false,
"languageDependent": true,
"inheritanceType": "editable",
"locale": "en-EN",
"value": ["English Title"]
},
{
"identifier": "Title",
"dataType": "text",
"multi": false,
"languageDependent": true,
"inheritanceType": "editable",
"locale": "de-DE",
"value": ["German Title"]
},
{
"identifier": "Weight",
"dataType": "number",
"multi": false,
"languageDependent": false,
"inheritanceType": "editable",
"locale": null,
"value": ["1.5"]
}
]
Access flags
-
readableAtScope: true if the attribute’s value is readable at the current scope (P/A/V).-
Product scope: true when the attribute is defined at product level.
-
Article scope: true for article-level attributes; also true for product-level attributes when
inheritanceTypeiseditableorvisible(notnot_visible). -
Variant scope: true for variant-level attributes; also true for article/product-level attributes when
inheritanceTypeiseditableorvisible.
-
-
writableAtScope: true if the attribute can be written at the current scope (P/A/V).-
Product scope: true only for product-level attributes.
-
Article scope: true for article-level attributes; product-level attributes only when
inheritanceTypeiseditable. -
Variant scope: true for variant-level attributes; article/product-level attributes only when
inheritanceTypeiseditable.
-
Notes:
-
attributeProductType(level) is the configured level:p(product),a(article),v(variant). -
inheritanceTypecontrols how values bubble down:-
editable: bubbles down as writable and readable. -
visible: bubbles down as readable only (not writable). -
not_visible: does not bubble down (neither readable nor writable below its level).
-