User Answers

I think you will find this is as short as it can possibly go before it starts to become unmaintainable...

Hi Michael,

1. Copy the entire first source OBX to the first target OBX
2. Loop over the source OBX group
3. In the loop, if the loop key is greater than 1, append the source OBX 5 value to the first target OBX 5 with a preceding delimiter

It should look something like this...

If the source is...

There are only strings in ObjectScript.

We can peek at the $ZTH return with zzdump to prove this...

USER>zzdump $zth("00:00:00.1")
 
0000: 30 2E 31

USER>zzdump $zth("00:00:01.1")
 
0000: 31 2E 31


I think the ZWRITE command is confusing matters a little by displaying quotes around stringy values that are not canonical numbers. It implies that there is a concept of type when there is not.

Hi David,

The ruleset including assign actions are evaluated before the send actions.

In this instance, if both rules are true then the first assign will be overwritten by the second assign, before both send actions are processed.

I guess you could work around this by having two different property names and testing for the existence of a value in the DTL.

It feels like there is a better solution altogether to suggest, but its not clear what the real world use case is here.

Sean.

 

 

Hi Reinhard,

Welcome to ObjectScript and the Community.

As you are still learning ObjectScript I hope you don't mind a small amount of extra guidance on what you are doing.

I can understand why a set of popular named string functions might be a good idea, but in practice there are enough differences across languages to make one solution feel familiar to one set of developers and not to another. For instance InStr() might be familiar to Visual Basic developers but Java and JavaScript developers would be expecting indexOf() and Python developers find().

Hi Francisco,

You will need to create an iterator from the poliza %DynamicArray property, e.g.

set iterator=source.retorno.datos.polizas.poliza.%GetIterator()


You can then do a %GetNext(.key,.value) over the iterator where value will be a %DynamicObject that has the properties sucursal etc.

The other option would be to use the ZEN jsonProvider to deserialise the entire object for you, bypassing the need for the DTl.

Hi Francisco,

Have you tried using the RemoveItem() method on the Ens.Config.Production class?

There is nothing wrong with escaping a Solidus character. The JSON specification states that a Solidus "may" be escaped but does not have to be. You should find that most decoders will unescape the Solidus correctly, so you could just leave it as is.