Previous Next JavaScript must be enabled to correctly display this content

## FileReceived

The third-party application users can send this POST FileReceived REST service request to perform operations such as, activity creation and processing, inserting data, providing quote details and performing illustrations.

The FileReceived API uses mandatory AsFile configurations to perform several operations on OIPA entities such as creation and post-insert processing of activities. AsFile as part of OIPA SOAP web services allows incoming data in the form of XML, which is processed and inserted directly into the database. The AsFile has two parts, XSLT and XML data, which need to be configured to send an XML request for processing. The FileReceived API accepts the Payload in JSON and XML formats, uses the AsFile configuration for processing them.

Configuration and Pre-requisites

- The configuror should create a configuration in AsFile Input and Output (XML and XSLT) in the Rules Palette to implement a FileReceived request.
- The properties in the payload request should be in the same format as defined in the AsFile configuration.
- The request payload should contain all the properties required as per the mapping described in the AsFile configuration.

Process Flow

- Once the Service Layer receives the Payload, it will continue to execute the existing flow of SOAP FileReceived web service and will execute the PreInsert and PostInsert Operations.
- As per the success/validation result of the executed operations, the responses are built and the Service Layer will send the response to the requester with appropriate HTTP status codes.

Note:

As a best practice, this API is recommended to be used for the entities for which PreInsert and PostInsert processing is required like activity creation and its immediate processing.

- To see the request and response examples (JSON/XML) for this configuration, refer FileReceived API.

- The following Sample XSLT and XML AsFile configurations can be used to send the FileReceived request either in XML/JSON formats:

Sample XSLT Configuration

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:helper="com.adminserver.webservice.helper.XsltFunctionHelper" extension-element-prefixes="helper" version="2.0">
    	<xsl:param name="SystemDate"/>
    	<xsl:param name="PolicyGuid"/>
    	<xsl:param name="PolicyName"/>
    	<xsl:param name="PolicyNumber"/>
    	<xsl:param name="CompanyGuid"/>
    	<xsl:param name="PlanGuid"/>
    	<xsl:param name="ParentCompanyGUID"/>
    	<xsl:param name="ActivityGuid"/>
    	<xsl:param name="ActivityClientNumber"/>
    	<xsl:param name="TransactionGuid"/>
    	<xsl:param name="TransactionName"/>
    	<xsl:param name="ProcessingOrder"/>
    	<xsl:param name="SuspenseGuid"/>
    	<xsl:param name="SuspenseNumber"/>
    	<xsl:template match="NewActivity">
    		<xsl:element name="AsXml">
    			<!-- Build Activity -->
    			<xsl:for-each select="/NewActivity/Transaction">
    				<xsl:element name="AsActivity">
    					<xsl:element name="ActivityGuid">
    						<xsl:value-of select="./ActivityGuid"/>
    					</xsl:element>
    					<!--xsl:element name="ActivityGuid">
    						<xsl:value-of select="$ActivityGuid"/>
    					</xsl:element-->
    					<xsl:element name="TransactionGuid">
    						<xsl:value-of select="./TransactionGuid"/>
    					</xsl:element>
    					<xsl:element name="PolicyGuid">
    						<xsl:value-of select="$PolicyGuid"/>
    					</xsl:element>
    					<xsl:element name="TypeCode">
    						<xsl:value-of select="./TypeCode"/>
    					</xsl:element>
    					<xsl:element name="StatusCode">
    						<xsl:value-of select="./StatusCode"/>
    					</xsl:element>
    					<xsl:element name="EffectiveDate">
    						<!--xsl:call-template name="getGMT"/-->
    						<xsl:value-of select="./EffectiveDate"/>
    					</xsl:element>
    					<xsl:element name="ActiveFromDate">
    						<xsl:value-of select="$SystemDate"/>
    					</xsl:element>
    					<xsl:element name="ClientNumber">
    						<xsl:value-of select="$ActivityClientNumber"/>
    					</xsl:element>
    					<xsl:element name="ProcessingOrder">
    						<xsl:value-of select="./ProcessingOrder"/>
    					</xsl:element>
    					<xsl:element name="EntryGmt">
    						<xsl:call-template name="getGMT"/>
    					</xsl:element>
    					<xsl:element name="CreationGmt">
    						<xsl:call-template name="getGMT"/>
    					</xsl:element>
    					<xsl:element name="ErrorStatusCode">
    						<xsl:value-of select="'01'"/>
    					</xsl:element>
    					<xsl:element name="SuspenseStatusCode">
    						<xsl:value-of select="'01'"/>
    					</xsl:element>
    					<xsl:element name="XmlData">
    						<xsl:text disable-output-escaping="no">
    							<Activity></Activity>
    						</xsl:text>
    					</xsl:element>
    					<xsl:element name="ActivityFields">
    						<xsl:for-each select="./ActivityFields/Field">
    							<xsl:variable name="fieldXml">
    								<xsl:copy-of select="."/>
    							</xsl:variable>
    							<xsl:apply-templates select="$fieldXml/*" mode="buildActivityField">
    								<xsl:with-param name="ActivityGuid">
    									<xsl:value-of select="./ActivityGuid"/>
    								</xsl:with-param>
    							</xsl:apply-templates>
    						</xsl:for-each>
    					</xsl:element>
    				</xsl:element>
    								<xsl:if test="./SuspenseCode = '1'">
    					<xsl:element name="AsActivitySuspense">
    						<xsl:element name="ActivityGuid">
    							<xsl:value-of select="./ActivityGuid"/>
    						</xsl:element>
    						<xsl:element name="SuspenseGuid">
    							<xsl:value-of select="$SuspenseGuid"/>
    						</xsl:element>
    						<xsl:element name="SuspenseSequence">
    							<xsl:value-of select="'00'"/>
    						</xsl:element>
    						<xsl:element name="SpecifiedAmount">
    							<xsl:value-of select="./SpecifiedAmount"/>
    						</xsl:element>
    					</xsl:element>
    				</xsl:if>
    			</xsl:for-each>
    									<!-- Adds Policy Allocations  to the Activity-->
    			<xsl:for-each select="/NewActivity/Transaction/Allocations">
    				<AsAllocation>
    					<xsl:variable name="NewAllocationGroupGuid" select="helper:getNextGUID()"/>
    					<!--xsl:variable name="fundname" select="$fundname"/-->
    					<xsl:variable name="NewAllocationGuid" select="helper:getNextGUID()"/>
    					<AllocationGuid>
    						<xsl:value-of select="$NewAllocationGuid"/>
    					</AllocationGuid>
    					<GroupGuid>
    						<xsl:value-of select="$NewAllocationGroupGuid"/>
    					</GroupGuid>
    					<TypeCode>
    						<xsl:value-of select="./Fund/AllocationCode"/>
    					</TypeCode>
    					<RelatedGuid>
    						<xsl:value-of select="./Fund/RelatedGuid"/>
    					</RelatedGuid>
    					<!-- Adds Fund1 Details to the Policy-->
    					<FundGuid>
    						<xsl:value-of select="./Fund/FundGuid"/>
    					</FundGuid>
    					<AllocationMethodCode>01</AllocationMethodCode>
    					<AllocationAmount>0</AllocationAmount>
    					<AllocationUnits>0</AllocationUnits>
    					<AllocationPercent>
    						<xsl:value-of select="./Fund/FundPercent"/>
    					</AllocationPercent>
    					<PercentInAllocation>
    						<xsl:value-of select="./Fund/FundPercent"/>
    					</PercentInAllocation>
    				</AsAllocation>
    			</xsl:for-each>
    			<!-- Adds Withholdings  to the Activity-->
    			<xsl:for-each select="/NewActivity/Transaction/Withholdings">
    				<xsl:element name="AsWithholding">
    					<xsl:element name="WithholdingGuid">
    						<xsl:value-of select="./WithholdingGuid"/>
    					</xsl:element>
    					<xsl:element name="TypeCode">
    						<xsl:value-of select="./TypeCode"/>
    					</xsl:element>
    					<xsl:element name="RelatedGuid">
    						<xsl:value-of select="./ActivityGuid"/>
    					</xsl:element>
    					<xsl:element name="XmlData">
    						<xsl:text disable-output-escaping="no">
    							<Activity></Activity>
    						</xsl:text>
    					</xsl:element>
    					<xsl:element name="WithholdingFields">
    						<xsl:for-each select="./WithholdingFields/Field">
    							<xsl:variable name="fieldXml">
    								<xsl:copy-of select="."/>
    							</xsl:variable>
    							<xsl:apply-templates select="$fieldXml/*" mode="buildWithholdingField">
    								<xsl:with-param name="WithholdingGuid">
    									<xsl:value-of select="/NewActivity/Transaction/Withholdings/WithholdingGuid"/>
    								</xsl:with-param>
    							</xsl:apply-templates>
    						</xsl:for-each>
    					</xsl:element>
    				</xsl:element>
    			</xsl:for-each>
    		</xsl:element>
    	</xsl:template>
    <xsl:template match="*" mode="buildWithholdingField">
    		<xsl:param name="WithholdingGuid"/>
    		<xsl:variable name="TypeCode">
    			<xsl:value-of select="./TypeCode"/>
    		</xsl:variable>
    		<xsl:variable name="Value">
    			<xsl:value-of select="./Value"/>
    		</xsl:variable>
    		<xsl:variable name="OptionText">
    			<xsl:value-of select="./OptionText"/>
    		</xsl:variable>
    		<xsl:variable name="OptionTextFlag">
    			<xsl:value-of select="./OptionTextFlag"/>
    		</xsl:variable>
    		<xsl:variable name="CurrencyCode">
    			<xsl:value-of select="./CurrencyCode"/>
    		</xsl:variable>
    		<xsl:variable name="BigTextValue">
    			<xsl:value-of select="./BigTextValue"/>
    		</xsl:variable>
    		<xsl:element name="AsWithholdingField">
    			<xsl:element name="WithholdingGuid">
    				<xsl:value-of select="$WithholdingGuid"/>
    			</xsl:element>
    			<xsl:element name="FieldName">
    				<xsl:value-of select="./Name"/>
    			</xsl:element>
    			<xsl:element name="FieldTypeCode">
    				<xsl:value-of select="$TypeCode"/>
    			</xsl:element>
    			<xsl:choose>
    				<xsl:when test="$TypeCode='01'">
    					<xsl:element name="DateValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:when test="$TypeCode='03'">
    					<xsl:element name="IntValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:when test="$TypeCode='04'">
    					<xsl:element name="FloatValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:element name="TextValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    					<xsl:element name="OptionText">
    						<xsl:value-of select="$OptionText"/>
    					</xsl:element>
    					<xsl:element name="OptionTextFlag">
    						<xsl:value-of select="$OptionTextFlag"/>
    					</xsl:element>
    				</xsl:otherwise>
    			</xsl:choose>
    			<xsl:element name="CurrencyCode">
    				<xsl:value-of select="$CurrencyCode"/>
    			</xsl:element>
    			<xsl:element name="BigTextValue">
    				<xsl:value-of select="$BigTextValue"/>
    			</xsl:element>
    		</xsl:element>
    	</xsl:template>
    	<xsl:template match="*" mode="buildActivityField">
    		<xsl:param name="ActivityGuid"/>
    		<xsl:variable name="TypeCode">
    			<xsl:value-of select="./TypeCode"/>
    		</xsl:variable>
    		<xsl:variable name="Value">
    			<xsl:value-of select="./Value"/>
    		</xsl:variable>
    		<xsl:variable name="OptionText">
    			<xsl:value-of select="./OptionText"/>
    		</xsl:variable>
    		<xsl:variable name="OptionTextFlag">
    			<xsl:value-of select="./OptionTextFlag"/>
    		</xsl:variable>
    		<xsl:variable name="CurrencyCode">
    			<xsl:value-of select="./CurrencyCode"/>
    		</xsl:variable>
    		<xsl:variable name="BigTextValue">
    			<xsl:value-of select="./BigTextValue"/>
    		</xsl:variable>
    		<xsl:element name="AsActivityField">
    			<xsl:element name="ActivityGuid">
    				<xsl:value-of select="$ActivityGuid"/>
    			</xsl:element>
    			<xsl:element name="FieldName">
    				<xsl:value-of select="./Name"/>
    			</xsl:element>
    			<xsl:element name="FieldTypeCode">
    				<xsl:value-of select="$TypeCode"/>
    			</xsl:element>
    			<xsl:choose>
    				<xsl:when test="$TypeCode='01'">
    					<xsl:element name="DateValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:when test="$TypeCode='03'">
    					<xsl:element name="IntValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:when test="$TypeCode='04'">
    					<xsl:element name="FloatValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:element name="TextValue">
    						<xsl:value-of select="$Value"/>
    					</xsl:element>
    					<xsl:element name="OptionText">
    						<xsl:value-of select="$OptionText"/>
    					</xsl:element>
    					<xsl:element name="OptionTextFlag">
    						<xsl:value-of select="$OptionTextFlag"/>
    					</xsl:element>
    				</xsl:otherwise>
    			</xsl:choose>
    			<xsl:element name="CurrencyCode">
    				<xsl:value-of select="$CurrencyCode"/>
    			</xsl:element>
    			<xsl:element name="BigTextValue">
    				<xsl:value-of select="$BigTextValue"/>
    			</xsl:element>
    		</xsl:element>
    	</xsl:template>
    	<xsl:template name="getGMT">
    		<xsl:value-of select="helper:getGmtTime()"/>
    	</xsl:template>
    </xsl:stylesheet>

Sample XML Asfile Configuration

    <File>
    	<AssignAttributes>
    		<Attribute NAME="SystemDate" TYPE="SYSTEMDATE"/>
    		<Attribute NAME="PolicyNumber" TYPE="XPATH">/NewActivity/PolicyNumber</Attribute>
    		<Attribute NAME="PolicyGuid" TYPE="SQL">SELECT PolicyGuid FROM AsPolicy WHERE PolicyNumber='[PolicyNumber]'</Attribute>
    		<Attribute NAME="ParentCompanyGUID" TYPE="SQL">SELECT CompanyGuid FROM AsCompany WHERE CompanyName='Prototype'</Attribute>
    		<Attribute NAME="PlanName" TYPE="XPATH">/NewActivity/PlanName</Attribute>

    		<Attribute NAME="PlanGuid" TYPE="SQL">SELECT PlanGuid FROM AsPlan WHERE PlanName = '[PlanName]'</Attribute>
    		<Attribute NAME="CompanyGuid" TYPE="SQL">SELECT CompanyGuid FROM AsPlan WHERE PlanGUID = '[PlanGuid]'</Attribute>
    		<Attribute NAME="SuspenseNumber" TYPE="XPATH">/NewActivity/SuspenseNumber</Attribute>
    		<Attribute NAME="SuspenseGuid" TYPE="SQL">select SuspenseGuid from AsSuspense where suspensenumber = '[SuspenseNumber]'</Attribute>
    		<Attribute NAME="ActivityClientNumber" TYPE="XPATH">/NewActivity/ClientNumber</Attribute>
    	</AssignAttributes>
    	<PostInsert>
            <Object CLASS="com.adminserver.pas.webservice.bll.AsFilePostInsertProcessPolicy">
                <Parameters>
                    <Parameter NAME="PolicyNumber">PolicyNumber</Parameter>
                    <ActivityMathResponse ALLMATHVARIABLES="Yes">
                        <Transaction TransactionGUID="GuidTransaction" ALLMATHVARIABLES="Yes"/>
                    </ActivityMathResponse>
                </Parameters>
            </Object>
        </PostInsert>