Sitecore Asked on September 25, 2020
I managed to import the data with Parent-Child relations (below you can see that I have several pipelines for different types of items – red for parent; green for subfolder; blue for children). However, I need to have children of different templates under the parent (Folder Assets on the image below).
I thought that I can try to extend the second Pipeline like below:
1.Select Languages
2.Resolve Product Model
3.Apply Mapping
4.Update Sitecore Item
5.Get Product Folders
6.Iterate Product Folders
7.Get Asset Folders (use another property of a parent object)
8.Iterate Asset Folders (pointer to a new pipeline which will handle Assets)
However, this solution doesn’t work (it seems that If we changed the context to a child pipeline in step 6 then we can’t go back to step 7). Do you have any suggestions how to setup the pipeline batch to reach the goal?
Thank you in advance for the help.
Solution 1
Override SetObjectOnPipelineContext
method ofCopyObjectFromContextToNewLocationStepProcessor
with
public class MyCopyObjectToNewLocation : DataExchange.Processors.PipelineSteps.CopyObjectFromContextToNewLocationStepProcessor
{
public override bool SetObjectOnPipelineContext(object obj, Guid location, PipelineContext pipelineContext, ILogger logger)
{
if (location == ItemIDs.PipelineContextIterableData)
{
var plugin = this.GetPipelineContextPlugin<IterableDataSettings>(pipelineContext, false);
if (plugin != null)
{
pipelineContext.RemovePlugin(typeof(IterableDataSettings));
}
plugin = new IterableDataSettings(obj as IEnumerable);
this.AddPluginToPipelineContext(plugin, pipelineContext, false);
return true;
}
return base.SetObjectOnPipelineContext(obj, location, pipelineContext, logger);
}
}
Find __Standard Values
of Copy Object from Context to New Location Pipeline Step
template and update Process Type
with your fix.
Verify that pipeline steps created on this template were updated.
Solution 2
Solution 1 is hint where problem is. There is an issue with itarable data location. Certainly for this location it checks if it's already set then skip it. It means the next using of this location in the current pipeline will never assign new object to Pipeline Context Iterable Data
location.
As workaround you can use Pipeline Context Temp Storage
instead of Pipeline Context Iterable Data
Correct answer by Vlad Shpak on September 25, 2020
I have similar requirement, i wanted to create child category items under the product. I used above 'Vlad' inputs and added pipeline step 'Get Catalog item'.
As mentioned in the below image for resolve category child item, I set 'Parent for item location' as 'Pipeline Context Parent Target', it helps me to create child categories under product.
Answered by Sivalingaamorthy on September 25, 2020
0 Asked on August 23, 2021 by debaparna
0 Asked on August 23, 2021 by meenu
0 Asked on August 23, 2021 by umang
1 Asked on August 23, 2021 by david-masters
1 Asked on February 21, 2021 by nikola-kramaric
2 Asked on February 20, 2021 by martinmace
0 Asked on February 18, 2021 by ventenni
2 Asked on February 15, 2021 by jleruohep
2 Asked on February 7, 2021 by aklein
1 Asked on January 12, 2021 by mohamed-yaseen
1 Asked on December 25, 2020 by peter-nazarov
1 Asked on December 22, 2020 by naveed-ahmad
1 Asked on December 19, 2020 by imathi
5 Asked on December 19, 2020
0 Asked on December 12, 2020 by prakashmadhava
1 Asked on November 30, 2020 by pss
1 Asked on November 26, 2020
1 Asked on November 2, 2020 by baxter-lane
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP