Forum Replies Created
-
AuthorReplies
-
Have you tried
Code:
set xlateOutVals [split $final ” “]Sometimes it’s difficult to determine “list” contexts.
If cloverleaf interprets it as a scalar, you will see this.
Transitions can be difficult, but your experience and skills make you a superior catch. I predict that you will quickly find a leadership position. M.D. Anderson’s loss is an opportunity for many. Best of luck at your new position, and thanks for lending your leadership here!!!
You have to. The interpreters are vertical, not horizontal.
If you want extra-data to go with the message, you have to use metadata fields. I have used USERDATA before to carry information across the translate to the post-procs.
If you don’t have it already, I would highly recommend the Brent Welch book “Practical Programming in TCL and TK”. I have the Fourth Edition.
http://www.amazon.com/Practical-Programming-Tcl-Tk-4th/dp/0130385603
ISBN 0-13-038560-3
There is a whole chapter on Namespaces.
A quick sketch on namespaces with regard to your variable issue is that namespaces provide a hierarchical set of global variable references.
Say we wanted a variable named “common”. We can put that variable in a namespace for access by any proc that runs in that interpreter.
(In Cloverleaf, each UPOC in an engine has a common interpreter.)
You initialize by using the incantation:
Code:namespace eval MySpace {
variable common
}You can then use the global variable in any of the procs that run in that UPOC thusly,
Code:set MySpace::common “MyScalar”
puts $MySpace::common
You can also create procs in namespaces and call them from any downstream proc as well. They are an indispensable utility for advanced implementation.
I realize that this involves renaming variables, but using namespaces is well worth the investment.
Expiring old codes will be a problem. We have some codes that date back to the 1980’s that are still valid.
When you are not the OPR for the code, it is much more difficult to maintain the list. You might want to think about interfacing the entire enterprise code base to an MFN for keeping codes synced.
December 1, 2015 at 12:43 pm in reply to: Multiple Copies of Message Type in 1 Variant Wont XLATE #83331As you can translate using TCL procs, that would be one solution. It is quite a bit more labor intensive, and requires more maintenance and testing than a standard translate.
One other note is that TrxId is not the determiner of message parts, the TrxId only determines the Path that the message will follow. If you are trying to change from an existing message flow, make sure that you check your translate configuration. That is the point where variants will succeed or fail.
If you have a large base of messages, do a big test on your variant. Picking out a small number for your development testing is good, but you need 1000+ messages (ideally) to give all of your parts a good test.
The command line testing tools are greatly valuable in the subject of mass testing. The GUI works well for development, but if you are running a thousand messages, you have to be good at the command line. Capture both the message outputs and the standard and error channels.
You may know all of these things, but I consider this board to be a great training tool. I did a level I class, and that got my feet wet, but Clovertech is where I have been able to study the techniques used by the folks who can really utilize the engine to its fullest. Charlie and Jim have taught me so much just by observing their posts on this board, so I try to expand just beyond the scope of the question to offer ideas that can help not only the questioner, but the lurker as well.
Have you tried colon-variables?
Say you have a variable with quotes, commas and all sorts of nasty characters.
Let’s call this variable $salad .
You would then say:
db eval {INSERT INTO MyTable VALUES (:OldMid, NULL, :Timestamp, :salad)}
The Colon syntax causes sqlite to do the variable unpacking itself, preventing both weird character problems and preventing sql-injection issues.
How about using a database with a “timed” proc to look for pairs.
Just write the messages to the database and let the timed proc pick out the pairs and put them together. That makes the process async, and you can use a timestamp to make sure you are looking back no sooner than say 30 seconds.
If the duplicate is not found on “this” pass, it will be picked up on the next.
You could set a cycle time of say 2 minutes…
Once you build the message and save it in cloverleaf with a MID, delete the two source messages.
If you use sqlite, make sure that you vacuum on a regular basis. Watch the file size to determine how often, unless there is an auto-vacuum…
Would MSH-10 help? It is usually unique to the sending system.
I believe that SQLite has a ROWID for each row in the table.
Using a SELECT * gives you a whole list of records that you would need to loop over. If timing is quite critical, it might be worth getting them all in a list, looping over the list and processing the DELETEs one at a time by the ROWID.
If timing is not critical, it might be simpler to use the query:
SELECT ROWID, * FROM MyTable
ORDER BY ROWID
LIMIT 1
This will give you a single record that you can parse out the columns on.
You can then
DELETE FROM MyTable
WHERE ROWID = $RowId
I always like to be explicit in my row handling. The DELETE * FROM MyTable is dangerous if you have more than one process looking at or manipulating the table. That may not be your intention from the beginning, but you may be setting a land mine for yourself later.
Looks like you have PDL turned on but you need tcp and tcp trace.
Here’s what I get when I turn those on.
Code:
[cmd :cmd :INFO/0:scc_interface_xlate:07/23/2015 10:05:03] Doing ‘xrel_post’ command with args ”
[pdl :read:DBUG/2:adtord_from_uh:07/23/2015 10:05:03] Events: E 0, R 8, W 0
[pdl :PDL :DBUG/1:adtord_from_uh:07/23/2015 10:05:03] Clearing PDL listen event
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] accepted fd = 34
[pdl :PDL :DBUG/1:adtord_from_uh:07/23/2015 10:05:03] Creating PDL listen event on fd 34
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Calling Tcl procedure: hci_pd.default.open-ok
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] with args: {{client “0.0.0.0”} {status ok}}
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Tcl procedure hci_pd.default.open-ok returns ”
[pdl :PDL :DBUG/2:adtord_from_uh:07/23/2015 10:05:03] PDL changed states: old 4, new 0
[pdl :init:DBUG/1:adtord_from_uh:07/23/2015 10:05:03] PDL did initialize: code = 0
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Receiving a command
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Command client went away. Closing connection.
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Receiving a command
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Received command: ‘scc_interface_xlate xrel_post’
[cmd :cmd :INFO/0:scc_interface_xlate:07/23/2015 10:05:03] Doing ‘xrel_post’ command with args ”
[pdl :read:DBUG/2:adtord_from_uh:07/23/2015 10:05:03] Events: E 0, R 8, W 0
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] read 293 bytes
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] input buffer accepted 293 bytes, now 293
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 0b 4d 53 48 7c 5e 7e 5c |.MSH|^~|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 26 7c 53 4f 41 52 49 41 |&|SOARIA|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 4e 7c 7c 49 42 45 58 7c |N||IBEX||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 32 30 31 35 30 37 32 ||2015072|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 33 31 30 30 34 34 35 7c |3100445||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 4f 52 47 5e 4f 32 30 ||ORG^O20|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 31 32 35 39 30 34 36 ||1259046|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 32 39 7c 50 7c 32 2e 33 |29|P|2.3|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 2e 31 7c 7c 32 30 31 35 |.1||2015|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 30 37 32 33 30 30 31 43 |0723001C|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 44 36 30 30 30 30 30 0d |D600000.|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 4d 53 41 7c 41 41 7c 7c |MSA|AA|||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 7c 30 0d 50 49 44 ||||0.PID|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 7c 32 39 36 33 35 ||||29635|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 39 35 30 5e 5e 5e 55 48 |950^^^UH|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 5e 41 4e 7c 7c 00 00 00 |^AN||xxx|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 00 00 00 00 00 00 5e 00 |xxxxxx^x|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 00 00 00 00 0d 4f 52 43 |xxxx.ORC|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 4e 41 7c 33 37 33 32 ||NA|3732|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 35 39 38 38 5e 4f 72 64 |5988^Ord|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 65 72 49 44 7e 33 37 33 |erID~373|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 32 35 39 38 38 5e 4f 63 |25988^Oc|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 63 4f 72 64 65 72 5f 49 |cOrder_I|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 44 7e 32 30 30 39 37 38 |D~200978|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 39 38 5e 4f 72 64 65 72 |98^Order|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 5f 49 44 7c 32 30 31 35 |_ID|2015|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 30 37 32 33 30 39 35 30 |07230950|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 30 37 31 30 31 32 5e 53 |071012^S|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 65 72 76 69 63 65 50 72 |ervicePr|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 6f 76 69 64 65 72 4f 72 |oviderOr|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 64 65 72 49 44 7c 7c 7c |derID||||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 7c 7c 7c 7c 30 32 |||||||02|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 32 34 30 30 0d 4f 42 52 |2400.OBR|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 7c 7c 43 56 54 31 |||||CVT1|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 33 30 30 30 36 32 7c 7c |300062|||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 7c 7c 7c 7c 7c 7c ||||||||||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 7c 0d 1c 0d |||…|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] IDLE and 293 bytes but no error: starting READ
[pdl :PDL :DBUG/2:adtord_from_uh:07/23/2015 10:05:03] PDL changed states: old 0, new 1
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Calling Tcl procedure: hci_pd.read
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] with args: {}
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Tcl procedure hci_pd.read returns ‘RECEIVE’
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] trying to match phrase: basic-msg
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] multi_phrase_2: status = ok
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Calling Tcl procedure: read.done
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] with args: {{status ok} {end {293 0}} {data {1 290}}}
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Tcl procedure read.done returns ”
[pdl :PDL :DBUG/2:adtord_from_uh:07/23/2015 10:05:03] PDL changed states: old 1, new 0
[pdl :read:DBUG/1:adtord_from_uh:07/23/2015 10:05:03] PDL did read msg: code = 0
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] READ operation completed (0 bytes buffered still, 293 before)
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Receiving a command
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Received command: ‘scc_interface_xlate xrel_post’
[cmd :cmd :INFO/0:scc_interface_xlate:07/23/2015 10:05:03] Doing ‘xrel_post’ command with args ”
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Receiving a command
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Command client went away. Closing connection.
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Receiving a command
[cmd :cmd :INFO/0:scc_interface_cmd:07/23/2015 10:05:03] Command client went away. Closing connection.
[pdl :wrte:INFO/1:adtord_from_uh:07/23/2015 10:05:03] [0.0.260774400] Write msg to connection
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] bound message 0xb1c28328 to `message0′
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] (message length is 79)
[pdl :PDL :DBUG/2:adtord_from_uh:07/23/2015 10:05:03] PDL changed states: old 2, new 0
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Calling Tcl procedure: hci_pd.write
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] with args: {{message message0}}
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Tcl procedure hci_pd.write returns ‘TRANSMIT’
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] writing out 82 bytes:
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 0b 4d 53 48 7c 5e 7e 5c |.MSH|^~|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 26 7c 49 42 45 58 7c 7c |&|IBEX|||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 53 4f 41 52 49 41 4e 7c |SOARIAN||
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 7c 32 30 31 35 30 37 32 ||2015072|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 33 31 30 30 35 7c 7c 41 |31005||A|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 43 4b 7c 31 32 35 39 30 |CK|12590|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 34 36 32 39 7c 50 7c 32 |4629|P|2|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 2e 33 2e 31 7c 0d 4d 53 |.3.1|.MS|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 41 7c 41 41 7c 31 32 35 |A|AA|125|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 39 30 34 36 32 39 7c 0d |904629|.|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] 1c 0d |..|
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] write buffer has 82 bytes, currently at +0
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] wrote 82 bytes out of 82
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] write buffer has 82 bytes, currently at +82
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Calling Tcl procedure: write.done
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] with args: {{status ok}}
[pdl :PDL :DBUG/0:adtord_from_uh:07/23/2015 10:05:03] Tcl procedure write.done returns ”
[pdl :PDL :DBUG/2:adtord_from_uh:07/23/2015 10:05:03] PDL changed states: old 2, new 0
[pdl :wrte:DBUG/1:adtord_from_uh:07/23/2015 10:05:03] PDL did write msg: code = 0It seems like you might need more info on the exact bytes transferred. I’ve submitted logs like these to vendors, and since it details the exact bytes sent, they usually fold as WE HAVE THE MEATS!
If the needed translate is provided in the data stream, you could use a trxid proc to determine which translate to call by a route. All of your messages would come from the same inbound and would go to the same outbound thread, but the trxid proc would generate the route to get the correct XLT.
This would also have the advantage of error checking and default behavior if a bad XLT is called.
We always liked NCFTP. Provides a rather robust scripting and error handling, plenty of information for logging, and could be easily scheduled by crontab.
One thing you need to remember using an outside FTP facility, you need to first transfer the file and then rename it on your side for pickup. Rename is an atomic operation that won’t ball you up on half-transferred files. They may need that on the other end as well.
An I thought that is was only the Lab that was used as a scapegoat… 😉
June 24, 2015 at 1:18 pm in reply to: TCL frag – lassign out to an unknown amount of variables #82761Also, a basic point of potential error.
xlateInVals is a list. In the script, you are handling it as a scalar.
This code will work when there is only one value being passed in. If there are two, then it will fail in new, strange, and unfathomable ways.
If you expect to extract a scalar out of xlateInVals ALWAYS do a
set myvar [lindex $xlateInVals 0]
Out Vals is also a list. If you do not remember this basic issue, you can look forward to a lot of fun 1 or 2 years down the line….
-
AuthorReplies