Getting the File Directory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting the File Directory

jinHo
Anyone know how to get the full file directory from the file that is just
read?
The nm values in the Properties > FileBC is not working



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Getting the File Directory

OpenESB Community Forum mailing list
Hi,

I tested this, and found that <My Input Message> -> Properties -> File BC ->
Inbound -> File Directory & File Name work exactly as you would expect - the
former containing the directory from which the file was read, and the latter
the name of the file

Dave.

-----Original Message-----
From: User <[hidden email]> On Behalf Of jinHo
Sent: 07 May 2019 10:36
To: [hidden email]
Subject: [User] Getting the File Directory

Anyone know how to get the full file directory from the file that is just
read?
The nm values in the Properties > FileBC is not working



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Getting the File Directory

OpenESB Community Forum mailing list
Here are the process files used to test this - you'll want to change the path
and probably the names


---- FilePoll.wsdl ----
<definitions name="newWSDL"
targetNamespace="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:file="http://schemas.sun.com/jbi/wsdl-extensions/file/"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
    <types/>
    <message name="PollInputMessage">
        <part name="part1" type="xsd:string"/>
    </message>
    <message name="PollOutputMessage">
        <part name="part1" type="xsd:string"/>
    </message>    
    <portType name="FileInboundPortType">
        <operation name="poll">
            <input name="input1" message="tns:PollInputMessage"/>
            <output name="output1" message="tns:PollOutputMessage"/>
        </operation>
    </portType>
    <binding name="FileInboundBinding" type="tns:FileInboundPortType">
        <file:binding/>
        <operation name="poll">
            <file:operation verb="poll"/>
            <input name="input1">
                <file:message fileName="input.xml" pollingInterval="1000"
use="literal" part="part1"/>
            </input>
            <output name="output1">
                <file:message fileName="output.xml" use="literal"
part="part1" />
            </output>
        </operation>
    </binding>
    <service name="FileInboundService">
        <port name="newWSDL_InboundPort" binding="tns:FileInboundBinding">
            <file:address fileDirectory="H:\logs" recursive="false"/>
        </port>
    </service>
    <plnk:partnerLinkType name="newWSDL">
       
        <plnk:role name="FileInboundPortTypeRole"
portType="tns:FileInboundPortType"/>
    </plnk:partnerLinkType>
</definitions>



---- PathTest.bpel ----
<?xml version="1.0" encoding="UTF-8" ?>
<process
    name="pathTest"
    targetNamespace="http://enterprise.netbeans.org/bpel/PathTest/pathTest"
    xmlns:tns="http://enterprise.netbeans.org/bpel/PathTest/pathTest"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
   
xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace"
   
xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"
   
xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment"
   
xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling"
xmlns:sxnmp="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/NMProperty">
    <import namespace="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
location="FilePoll.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <partnerLinks>
        <partnerLink name="PartnerLink1"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
partnerLinkType="tns:newWSDL" myRole="FileInboundPortTypeRole"/>
    </partnerLinks>
    <variables>
        <variable name="PollOut"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
messageType="tns:PollOutputMessage"/>
        <variable name="PollIn"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
messageType="tns:PollInputMessage"/>
    </variables>
    <sequence>
        <receive name="Receive1" createInstance="yes"
partnerLink="PartnerLink1" operation="poll"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
portType="tns:FileInboundPortType" variable="PollIn"/>
        <assign name="Assign1">
            <copy>
                <from>concat(sxnmp:getVariableNMProperty('PollIn',
'org.glassfish.openesb.file.inbound.filedirectory'), '  ',
sxnmp:getVariableNMProperty('PollIn',
'org.glassfish.openesb.file.inbound.filename'))</from>
                <to variable="PollOut" part="part1"/>
            </copy>
        </assign>
        <reply name="Reply1" partnerLink="PartnerLink1" operation="poll"
xmlns:tns="http://j2ee.netbeans.org/wsdl/PathTest/src/newWSDL"
portType="tns:FileInboundPortType" variable="PollOut"/>
    </sequence>
</process>




--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/