Forum Replies Created
-
AuthorReplies
-
Sorry appears I can’t edit my last post any more time. (Formatting issues, so I must of maxed out my ability to edit that post.) I too had issues with space delimited lists. I did end up making my list pipe “|” delimited. I’m attaching screenshots of my sample xlate to demonstrate how I finally got mine to work. Hope it helps.
Attachments:
You must be logged in to view attached files.I ran into the same issue. I had to take my list and used a COPY statement with source @myList –> @myIterationCnt and the used the following code in the pre-proc:
<pre>set dummyList [split [lindex $$xlateInVals 0] ]
set dummyList [llength $dummyList]
set output “”
for {set i 0} {$i < $dummyList} {incr i} {lappend output $i}
set xlateOutVals</pre>
After this my variable @myIterationCnt would contain 5 entries {0 1 2 3 4} if my list had five entries. I could then use @myIterationCnt as the variable in the iterate. This solved the iterate issue, but you then have to pull out the actual value yoyu want from your list. To do that, I have a COPY statement inside the iterate, that has two values on the input. $%u1 and @myList. The target of the copy is my output field, but I have the following code as a pre-proc in the COPY statement:
<pre>set index [lindex $xlateInVals 0]
set drugList [lindex $xlateInVals 1]
set drugList [split $drugList ]
set returnValue [lindex $drugList $index]
set xlateOutVals</pre>
This works because both code blocks in the pre-proc knows to respect the curly braces, while the iterate does not. Hope this helps, sorry I didn’t update the thread when I ran across the issue myself. If you are confused I can try to grab some screen shoots of my setup tonight or tomorrow.- This reply was modified 3 years, 6 months ago by David Burgess.
- This reply was modified 3 years, 6 months ago by David Burgess.
- This reply was modified 3 years, 6 months ago by David Burgess.
Thank you all! Good stuff, got me what I needed. (Hi Paul!! Hope life is treating you well!)
I had to make a slight adjustment as I wanted to manipulate the output iteration variable, but after seeing what Ted had done it was an easy adjustment. (I initialized @counter to zero, and added a line in the xlate to move the value of @counter to $%l1 which is what I used as the output iteration value.) If you are interested, I’ve attached the updated version of the Xlate. I didn’t even need to add pre-proc code at that point. Here is my output form the testing tool:
MESSAGE 1
Warnings(0).warningCode >one<
Warnings(1).warningCode >two<
Warnings(2).warningCode >three<
Warnings(3).warningCode >four<
Warnings(4).warningCode >five<
Warnings(5).warningCode >six<Thanks again, I would have figured this out your help!!
David
Attachments:
You must be logged in to view attached files.Quick update on this issue. The GUI allows you to only enter integer values for “min” and “max”, but under the hood the program expects something like “2.0” instead of “2”. If you manually edit the JSON schema and insert the “.0”, it works fine. Beware that if you later open the schema in the GUI the tool will remove the “.0” and any save will revert to back to non-working integers. Infor has registered this as a problem and will work to work a fix into a future release/patch.
Thanks Jim! I should test that for field definitions. In this case I’m working with number of items in an array. (For example I want to enforce that the Insurance array has a minimum of one instance, but not more than three instances.) I can of course manipulate that myself, but if the function exists in the tool, I’d love to use it to reject messages that fail validation as they come in the door.
-
AuthorReplies