Skip to Content

Datahub identical target Item creation order Issue

Hi Experts,

We're facing issue in datahub related to identical target item creation order.

Description : We have a requirement where we have to create multiple Target items of identical type in a specific sequence from a Canonical item, but when we're doing so the target items created are not in expected sequence. It is getting created in random manner.

*In order to create multiple target items from a canonical item, we're using a PublicationGroupingHandler. We have a String type attribute in Canonical item and we're splitting that string into a substrings and for each substring we creating a target item.

Can you please provide suggestions on how to achieve this.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 16, 2019 at 06:46 PM

    DataHub does not provide capability to imply certain order on creation of target items within the same target type. There are two reasons for this:

    1. maintaining strict sequential processing forbids parallel processing and therefore significantly hinders performance.

    2. there are rarely business cases when this is really needed.

    For this reason I'm curious about your business case? Why target items must be built sequentially in your application? You provided a hint of your technical implementation about splitting strings into substrings but that does not provide an idea about what you're trying to achieve.

    Controlling order, in which item of the same type are published, is possible but only by building a corresponding process, e.g. you control the order of data loading. Make sure loaded items are composed and published before you load next portion of dependent items. Another way to achieve this is by loading data into different pools, eg. some data go into pool1, some data go into pool2, etc. Then pools should be composed/published in a controlled manner: pool1 composes/publishes first, pool2 second, etc.

    Add a comment
    10|10000 characters needed characters exceeded

    • I don't think order of data loading or different pools is applicable for your case. Do you use iDocs with some attributes and for the shipping instruction attribute there are multiple segments, which need to be ordered?

      I'm not an expect on idoc format but we can think about this case. We can have two solutions:

      1. the instructions attribute in the target item contains complete instructions and does not split them into substring. This split is done in the target adapter when the item and the attribute value is converted to idoc (or whatever) format.

      2. shipping instructions are modeled in the target extension as a collection (a list) of instruction segments. You may write a function, which splits instructions into a list of segments. That functions is called from the transformation expression for the shipping instructions attribute and converts text in the attribute value in the canonical model to a list of segments in the target model. The target adapter then will convert those segment items into XML elements.

      However, ERP integration experts may refer you to an OOTB solution. Sounds like it should be a common problem.

  • Posted on Jul 02 at 04:10 PM

    Hi Experts,

    We hit a similar issue, when trying to transfer, via y2ysync, BundleTemplate items.

    The problem is that we cannot control the order, therefore it can happen that child templates are published before the parent ones. At import in the target system, the reference to the parent bundle template cannot be resolved in the first impex import pass, so the child is created with a null parentTermplate property. In the second pass of the impex, it tries to update the parentTemplate and fails from jalo code that the attribute can only be set at creation time.

    Tried forceWrite=true in the header, but it does not matter for the jalo code anyway.

    This should be a very valid business case for the item ordering.

    The only solution I can see is to apply a platform customization on the items.xml of the configurablebundleservices extension and change the attribute to be intial=false and writable=true, but this is a hack forced by the limitation in datahub :(

    Any idea is appreciated.

    Best regards,

    Cristi C.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.