T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::CORE Namespace Reference

Functions

 convertTimeString2Secs TimeString
 This function converts a given time string into the number of seconds of the day. More...
 
 getLogLineMessageType4rc rc_func ?strDefaultMessageType? args
 Calculates the corresponding message type (for tpwrite log lines) based on the input return code. More...
 
 getSessionLogChannel args
 Returns the Session log-file name of the current transfer session. If no session log-file name is available, the default LogChannel is used. More...
 
 getTransactionLogChannel args
 Returns the Log-channel information defined for the active transaction. More...
 
 initStatusInfo args
 Initializes the global StatusInfo buffer array. More...
 
 matchStringWithRegExp compareExpr matchString args
 
 resetLastErrorMessage args
 Initializes the global ErrorMessage buffer array. More...
 
 sendMail2BGS2 addr from smtp port message org subject xmailer ttype prio args
 This function will send a mail via the BGSs and a smtp. More...
 
 sendMailWithErrorList FromMailAddr MailAddr Subject ErrorMessage ?Prio?
 Send an email via the BGS server to a specified receiver including all stored error messages. More...
 
 setTransactionLogChannel TransactionLogChannel
 Stores the name of the Transaction log-file into the internal buffer. More...
 
 storeMessage2 MessageSource Message ?Kind? ?Format?
 writes an entry to the internal error message buffer so so that the information can be displayed to the Teamcenter user More...
 
 storeMessage2DatasetLogfile MessageSource Message ?Kind? ?Format?
 writes an entry to the internal message buffer so that the information can written to the log-file dataset More...
 
 storeUserMessage Severity MessageId ?S1? ?S2? ?S3? ?S4? ?S5?
 writes an user error entry to the internal error message buffer so that the information can be displayed to the Teamcenter user More...
 
 tp_split strInput strSplit ?blnTrim?
 Just like the TCL split, but with the possibility to use more than one character as split parameter. More...
 
 writeLogLineWithAttachment2BGS strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strHost? ?strPort? args
 Creates an attachment on the log server (BGS) and adds the link to it to the specified log line. More...
 
 writeVersionInfo2LogChannel LogChannel args
 Writes the version info to a given log channel. More...
 

Detailed Description

Function Documentation

◆ convertTimeString2Secs()

T4X::CORE::convertTimeString2Secs   TimeString  

This function converts a given time string into the number of seconds of the day.

Parameters
TimeStringin one of the following formats
  • hh:mm:ss
  • hh:mm
  • hh
Returns
time value converted into seconds of the day

◆ getLogLineMessageType4rc()

T4X::CORE::getLogLineMessageType4rc   rc_func ?strDefaultMessageType? args  

Calculates the corresponding message type (for tpwrite log lines) based on the input return code.

Deprecated:
Use PL4X::CORE::getLogLineMessageType4rc instead
Parameters
rc_func- return code for which the message type should be calculated
strDefaultMessageType- OPTIONAL - default: INTERN; Can be used to set DEBUG or any other message type as default
Returns
INTERN or ERROR based on the given rc_func

◆ getSessionLogChannel()

T4X::CORE::getSessionLogChannel   args  

Returns the Session log-file name of the current transfer session. If no session log-file name is available, the default LogChannel is used.

Deprecated:
Use PL4X::CORE::getSessionLogChannel instead
Parameters
none
Returns
Relative filename of the sessionlogfile

◆ getTransactionLogChannel()

T4X::CORE::getTransactionLogChannel   args  

Returns the Log-channel information defined for the active transaction.

Parameters
none
Returns
Relative file name of the TransactionLogFile

◆ initStatusInfo()

T4X::CORE::initStatusInfo   args  

Initializes the global StatusInfo buffer array.

Parameters
none
Returns
none

◆ matchStringWithRegExp()

T4X::CORE::matchStringWithRegExp   compareExpr matchString args  

◆ resetLastErrorMessage()

T4X::CORE::resetLastErrorMessage   args  

Initializes the global ErrorMessage buffer array.

Parameters
none
Returns
none

◆ sendMail2BGS2()

T4X::CORE::sendMail2BGS2   addr from smtp port message org subject xmailer ttype prio args  

This function will send a mail via the BGSs and a smtp.

Parameters
addrreceiver mail address
fromsender mail address
smtp<DNS|IP|HOST> address of the SMTP server
portsmpt server port (not yet supported, for future usage)
messageemail message text
orgmail header organisation
subjectsubject of the email
xmailermail header xheader
ttypeHTML | PLAIN
prioMail priority indicaor "" (default) | high | low
argslist of file attachments (please make sure that the files are copied to the BGS before the mail is send)
Returns
Status of the mail transfer

Sample code sequence

1 #
2 # sample for simple mail with high priority
3 #
4 set Smtp $::env(TPS_SMTP)
5 set From "T4S"
6 set Org "T4S-Server([info hostname])"
7 set Xmailer "TP-CM"
8 set Message "My mail text\n"
9 set Status [::T4X::CORE::sendMail2BGS2 "$MailAddr" "$From" "$Smtp" "0" "$Message" "$Org" "$Subject" "$Xmailer" PLAIN high]
10 #
11 # sample for html mail with low priority
12 #
13 set HtmlMessage "<strong>My html mail text<\strong>\n"
14 set Status [::T4X::CORE::sendMail2BGS2 "$MailAddr" "$From" "$Smtp" "0" "$HtmlMessage" "$Org" "$Subject" "$Xmailer" HTML low]

◆ sendMailWithErrorList()

T4X::CORE::sendMailWithErrorList   FromMailAddr MailAddr Subject ErrorMessage ?Prio?  

Send an email via the BGS server to a specified receiver including all stored error messages.

Parameters
FromMailAddrsender mail address(e.g. i.am@.nosp@m.sour.nosp@m.ce.co.nosp@m.m)
MailAddrreceiver mail address(e.g. i.am@.nosp@m.xyz..nosp@m.com)
Subjectsubject string of the email
ErrorMessageprefix string for the message body
Priomail priority indicator "" (default) | high | low
Returns
Status of the mail transfer

Sample code sequence

1 #
2 # sample with high priority
3 #
4 set FromMailAddr "Teamcenter.Gateway@myDomain.org"
5 set MailAddr "Teamcenter.Administrator@myDomain.org"
6 set Subject "My Subject"
7 set Message "My mail text\n"
8 #
9 set Status [::T4X::CORE::sendMailWithErrorList $FromMailAddr $MailAddr $Subject $Message high]
10 #
11 # sample with low priority
12 #
13 set Status [::T4X::CORE::sendMailWithErrorList $FromMailAddr $MailAddr $Subject $Message low]

◆ setTransactionLogChannel()

T4X::CORE::setTransactionLogChannel   TransactionLogChannel  

Stores the name of the Transaction log-file into the internal buffer.

Parameters
TransactionLogChanneltransaction log channel name
Returns
none

◆ storeMessage2()

T4X::CORE::storeMessage2   MessageSource Message ?Kind? ?Format?  

writes an entry to the internal error message buffer so so that the information can be displayed to the Teamcenter user

Parameters
MessageSourcedefines the origin system or module of the message
Messagemessages string default format is hex encoded
KindERROR | INFO | WARNING
FormatHEX|NOHEX defines if the message string is hex encoded or not default is NOHEX
Returns
none

◆ storeMessage2DatasetLogfile()

T4X::CORE::storeMessage2DatasetLogfile   MessageSource Message ?Kind? ?Format?  

writes an entry to the internal message buffer so that the information can written to the log-file dataset

Parameters
MessageSourcedefines the origin system or module of the message
Messagemessages string default format is hex encoded
KindERROR | INFO | WARNING
FormatHEX|NOHEX defines if the message string is hex encoded or not default is NOHEX
Returns
none

◆ storeUserMessage()

T4X::CORE::storeUserMessage   Severity MessageId ?S1? ?S2? ?S3? ?S4? ?S5?  

writes an user error entry to the internal error message buffer so that the information can be displayed to the Teamcenter user

Parameters
Severity- ERROR | INFO | WARNING - by unknown will be set to ERROR
MessageId- for UserError use the range 919000-919999
S1Character string being substituted into the internationalized message associated with this ifail code
S2Character string being substituted into the internationalized message associated with this ifail code
S3Character string being substituted into the internationalized message associated with this ifail code
S4Character string being substituted into the internationalized message associated with this ifail code
S5Character string being substituted into the internationalized message associated with this ifail code
Returns
none

◆ tp_split()

T4X::CORE::tp_split   strInput strSplit ?blnTrim?  

Just like the TCL split, but with the possibility to use more than one character as split parameter.

Parameters
strInput- input string which should be split
strSplit- split string (more than one character possible)
blnTrim- OPTIONAL (FALSE) - If TRUE, the returned values will be trimmed

◆ writeLogLineWithAttachment2BGS()

T4X::CORE::writeLogLineWithAttachment2BGS   strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strHost? ?strPort? args  

Creates an attachment on the log server (BGS) and adds the link to it to the specified log line.

Deprecated:
The T4X::CORE::writeLogLineWithAttachment2BGS is deprecated, please use LogTools::writeLogMessageWithAttachment instead
Parameters
strLogChannelDefines the log channel in the log server
strLogLineMessage in the log channel where the attachment will be added as a link
strLinkNameThe name of the link
strAttachmentDataThe content/payload of the attachment
strAttachmentMTypeMime type of the attachment (Optional - Default text/xml)
strMessageTypeMessage type (like INTERN, DEBUG, WARNING, ERROR) (Optional - Default INTERN)
strAttachmentNameThe name of the attachment (Optional - Default Attachment_timestamp + valid file extension for text/plain (.txt) and text/xml (.xml))
strHostthis argument is ignored
strPortthis argument is ignored

◆ writeVersionInfo2LogChannel()

T4X::CORE::writeVersionInfo2LogChannel   LogChannel args  

Writes the version info to a given log channel.

Parameters
LogChannellogchannel used for the version string output
argsnone
Returns
OK