Forum Replies Created
-
AuthorReplies
-
December 3, 2018 at 7:09 pm in reply to: 6.2.2 outbound Fileset-FTP – target directory leading slash? #86490
In 6.2.2 we are seeing failures of FTP with an absolute path. Did you report this to Infor support?
– Mark Thompson
HealthPartnersHello Gene,
Once you have “indexed” a Tcl proc (using mktclindex) you can call it by name from any other proc.
You can view the output of mktclindex in $HCISITEDIR/tclprocs/tclIndex That will show you the proc name and the file to “source” (load into memory) when the proc is first called.
That said, there are several different structures for Tcl procs used by Cloverleaf. Usually you will only call a proc of type “Other” from your proc. Procs types like tps, trx or xltp are designed to be called directly from the engine (or testing tool). You probably don’t want to try calling them from your proc.
– Mark Thompson
HealthPartnersYou can enable SmatHistory in site options to keep multiple versions of old SMATDB files. Setting the Maximum Age of SMAT Files on that same panel will clean up old files when they age out. The search tool allows the option of searching in the SmatHistory directory located in the process directory.
There is no built-in option to cycle SMATDB files on a regular schedule. Might be coming in 6.3? Many people do that by cycling SMAT files using a script that runs from cron or a UPOC timer.
– Mark Thompson
HealthPartnersHello Jerry,
It depends. Does the keyed list need to survive a restart of your Cloverleaf process or thread?
If not, you can use a global variable to store the keyed list.
Code:global myKL
Or even better, put it in a namespace.
Code:# Initialize the variable during startup
namespace eval ::myNamespace {variable myKL}# Set a value
keylset ::myNamespace::myKL SOMEKEY $someValue# Retrieve a value
set variableName [keylget ::myNamespace::myKL SOMEKEY]or more robust
Code:if { ![keylget ::myNamespace::myKL SOMEKEY variableName] } {
# Error processing here – key not found
# puts “my stuff couldn’t retrieve SOMEKEY in ::myNamespace::myKL”
}or even more robust
Code:if { [catch {keylget ::myNamespace::myKL SOMEKEY variableName} errTxt] } {
# Error processing here – covers all kinds of errors
puts “my stuff failed because $errText”
}If you need to persist through a restart use a file or database.
– Mark Thompson
HealthPartnersHello Ron,
Based on ‘#!/hci/bin/bash’ I’m guessing you are running on Linux. Correct?
Can you provide any detail on the ifactive script that gets called from cron before running hcisitedoc?
– Mark Thompson
HealthPartnersI understand it is consistent with ITIL policy to pre-denfine a “Standard” change (like Cloverleaf table move, Communication parameter change, etc) that allows you to streamline the Change Management process. That was a huge productivity booster for our team.
– Mark Thompson
HealthPartnersCloverleaf 6.2 allows you to specify your own encryption key for SMATDB. This means you can choose to synchronize the encryption key across all sites and use a more secure key than site name. Excellent enhancement!
– Mark Thompson
HealthPartnersTry the Tcl dblookup command for database tables.
– Mark Thompson
HealthPartnersThanks Rob – very helpful.
Is there a way to directly access the hash map (possibly as an array or dict)? Or do I need to parse gvprint to see the entire list of available gv’s?
– Mark Thompson
HealthPartnersThe smatdb2nl script does not work on encrypted files unless you add that functionality.
You can test sqlite from an command line like this. Count the number of records in the smatdb, where smatdbname is the full file name, encryptionKey is your encryption key.
Code:>sqlite smatdbname
sqlite> PRAGMA KEY=”encryptionKey”;
sqlite> select count(*) from smat_msgs;If you send me a PM, we can arrange a time to look at this offline.
– Mark Thompson
HealthPartnersAdding this line before the SELECT in the code above will apply your encryption key.
Warning: Using this on an unencrypted database immediately encrypts the database. See Charlie Bursell’s
hcismatdb for a great example of how to cautiously open encrypted smatdb’s.Code:smatdb eval “PRAGMA KEY=’yourEncryptionKeyHere'”
– Mark Thompson
HealthPartnersExcellent! Thanks Rob.
– Mark Thompson
HealthPartnersIf you are using smatdb, an sqlite query can gather information for you.
This script (written for AIX) uses Tcl sqlite library routines to display MessageContent. The SELECT statement could be altered to whatever metadata fields you want to view. See https://www.sqlite.org/tclsqlite.html
Code:
#!/usr/bin/env hcitcl
#
######################################################################
# Name: smatdb2nl
# Purpose: Dump smatdb files to nl-delimited messages
# UPoC type: script
# Args: smatdb1 … smatdbN
#
# Returns: Newline delimited messages
#
# Notes:
# It will be difficult to find message boundaries in the output for messages containing NL characters.
# Script does not work with encrypted smatdb files – see hcismatdb for help.
#
# History:
# Internal documentation notes here …proc smatdb2nl {argv} {
foreach smatfile $argv {
sqlite smatdb $smatfile
smatdb eval {SELECT MessageContent FROM smat_msgs} {
puts [string map [list n r] $MessageContent]
}
}
}
smatdb2nl $argv– Mark Thompson
HealthPartnersThe Cloverleaf 6.2 documentation provides 1 example of how to use Cloverleaf API calls. (The example gets a list of Alert files available for a site.)
Is anyone aware of documentation that details how to use these announced features?
Quote:
RESTful APIWith this API, you can create, edit, delete, and view Cloverleaf objects programmatically using the JSON format. The minimum required objects exposed through the API are:
– Mark Thompson
HealthPartnersHello Avy,
Is your .smatdb encrypted? That might be the issue with not finding the smat_msgs table.
Once you solve the encryption issue you may want to use something like:
Code:
echo ‘select count(*) from smat_msgs;’ | sqlite filename.smatdb– Mark Thompson
HealthPartners -
AuthorReplies