How to match segments between custom automatic actions?

Hi! I am implementing some automatic actions using WorldServer SDK 11.7.3 and I need to create a mapping between segments and other entities to use across automatic actions.

I was thinking of using indices of the segments as their identifiers. Is their order guaranteed to be the same in different automatic actions? And is there another way to achieve this if not?

The code looks something like this:

```

WSAssetTranslation translation = assetTask.getAssetTranslation();

Iterator segments = translation.textSegmentIterator();

int index = 0;

while (segments.hasNext()) {

  WSTextSegmentTranslation segment = (WSTextSegmentTranslation) segments.next();

  // do stuff with segment <index> which is supposedly the same in both automatic actions

  index++;

}

```

  • Hi Robert,

     

    I am sorry for my late response on this, it was a quite busy month.

    Most probably you already moved on with this approach, which I think will work for your needs.

    You can also log/check the correctness of your code by following the segment.getIdProperty() value for segments.

    I also suggest to make a few tests with split and merged segments to validate your code for this actions as well. 

    Hope your implementation works as expected, let me know otherwise.

    Thank you,

    Anca