在impex上使用ClassificationAttributeValueTranslator

时间:2017-08-02 16:45:17

标签: hybris impex

我试图在impex上使用ClassificationAttributeValueTranslator。我有一些类ClassificationAttributeTranslator工作的例子,但不能使这个工作。

exports.getData = (param1, param2) => {
  return getData0(param1, param2)
    .then(data0 => Promise.all(data0.map(e => getData1(e.id))))
    // data0 here should be an Array

    .then(data1 => Promise.all(data1.map(i => getData2(i.id))))

    // 1. data1 will be an Array with results from each getData1 call
    //    mapped by index. for e.g [result1, result2, ...]
    // 2. depending on the type of result (Object/Array) from getData1
    //    you should extract `id` from `i`(result item) and then 
    //    trigger `getData2`using that `id`. I'm assuming the issue is 
    //    here. 

    .then(data2 => data2.map(a => getData3(a.id)))
    .catch(err => console.error(err.message));
};

我收到此错误

Can anyone give me a dummy example about a function that returns a structure wherein both elements of the (see a and b above) are obtained in an async way?

1 个答案:

答案 0 :(得分:0)

您必须使用de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeTranslator而不是de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator