T4S4  18.2 C7549 A21431
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::BATCHJOB::IMPORT Namespace Reference

Functions

 addFileAttachment JobAttributeDict FileName
 This function adds the given FileName to the given JobAttributeDict and returns the updated dict. More...
 
 addStreamAttachment JobAttributeDict StreamName Stream
 This function adds the given attachment stream to the given JobAttributeDict and returns the updated dict. More...
 
 checkConnection2ERP FunctionName SessionId ?Mode? ?strObjectType? ?strAction? args
 This function reads the current stored ERP login info's for a given Teamcenter. Session Id and tests the connection. More...
 
 createBatchjob FunctionName ImportObjectId ?TransferDirection? ?ZTabId? ?AdditionalInfo? ?SessionId? ?Filter? ?DependOnIds? args
 This function creates batch job to import SAP/ESB/... item to Teamcenter. More...
 
 createBatchjob2 BatchJobDict args
 This function creates batch job to import SAP/ESB/... item to Teamcenter. More...
 
 CreateImportBOMCodeProxy FunctionName ConnectFct VerifyZTblFct GetDataFct SelectFct CreateFct SelectViewFct CreateViewFct BOMInfoFct ReverseMappingFct UpdateFct UpdateZTblFct InitFct CleanUpFct ?T4Target? args
 This function creates a generic import batch job code for BOMs. More...
 
 CreateImportCodeProxy FunctionName ConnectFct VerifyZTblFct GetDataFct SelectFct CreateFct MappingFct ReverseMappingFct UpdateFct UpdateZTblFct InitFct CleanUpFct ?T4Target? ?Type? args
 This function creates a generic import batch job code. More...
 
 CreateImportMetaCodeProxy FunctionName ConnectFct VerifyZTblFct ImportFct UpdateZTblFct InitFct CleanUpFct ?T4Target? args
 This function creates a generic import batch job code. More...
 
 createJob FunctionName JobAttributeDict
 This function creates batch job to import SAP/ESB/... item to Teamcenter. More...
 
 executeImportJob FunctionName ImportObjectId ?TransferDirection? ?ZTabId? ?RunMode? ?AdditionalInfo? args
 This function starts the import batch job from ERP to TC. More...
 
 executeImportJob2 ImportDict args
 This function starts the import Batchjob from ERP to TC. More...
 
 handleBatchJob ExecuteFunction JobId ImportObjectId TransferDirection ZTabId AdditionalInfo
 This function makes necessary settings and checks (dependency), executes the import code and sets the batch job status. More...
 
 initJobAttributeStructure FunctionName ObjectString
 This function initializes the JobAttribute buffer argument of the new createJob call. More...
 
 procedureExists procedureName
 
 setHardDependencyList DependencyDict DependencyList
 This function updates a dict with a list of hard dependencies. More...
 
 setImportJobAttributeDict JobAttributeDict ImportJobAttributeName NewValue
 This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob. More...
 
 setImportJobObjectId JobAttributeDict ImportObjectKey
 This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob. More...
 
 setImportJobTransferDirection JobAttributeDict TransferDirection
 This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob. More...
 
 setJobAttributes JobAttributeDict JobAttributeName NewValue
 This function sets the defined JobAttribute in the provided JobAttributeDict to the new specified value. More...
 
 setJobDescription JobAttributeDict JobDescription
 This function sets the JobDescription in the provided JobAttributeDict. More...
 
 setSoftDependencyList DependencyDict DependencyList
 This function updates a dict with a list of soft dependencies. More...
 
 updateStatus4ZTableId LogChannelName FunctionName ZTabId Status ?Error_Msg1? ?Error_Msg2? ?Error_Msg3? args
 This function updates status of given entry in the Z-Table. More...
 
 writeTransactionLog AppLogTransactionId FunctionName Status args
 This function writes the given information to the transaction log. More...
 

Variables

 BatchjobDefaults
 Namespace array buffer to define defaults for the Export Job processing. For each registered export job type a separate set of defaults are defined during the registration. The following array elements are defined ($FunctionName stands for the registered JobTypeName):

BatchjobDefaults(BatchJobPrio:$FunctionName) Defines the default priority in the job pool (default: 20)
BatchjobDefaults(BatchJobTimeout:$FunctionName) Defines the default job processing timeout for a job (default: 3600)
BatchjobDefaults(MaxRetryCounter:$FunctionName) Defines the maximum number of job execution retries in the case of a detected application error (default: 1)
BatchjobDefaults(DefaultRetryTime:$FunctionName) Defines a delay in seconds after a job the is sent into retry
BatchjobDefaults(useBypassPrivilege:$FunctionName) Activate the bypass privilege during the job execution (default: true)
In addition there is also a generic setting for the default execution time window:

BatchjobDefaults(DefaultTimeWindow) Defines the default job execution time window (default: "No TimeWindow") More...
 

Function Documentation

◆ addFileAttachment()

T4X::BATCHJOB::IMPORT::addFileAttachment   JobAttributeDict FileName  

This function adds the given FileName to the given JobAttributeDict and returns the updated dict.

Parameters
JobAttributeDictdict
FileNamestring containing the file location
Returns
returns an updated JobAttributeDict buffer with the updated import job attribute value

◆ addStreamAttachment()

T4X::BATCHJOB::IMPORT::addStreamAttachment   JobAttributeDict StreamName Stream  

This function adds the given attachment stream to the given JobAttributeDict and returns the updated dict.

Parameters
JobAttributeDictdict
StreamNamename of the attachment stream
Streamstring representing the steam content
Returns
returns an updated JobAttributeDict buffer with the updated import job attribute value

◆ checkConnection2ERP()

T4X::BATCHJOB::IMPORT::checkConnection2ERP   FunctionName SessionId ?Mode? ?strObjectType? ?strAction? args  

This function reads the current stored ERP login info's for a given Teamcenter. Session Id and tests the connection.

Parameters
FunctionNamename of the connect function to run
SessionIdunique session ID for the users teamcenter session, if set to NO_ERP_NEEDED - the erp connection will be skipped
Modetransfer mode like WORKFLOW, PORTAL, BATCH, RTP, LOV, ...; default = "*" for all.
strObjectTypeERP target object type like MM, ECM, ...; default = "*" for all.
strActiontransfer action in the GUI like CREATE, CHANGE, ...; default = "*" for all.
Returns
Success: LOGON_OK / Failure: anything else

References T4X::CORE::getSessionLogChannel(), and tpwrite().

◆ createBatchjob()

T4X::BATCHJOB::IMPORT::createBatchjob   FunctionName ImportObjectId ?TransferDirection? ?ZTabId? ?AdditionalInfo? ?SessionId? ?Filter? ?DependOnIds? args  

This function creates batch job to import SAP/ESB/... item to Teamcenter.

Parameters
FunctionNamename of the import function created with the proxy call CreateImportCodeProxy/CreateImportBOMCodeProxy/CreateImportMetaCodeProxy
ImportObjectIdobject key
TransferDirectionstring for MonitorCounters example "SAP2TC"; initialised with "TC_IMPORT" not given and the following parameter are not set
ZTabIdz-table id - initialised with "NONE" if not given and the following parameter are not set
AdditionalInfoinitialised with "NONE" if not given and the following parameter are not set
SessionIdunique session ID for the Teamcenter session; if set to NO_ERP_NEEDED, the ERP connection will be skipped; initialised with "BATCH" if not given and the following parameter are not set
Filterinitialised with "NONE" if not given and the following parameter are not set
DependOnIdslist of batch job Id on which this batch job depends on; initialised with empty list if not given and the following parameter are not set
Returns
list of OK and batch job id or ERROR

References API::Core::Batch::connectTo(), API::Core::Batch::createJob(), API::Core::Batch::createObject(), API::Core::Batch::disconnect(), T4X::BATCHJOB::TOOLBOX::getTimeWindow(), T4X::BATCHJOB::DEPENDENCIES::setBatchJobDependencies(), API::Core::Batch::setObjectAttribute(), and tpwrite().

Referenced by createBatchjob2(), and T4S::QUERY::CUSTOM::MAPPING::importQueryRowViaBatch().

◆ createBatchjob2()

T4X::BATCHJOB::IMPORT::createBatchjob2   BatchJobDict args  

This function creates batch job to import SAP/ESB/... item to Teamcenter.

Parameters
BatchJobDictdict
BatchJobDict has the following dict keys
  • FUNCTION - mandatory - name of the import function created with the proxy call CreateImportCodeProxy/CreateImportBOMCodeProxy/CreateImportMetaCodeProxy
  • OBJECTKEY - mandatory - object key
  • TRANSFER - optional - string for MonitorCounters example "SAP2TC", set to "TC_IMPORT" if not given
  • ZTBLID - optional - z-table id - set to "NONE" if not given
  • SESSIONID - optional - unique session ID for the Teamcenter session, set to BATCH if not given
  • FILTER - optional - set to "NONE" if not given
  • DEPENDENCIES - optional - list of batch job Id on which this batch job depends on, set to empty list if not given
  • ADDITIONALINFO - optional - any additional info, set to NONE if not given

References createBatchjob(), and T4X::BATCHJOB::TOOLBOX::getDictValue().

◆ CreateImportBOMCodeProxy()

T4X::BATCHJOB::IMPORT::CreateImportBOMCodeProxy   FunctionName ConnectFct VerifyZTblFct GetDataFct SelectFct CreateFct SelectViewFct CreateViewFct BOMInfoFct ReverseMappingFct UpdateFct UpdateZTblFct InitFct CleanUpFct ?T4Target? args  

This function creates a generic import batch job code for BOMs.

Parameters
FunctionNamename of the procedure to create
ConnectFctname of the procedure to connect the ERP
VerifyZTblFctname of the procedure to read the z-table
GetDataFctname of the procedure to get the Teamcenter data
SelectFctname of the procedure to select a Teamcenter item
CreateFctname of the procedure to create a new Teamcenter item
SelectViewFctname of the procedure to select a Teamcenter bom view
CreateViewFctname of the procedure to create a new Teamcenter bom view
BOMInfoFctname of the procedure to get the bom view data
ReverseMappingFctreverse mapping procedure name
UpdateFctname of the procedure to update a Teamcenter item
UpdateZTblFctname of the procedure to update the status in z-table
InitFctinitialise function, called at the beginning
CleanUpFctclean up function, called at the end
T4Targetdefines the used base product feature (e.g. T4S) to execute the batch job

Sample code sequence

1 set Status [::T4X::BATCHJOB::IMPORT::CreateImportBOMCodeProxy "T4S_IMPORT_BOM" "::T4S::CONNECTION2SAP::checkConnection2SAP4Batchjob" "::T4S::ZPTC::verifyZTableIdStatus" "::T4S::BOM::CUSTOM::ITEM::IMPORT::getImportBomInfo" "::T4S::BOM::CUSTOM::ITEM::IMPORT::selectTC_Object" "::T4S::BOM::CUSTOM::ITEM::IMPORT::createTC_Object" "::T4S::BOM::CUSTOM::ITEM::IMPORT::selectTCBOMview_Object" "::T4S::BOM::CUSTOM::ITEM::IMPORT::createTCBOMview_Object" "::T4S::BOM::CUSTOM::ITEM::IMPORT::getCurrentTcBomInfo" "::T4S::BOM::CUSTOM::ITEM::IMPORT::importBOM2TcBOM" "::T4S::BOM::CUSTOM::ITEM::IMPORT::updateTC_Object" "::T4S::ZPTC::Set_ZPTC_Status" "NONE" "::T4S::BOM::CUSTOM::ITEM::IMPORT::cleanUp" "T4S"]
Returns
OK or ERROR information

References T4X::BATCHJOB::TOOLBOX::setBatchjobDefaults().

◆ CreateImportCodeProxy()

T4X::BATCHJOB::IMPORT::CreateImportCodeProxy   FunctionName ConnectFct VerifyZTblFct GetDataFct SelectFct CreateFct MappingFct ReverseMappingFct UpdateFct UpdateZTblFct InitFct CleanUpFct ?T4Target? ?Type? args  

This function creates a generic import batch job code.

Parameters
FunctionNamename of the procedure to create
ConnectFctname of the procedure to connect the ERP
VerifyZTblFctname of the procedure to read the z-table
GetDataFctname of the procedure to get the Teamcenter data
SelectFctname of the procedure to select a Teamcenter item
CreateFctname of the procedure to create a new Teamcenter item
MappingFctmapping function
ReverseMappingFctreverse mapping procedure name
UpdateFctname of the procedure to update a Teamcenter item
UpdateZTblFctname of the procedure to update the status in z-table
InitFctinitialize function, called at the beginning
CleanUpFctclean up function, called at the end
T4Targetdefines the used base product feature (e.g. T4S) to execute the batch job, if not specified the default T4X is used.
TypeImport object type used in the reverse mapping function

Sample code sequence

1 set Status [::T4X::BATCHJOB::IMPORT::CreateImportCodeProxy "T4S_IMPORT_MM" "::T4S::CONNECTION2SAP::checkConnection2SAP4Batchjob" "::T4S::ZPTC::verifyZTableIdStatus" "::T4S::MM::CUSTOM::ITEM::IMPORT::getMaterialMasterInfo" "::T4S::MM::CUSTOM::ITEM::IMPORT::selectTC_Object" "::T4S::MM::CUSTOM::ITEM::IMPORT::createTC_Object" "::T4S::MM::CUSTOM::ITEM::IMPORT::SAP_MaterialMasterMapping2TC_Object" "::T4X::TC::MAPPING::storeReverseMapping2TcObject3" "::T4S::MM::CUSTOM::ITEM::IMPORT::updateTC_Object" "::T4S::ZPTC::Set_ZPTC_Status" "NONE" "::T4S::MM::CUSTOM::ITEM::IMPORT::cleanUp" "T4S" "MaterialMaster"]
Returns
OK or ERROR information

References T4X::BATCHJOB::TOOLBOX::setBatchjobDefaults().

◆ CreateImportMetaCodeProxy()

T4X::BATCHJOB::IMPORT::CreateImportMetaCodeProxy   FunctionName ConnectFct VerifyZTblFct ImportFct UpdateZTblFct InitFct CleanUpFct ?T4Target? args  

This function creates a generic import batch job code.

Parameters
FunctionNamename of the procedure to create
ConnectFctname of the procedure to connect the ERP
VerifyZTblFctname of the procedure to read the z-table
ImportFctname of the procedure to import the meta data to the Teamcenter
UpdateZTblFctname of the procedure to update the status in z-table
InitFctinitialise function, called at the beginning
CleanUpFctclean up function, called at the end
T4Targetdefines the used base product feature (e.g. T4S) to execute the batch job

Sample code sequence

1 set Status [::T4X::BATCHJOB::IMPORT::CreateImportMetaCodeProxy "T4S_IMPORT_META" "::T4S::CONNECTION2SAP::checkConnection2SAP4Batchjob" "::T4S::ZPTC::verifyZTableIdStatus" "::T4S::META::IMPORT::CUSTOM::JOB::executeImportMetaJob2Tc" "::T4S::ZPTC::Set_ZPTC_Status" "NONE" "::T4S::META::IMPORT::CUSTOM::JOB::cleanUp" "T4S"]
Returns
OK or ERROR information

References T4X::BATCHJOB::TOOLBOX::setBatchjobDefaults().

◆ createJob()

T4X::BATCHJOB::IMPORT::createJob   FunctionName JobAttributeDict  

This function creates batch job to import SAP/ESB/... item to Teamcenter.

Remarks
By setting the variable ::T4X::BATCHJOB::IMPORT::BatchjobDefaults(DelayBetweenJobCreation) it is possible to define how many milliseconds the job create wait until the function returns
Parameters
FunctionName- name of the import function created with the proxy call CreateImportCodeProxy/CreateImportBOMCodeProxy/CreateImportMetaCodeProxy
JobAttributeDictJobAtttribute structure with the following dict keys
  • BGS_CONID defines the used BGS host to create the job in the pool
  • JOB_DESCRIPTION - job description displayed in the Admin UI
  • JOB_TIMEOUT - job timeout in seconds (default is defined by the variable $T4X::BATCHJOB::IMPORT::BatchjobDefaults(BatchJobTimeout:$FunctionName))
  • JOB_TIME_WINDOW_START - defines the execution start time (HH:MM::SS) for a job, so that it is possible to define that a job is only executed during the night
  • JOB_TIME_WINDOW_END - defines the execution end time (HH:MM::SS) for a job, so that it is possible to define that a job is only executed during the night
  • ATTACHMENT_FILE_LIST - optional - list of file attachments for the job, if not specified the list will be empty
  • ATTACHMENT_STREAM_LIST - optional - list of stream attachments for the job, if not specified the list will be empty
  • HARD_DEPENDENCIES - optional - list of batch job Id on which this batch job depends on, set to empty list if not given
  • SOFT_DEPENDENCIES - optional - list of batch job Id on which this batch job depends on, set to empty list if not given
  • ImportJobAttributeDict dict

    ImportJobAttributeDict has the following dict keys
  • Function - name of the function
  • ImportObjectId - Object Id/Key string
  • TransferDirection - string for MonitorCounters example "SAP2TC", set to default "TC_IMPORT" if not specified
  • ZTabId z-table id - set to default "NONE"
  • SessionId - unique session ID for the Teamcenter session, set to BATCH
  • Filter4CLIENT - set to "NONE"
  • AdditionalInfo - optional - any additional info, set to NONE if not given
Returns
list of OK and batch job id or ERROR, MISSING_SETTING, MISSING_MANDATORY_KEY_FUNCTION, MISSING_MANDATORY_KEY_OBJECTKEY, UNKNOWN_IMPORT_FUNCTION, MISSING_MANDATORY_IMPORT_ATTRIBUTES

Sample code sequence

1 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::initJobAttributeStructure $ImportFunction $ObjectKey]
2 
3 #set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setJobDescription $JobAttributeDict "WILLI $ObjectKey"]; # overwrite Job Description shown in the Admin UI
4 
5 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setJobAttributes $JobAttributeDict JOB_TIMEOUT 3600]
6 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setJobAttributes $JobAttributeDict JOB_TIME_WINDOW_START 20:00]
7 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setJobAttributes $JobAttributeDict JOB_TIME_WINDOW_END 00:00]
8 
9 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobObjectId $JobAttributeDict $ObjectKey]
10 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobTransferDirection $JobAttributeDict SAP2TC]; # set identifier for monitoring counter
11 
12 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobAttributeDict $JobAttributeDict AdditionalInfo "My ADDITIONALINFO"]
13 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobAttributeDict $JobAttributeDict ZTabId "111"]
14 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobAttributeDict $JobAttributeDict Filter4CLIENT "*tpapps*"]
15 
16 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setImportJobAttributeDict $JobAttributeDict Willy "My custom attribute"]; # set use case specific job attribute
17 
18 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::addFileAttachment $JobAttributeDict "[rcwd]/var/upload/test.txt"]
19 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::addFileAttachment $JobAttributeDict "[rcwd]/var/upload/test.xml"]
20 
21 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::addStreamAttachment $JobAttributeDict MyStream1 {set x a; set y a}]
22 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::addStreamAttachment $JobAttributeDict MyStream2 {set x a; set y a}]
23 #
24 # DependencyDict
25 #
26 # add hard dependency list
27 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setHardDependencyList $JobAttributeDict 0f84cae156ab97ecad67680d]
28 # add soft dependency list
29 set JobAttributeDict [::T4X::BATCHJOB::IMPORT::setSoftDependencyList $JobAttributeDict aa398c0656ab93fb16cf8761]
30 #
31 set Status [catch {set ImportStatus [::T4X::BATCHJOB::IMPORT::createJob $ImportFunction $JobAttributeDict]}]
32 puts "XXXXXXXXXXX createBatchjob Status = [lindex $ImportStatus 0] - batchId [lindex $ImportStatus 1]"
33 if {[lindex $ImportStatus 0] != "OK"} {
34  if {[catch {puts [binary format {H*} [lindex $ImportStatus 1]]}] == 1} {puts [lindex $ImportStatus 1]}
35 }

References API::Core::Batch::connectTo(), T4X::CORE::convertTimeString2Secs(), API::Core::Batch::createJob(), API::Core::Batch::createObject(), API::Core::Batch::disconnect(), T4X::BATCHJOB::TOOLBOX::getDictValue(), API::Core::Batch::setDependency(), API::Core::Batch::setHardDependency(), API::Core::Batch::setJobAttachmentByStream2(), API::Core::Batch::setJobAttribute(), API::Core::Batch::setObjectAttribute(), API::Core::Batch::setSoftDependency(), and tpwrite().

◆ executeImportJob()

T4X::BATCHJOB::IMPORT::executeImportJob   FunctionName ImportObjectId ?TransferDirection? ?ZTabId? ?RunMode? ?AdditionalInfo? args  

This function starts the import batch job from ERP to TC.

Parameters
FunctionNamename of the procedure to call for the import
ImportObjectIdobject key
TransferDirectionstring for MonitorCounters example "SAP2TC"; initialised with "TC_IMPORT" if not given and the following parameter are not setFV
ZTabIdz-table id
RunModefor batch job mode has to be set to "BatchJob", anything else means no batch job mode; initialised with "BatchJob" if not given and the following parameter are not set
AdditionalInfoinitialised with "NONE"
Returns
OK or Error information

References ITK::ADMIN_set_bypass(), API::Core::Batch::getAttributeFromRawAttributeString(), T4X::CORE::getSessionLogChannel(), T4X::CORE::initStatusInfo(), T4X::CORE::resetLastErrorMessage(), T4X::BATCHJOB::TOOLBOX::setAttribute4TeamcenterSYSLOG(), ITK::setDefaultLogChannel(), T4X::BATCHJOB::TOOLBOX::setJobMessage(), T4X::CORE::setTransactionLogChannel(), T4X::TRANSLOG::startTransactionLog(), T4X::TRANSLOG::stopTransactionLog(), tpco_formatHEX16(), tpco_tcddelete(), tpwrite(), T4X::TRANSLOG::writeTcSysLogFileEntry(), and T4X::BATCHJOB::TOOLBOX::writeTcUser2LogIndex().

Referenced by executeImportJob2(), and handleBatchJob().

◆ executeImportJob2()

T4X::BATCHJOB::IMPORT::executeImportJob2   ImportDict args  

This function starts the import Batchjob from ERP to TC.

References executeImportJob(), T4X::BATCHJOB::TOOLBOX::getDictValue(), and tpwrite().

◆ handleBatchJob()

T4X::BATCHJOB::IMPORT::handleBatchJob   ExecuteFunction JobId ImportObjectId TransferDirection ZTabId AdditionalInfo  

This function makes necessary settings and checks (dependency), executes the import code and sets the batch job status.

Parameters
ExecuteFunctionname of the import function created with the proxy call
JobIdunique batch job id
ImportObjectIdobject key
TransferDirectionstring for MonitorCounters example "SAP2TC"
ZTabIdz-table id
AdditionalInfoadditional info
Returns
none

References API::Core::Batch::connectTo(), API::Core::Batch::disconnect(), executeImportJob(), ITK::getConnectionParameters(), T4X::BATCHJOB::TOOLBOX::logStatusInfo(), T4X::BATCHJOB::TOOLBOX::setBatchjobStatus(), T4X::BATCHJOB::TOOLBOX::setJobMessage(), and tpwrite().

◆ initJobAttributeStructure()

T4X::BATCHJOB::IMPORT::initJobAttributeStructure   FunctionName ObjectString  

This function initializes the JobAttribute buffer argument of the new createJob call.

Parameters
FunctionName- name of the import function created with the proxy call CreateImportCodeProxy/CreateImportBOMCodeProxy/CreateImportMetaCodeProxy
ObjectString- used to define the job description (displayed in the Admin UI) the description is set to "$FunctionName: $ObjectString"
Returns
returns a initialized JobAtttribute structure with the following dict keys
  • BGS_CONID - defines the used BGS host, is initialized with the default BGS host
  • JOB_DESCRIPTION - job description displayed in the Admin UI
  • JOB_TIMEOUT - job timeout in seconds (default is defined by the variable $T4X::BATCHJOB::IMPORT::BatchjobDefaults(BatchJobTimeout:$FunctionName))
  • JOB_TIME_WINDOW_START - defines the execution start time (HH:MM::SS) for a job, so that it is possible to define that a job is only executed during the night
  • JOB_TIME_WINDOW_END - defines the execution end time (HH:MM::SS) for a job, so that it is possible to define that a job is only executed during the night
  • ATTACHMENT_FILE_LIST - with an empty value
  • ATTACHMENT_STREAM_LIST - with an empty value
  • HARD_DEPENDENCIES - empty list of batch job Id on which this batch job depends on, using the hard dependency rule
  • SOFT_DEPENDENCIES - empty list of batch job Id on which this batch job depends on, using the soft dependency rule
  • ImportJobAttributeDict - dict

    ImportJobAttributeDict has the following dict keys
  • Function - name of the function
  • ImportObjectId - Object Id/Key string
  • TransferDirection - string for MonitorCounters example "SAP2TC", set to default "TC_IMPORT" if not specified
  • ZTabId z-table id - set to default "NONE"
  • SessionId - unique session ID for the Teamcenter session, set to BATCH
  • Filter4CLIENT - set to "NONE"
  • AdditionalInfo - optional - any additional info, set to NONE if not given

◆ procedureExists()

T4X::BATCHJOB::IMPORT::procedureExists   procedureName  

Generate Proxy for WebServer

::ProxyGen::createWebServer import_trigger_xi ::T4X::BATCHJOB::IMPORT::XI_Trigger_Import

◆ setHardDependencyList()

T4X::BATCHJOB::IMPORT::setHardDependencyList   DependencyDict DependencyList  

This function updates a dict with a list of hard dependencies.

Parameters
DependencyDictdict
DependencyListlist of dependencies
Returns
returns an updated DependencyDict buffer with the updated import job attribute value

◆ setImportJobAttributeDict()

T4X::BATCHJOB::IMPORT::setImportJobAttributeDict   JobAttributeDict ImportJobAttributeName NewValue  

This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob.

Remarks
There is no additional validation in the code that checks the ImportJobAttributeName for corrected
Parameters
JobAttributeDictdict
ImportJobAttributeNamedict key
NewValuenew value
Returns
returns an updated JobAttributeDict buffer with the updated import job attribute value

Referenced by setImportJobObjectId(), and setImportJobTransferDirection().

◆ setImportJobObjectId()

T4X::BATCHJOB::IMPORT::setImportJobObjectId   JobAttributeDict ImportObjectKey  

This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob.

Remarks
There is no additional validation in the code that checks the ImportJobAttributeName for corrected This function creates a buffer and that initializes the ImportJobAttributeDict argument of the new createJob call
Parameters
JobAttributeDictdict
ImportObjectKeyObject Key
Returns
returns an updated JobAttributeDict buffer with the updated import job ImportObjectKey attribute value

References setImportJobAttributeDict().

◆ setImportJobTransferDirection()

T4X::BATCHJOB::IMPORT::setImportJobTransferDirection   JobAttributeDict TransferDirection  

This function updates the internal ImportJobAttributeDict buffer that is used in the following createJob.

Parameters
JobAttributeDictdict
TransferDirectionstring for MonitorCounters example "SAP2TC"
Returns
returns an updated JobAttributeDict buffer with the updated import job TransferDirection attribute value

References setImportJobAttributeDict().

◆ setJobAttributes()

T4X::BATCHJOB::IMPORT::setJobAttributes   JobAttributeDict JobAttributeName NewValue  

This function sets the defined JobAttribute in the provided JobAttributeDict to the new specified value.

Parameters
JobAttributeDictdict
JobAttributeNamename of job attribute
NewValuenew value
Returns
returns a initialized JobAtttribute dict with the updated job description

Referenced by setJobDescription().

◆ setJobDescription()

T4X::BATCHJOB::IMPORT::setJobDescription   JobAttributeDict JobDescription  

This function sets the JobDescription in the provided JobAttributeDict.

Parameters
JobAttributeDictdict
JobDescriptionjob description displayed in the Admin UI
Returns
returns a initialized JobAtttribute dict with the updated job description

References setJobAttributes().

◆ setSoftDependencyList()

T4X::BATCHJOB::IMPORT::setSoftDependencyList   DependencyDict DependencyList  

This function updates a dict with a list of soft dependencies.

Parameters
DependencyDictdict
DependencyListlist of dependencies
Returns
returns an updated DependencyDict buffer with the updated import job attribute value

◆ updateStatus4ZTableId()

T4X::BATCHJOB::IMPORT::updateStatus4ZTableId   LogChannelName FunctionName ZTabId Status ?Error_Msg1? ?Error_Msg2? ?Error_Msg3? args  

This function updates status of given entry in the Z-Table.

Parameters
LogChannelNamechannel for the logging
FunctionNamez-table update procedure name
ZTabIdz-table id
StatusOK / SKIPPED / ERROR
Error_Msg1optional, initialised with "" if not given and the following parameter are not set
Error_Msg2optional, initialised with "" if not given and the following parameter are not set
Error_Msg3optional, initialised with "" if not given
Returns
none

References tpwrite(), and writeTransactionLog().

◆ writeTransactionLog()

T4X::BATCHJOB::IMPORT::writeTransactionLog   AppLogTransactionId FunctionName Status args  

This function writes the given information to the transaction log.

Parameters
AppLogTransactionIdtransaction log
FunctionNamefunction name
Statusstatus
argslist of messages
Returns
none

References T4X::CORE::getSessionLogChannel(), tpwrite(), and T4X::TRANSLOG::writeImportStatusInfoLog().

Referenced by updateStatus4ZTableId().

Variable Documentation

◆ BatchjobDefaults

BatchjobDefaults
static

Namespace array buffer to define defaults for the Export Job processing. For each registered export job type a separate set of defaults are defined during the registration. The following array elements are defined ($FunctionName stands for the registered JobTypeName):

BatchjobDefaults(BatchJobPrio:$FunctionName) Defines the default priority in the job pool (default: 20)
BatchjobDefaults(BatchJobTimeout:$FunctionName) Defines the default job processing timeout for a job (default: 3600)
BatchjobDefaults(MaxRetryCounter:$FunctionName) Defines the maximum number of job execution retries in the case of a detected application error (default: 1)
BatchjobDefaults(DefaultRetryTime:$FunctionName) Defines a delay in seconds after a job the is sent into retry
BatchjobDefaults(useBypassPrivilege:$FunctionName) Activate the bypass privilege during the job execution (default: true)
In addition there is also a generic setting for the default execution time window:

BatchjobDefaults(DefaultTimeWindow) Defines the default job execution time window (default: "No TimeWindow")