Generating and sending Negative End Response

A Negative End Response (NERP) is generated because a transmission of the file to the final destination failed or a processing of the file at the final destination failed.

Negative End Response (NERP) is generated because of one of the following reasons:
  • Transmission of the file to the final destination failed.
  • Processing of the file at the final destination failed.

If transmission of the file fails, then NERP is generated only if the problem is non-temporary. If the node that is transmitting the OFTP message is facing temporary problems, then it tries to retransmit the message after a specified duration.

File processing might fail because of syntax or semantic error, decryption, signature verification, decompression failure, or failure of any service that is used in the business process that is processing the file.

In both the cases, an NERP is sent to the originator of the file with appropriate reason text and reason code. The NERP is stored in the OFTP_OBJECT table and OFTP_OBJECT_EXT table. A user can search for the NERP in the Advanced Queue Search page also.
Remember: Reason text is not supported in OFTP 1.4 implementation. In OFTP 2.0 implementation, you must select the NERP Reason Text check box to receive reason text in the NERP.

Logical Partner Contract UI changes

The Logical Partner Contract page is modified to enable users to specify settings that are related to NERP generation. The following table describes the new user interface elements.
User interface element Description

Generate End Response after File Processing

If Generate End Response after File Processing is not selected, then an EERP is generated and sent to the sender after Sterling B2B Integrator receives the file. This is the default OFTP behavior in Sterling B2B Integrator.

If Generate End Response after File Processing is selected and mode is set to InLine, the inbound business process runs after a file is received. Depending on the success or failure of the business process, an NERP or End to End Response (EERP) is generated and sent to the sender.

If File processing is selected and mode is set to OffLine, the file that is received is stored in the system. The status of the file is set to RECEIVED_AND_WAIT_ERP. A user-defined BP must be manually run. The BP picks the files in the RECEIVED_AND_WAIT_ERP status, based on the Physical Partner Contract (PPC) or Logical Partner Contract (LPC) specified in the BP and processes them. Depending on the success or failure of the BP, NERP or EERP is generated and sent to the sender.

File processing mode

InLine - When the InLine option is selected, the file that is received is processed immediately, though not in the same session.

OffLine - When the OffLine option is selected, the file that is received is processed at a later stage, as required.

NERP Reason Text If this check box is selected, the reason text is included in the NERP in OFTP version 2.0 implementation.
The UI changes and settings that are related to NERP are applicable only for file processing and not certificate processing. For certificate processing, an NERP is sent to the originator with reason code 99, under the following scenarios:
  • The root CA certificate not available in Sterling B2B Integrator.
  • The CLID of the certificate does not match with the CLID record present in the system.
  • The certificate is listed in the Certificate Revocation List.

OFTPFileProcessingResponse service

A new service, OFTPFileProcessingResponse, supports the NERP implementation in Sterling B2B Integrator. This service is required for generating the end response after file processing is completed. For file processing in inline mode, the service must be added to the inbound BP. For file processing in offline mode, the service must be included in the user-defined BP. Sample BPs for inline and offline modes are provided in the following sections.

OFTP_GenerateEndResponse business process inline mode

<process name="OFTP_decipher_GenerateResponse">
<sequence name="decrypt">
<assign to="mode" from="'DECIPHER'" />
<!--
<assign to="MessageId">number</assign>
-->
<!-- Decipher document -->
<operation name="DecryptFile">
<participant name="OFTPQueueHandler" />
<output message="OFTPOut">
<assign to="." from="*"/>
</output>
<input message="OFTPIn">
<assign to="." from="*"/>
</input>
</operation>


	<operation name="GenerateEndResponse">
      <participant name="oftpFileProcessResponse"/>
      <output message="InputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
	
	<onFault>
  <sequence>
   <assign to="FILEPROCESS_FAIL">True</assign>
  <operation name="GenerateEndResponse">
      <participant name="oftpFileProcessResponse"/>
      <output message="InputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
  </sequence>
  </onFault>

</sequence>
</process>

OFTP_GenerateEndResponse business process offline mode

<process name="oftpofflinenew">
  <rule name="moreDocuments">
    <condition>currentDocIndex &lt;= totalDocCount</condition>
  </rule>

 <sequence name="Sequence Start">
  <sequence>
    <operation name="select document ids from OFTP_OBJECT table">
      <participant name="LightweightJDBCAdapterQuery"/>
      <output message="LightweightJDBCAdapterTypeInputMessage">
        <assign to="pool">mysqlPool</assign>
        <assign to="query_type">SELECT</assign>
        <assign to="result_name">DocumentID_Results</assign>
        <assign to="row_name">DOCUMENT</assign>
        <assign to="sql">SELECT DOCUMENT_ID FROM OFTP_OBJECT WHERE
					LPC = 'LPC_M1_M2_IN' AND STATUS IN( 'RECEIVED_AND_WAIT_ERP') </assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
		<assign to="." from="*"></assign>
      </input>
    </operation>
	
	<operation name="XML Encoder">
			<participant name="XMLEncoder"/>
				<output message="XMLEncoderTypeInputMessage">
					<assign to="." from="*"></assign>
					<assign to="exhaust_input">YES</assign>
					<assign to="mode">xml_to_process_data</assign>
					<assign to="output_to_process_data">YES</assign>
				</output>
				<input message="inmsg">
					<assign to="." from="*"></assign>
				</input>
		</operation>
	
	<assign to="totalDocCount" from="count
			(//ProcessData/DocumentID_Results/DOCUMENT/DOCUMENT_ID)"></assign>
	<assign to="currentDocIndex">1</assign>
	
	 <choice name="offlineProcessingLoop">
			<select>
				<case ref="moreDocuments" activity="doOfflineProcess"/>
			</select>
			
	 <sequence name="doOfflineProcess">
		<assign to="mode" from="'DECIPHER'"></assign>
        <assign to="FileProcessing">True</assign>	 
		<assign to="Response_DOC_ID" from="//ProcessData/DocumentID_Results/
				DOCUMENT[position()=//currentDocIndex/text()]/DOCUMENT_ID/text()"></assign>
		
			  <operation name="DecryptFile">
            <participant name="OFTPQueueHandler"/>
            <output message="OFTPOut">
              <assign to="." from="*"></assign>
            </output>
            <input message="OFTPIn">
              <assign to="." from="*"></assign>
            </input>
          </operation>

		   <operation name="GenerateEndResponse">
            <participant name="oftpFileProcessResponse"/>
            <output message="InputMessage">
              <assign to="." from="*"></assign>
            </output>
            <input message="inmsg">
              <assign to="." from="*"></assign>
            </input>
          </operation>
		  
		   <onFault>
            <sequence>
              <assign to="FILEPROCESS_FAIL">True</assign>
              <operation name="GenerateEndResponse">
                <participant name="oftpFileProcessResponse"/>
                <output message="InputMessage">
                  <assign to="." from="*"></assign>
                </output>
                <input message="inmsg">
                  <assign to="." from="*"></assign>
                </input>
              </operation>

            </sequence>
          </onFault>
		  
		   <assign to="currentDocIndex" from="currentDocIndex + 1"></assign>
		   <repeat ref="offlineProcessingLoop"/>
        </sequence>
      </choice>
    </sequence>
	
	</sequence>
</process>