Search This Blog

xp20:format-dateTime - SOA- Custom format Date Time

xp20:format-dateTime - SOA- Custom format Date Time


Middleware  intreacts with mostly external system - Each system need some custom Date and Time format structure. Most of the time developers not remember Syntax .

Y001 - year
M01 - month
D01 - date
H01 - hour
m01 - minutes
s01   -  seconds
f001 - millsec

Use Ready Made functions:


xp20:format-dateTime(xp20:current-dateTime(),'[Y0001][M01][D01]_[H01][m01][s01]')


Including MillSeconds :

xp20:format-dateTime(xp20:current-dateTime(),'[M01]/[D01]/[Y0001] [H01]:[m01]:[s01].[f001]')

Universal Time format with T :


xp20:format-dateTime(xp20:current-dateTime(),"[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001]")

New Line Character in BPEL - SOA

New Line Character in BPEL - SOA :


My Requirement to create new line between two words.

Example :



Input    :  Krishna Moorthi
Output :  Krishna
              Moorthi

create BPEL variable varNewLine  and assign Values as "
"

Now use "Krishna"+ $varNewLine  + "Moorthi".

:-) :-)

File / FTP Adapter SOA - COPY / MOVE / DELETE Operation

File Adapter Move / Copy Operation :


File Adapter or FTP Adapter in 11g won't direct support in GUI mode.

In Some scenarios we need to perform move or copy   from one folder to another folder. Following code will support

FileMove.jca

MOVE Operation 
=================================================================
<adapter-config name="FileMove" adapter="File Adapter"
                wsdlLocation="FileMovet.wsdl"
                xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter"/>
    <endpoint-interaction portType="FileMove_ptt" operation="FileMove">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">
            <property name="SourcePhysicalDirectory" value="D:\Krishna"/>
            <property name="SourceFileName" value="HelloWorld.txt"/>
            <property name="TargetPhysicalDirectory" value="D:\Moorthi"/>
            <property name="TargetFileName" value="HelloWorldNew.txt"/>
            <property name="Type" value="MOVE"/>
        </interaction-spec>

    </endpoint-interaction>
</adapter-config>
=================================================================

COPY Operation 
=================================================================
<adapter-config name="FileMove" adapter="File Adapter"
                wsdlLocation="FileMovet.wsdl"
                xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter"/>
    <endpoint-interaction portType="FileMove_ptt" operation="FileMove">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">
            <property name="SourcePhysicalDirectory" value="D:\Krishna"/>
            <property name="SourceFileName" value="HelloWorld.txt"/>
            <property name="TargetPhysicalDirectory" value="D:\Moorthi"/>
            <property name="TargetFileName" value="HelloWorldNew.txt"/>
            <property name="Type" value="COPY"/>
        </interaction-spec>

    </endpoint-interaction>
</adapter-config>
=================================================================


DELETE Operation 
=================================================================
<adapter-config name="FileMove" adapter="File Adapter"
                wsdlLocation="FileMovet.wsdl"
                xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter"/>
    <endpoint-interaction portType="FileMove_ptt" operation="FileMove">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">
            <property name="TargetPhysicalDirectory" value="D:\Moorthi"/>
            <property name="TargetFileName" value="HelloWorldNew.txt"/>
            <property name="Type" value="DELETE"/>
        </interaction-spec>

    </endpoint-interaction>
</adapter-config>
=================================================================


Invoke Change in BPEL :


 <invoke name="Invoke1" inputVariable="Invoke1_FileMove_InputVariable"
                outputVariable="Invoke1_FileMove_OutputVariable"
                partnerLink="FileAdptMoveTest" portType="ns1:FileMove_ptt"
                operation="FileMove" bpelx:invokeAsDetail="no">
<bpelx:inputProperty name="jca.file.SourceDirectory" variable="sourceDirectory"/>
<bpelx:inputProperty name="jca.file.SourceFileName" variable="sourceFileName"/>
<bpelx:inputProperty name="jca.file.TargetDirectory" variable="targetDirectory"/>
<bpelx:inputProperty name="jca.file.TargetFileName" variable="targetFileName"/>
</invoke>