B2B Integration

 View Only
  • 1.  Using Current Date Values In Business Process

    Posted 10 days ago

    For many clients, we currently use a business process to pull files from their server & directory path using SFTP.

    A new client has requested some customization of this process that I'm unsure how to accomplish within a BP.  They are wanting us to pull from a new directory path every day, where the structure is "server:/year/month/day" and the day is the current date at the time of the pull.

    Has anyone ever grabbed current date and used pieces of it to populate other values?  I've been searching through existing/out-of-the-box BPs in process manager looking for anything similar, but no such luck.  I'm assume I'll have to string values to create the directory path?



    ------------------------------
    Peter Milakovich
    ------------------------------


  • 2.  RE: Using Current Date Values In Business Process

    Posted 9 days ago

    Hi Peter,

    this should be quite an easy task with the time stamp utility service:

    Get the current date:

    <operation name="Timestamp Utility">
        <participant name="TimestampUtilService"/>
        <output message="TimestampUtilServiceTypeInputMessage">
            <assign to="action">current_time</assign>
            <assign to="format">yyyyMMdd</assign>
        </output>
        <input message="inmsg">
            <assign to="current_datetime" from="time/text()" append="true"/>
        </input>
    </operation>

    Then concat with some substring (I didn't check this so if all the xpath are correct, but you get what I want here I guess):

    <assign name="Assign" to="/ProcessData/server_path" from="concat('/server/',substring(string(/ProcessData/current_datetime),0,4),'/',substring(string(/ProcessData/current_datetime),4,2),'/',substring(string(/ProcessData/current_datetime),6,2),'/')"/>

    Best regards

    Manuel



    ------------------------------
    Manuel Frank
    Integration Architect
    Andreas STIHL AG & Co. KG
    Waiblingen
    ------------------------------



  • 3.  RE: Using Current Date Values In Business Process

    Posted 9 days ago

    Thank you!  I'll work with this and see how far I can get!  Appreciate the response!



    ------------------------------
    Peter Milakovich
    ------------------------------



  • 4.  RE: Using Current Date Values In Business Process

    Posted 9 days ago
    Since you use BP to initiate the connection to pull the files, the simplest solution would be to set the collection folder in the BP by co concatenation of the path with the date. There are other options also, but this to me seems the simplest and manageable.

    Sent from my iPhone




  • 5.  RE: Using Current Date Values In Business Process

    Posted 8 days ago

    I do this all the time with an archive BP, we file things into YYYY/mm/transaction_direction/dd folders using a timestamp service and we start with a directory base that is the archive main folder in prod/qas/dev depending on where the code is executing.

     

    <assign name="Year" to="Year" from="substring(string(/ProcessData/time),1,4)"></assign>

    <assign name="Month" to="Month" from="substring(string(/ProcessData/time),5,2)"></assign>

    <assign name="Day" to="Day" from="substring(string(/ProcessData/time),7,2)"></assign>

    <assign name="Destination" to="Destination" from="concat(string(/ProcessData/ArchiveDirectoryBase),&apos;\&apos;,string(/ProcessData/Year),&apos;\&apos;,string(/ProcessData/Month),&apos;\&apos;,string(/ProcessData/TransactionSetIDCode),&apos;_OB\&apos;,string(/ProcessData/Day))"></assign>

     

    You could do this to build the folder where you deliver.  We use a generic SFTP/FTP BP and the we build a wrapper BP that either does straight assigns or it builds the parms we pass to the generic BP.  So BP_Customer1_SFTP_GET sets some parms like filename, remote folder, local mailbox and then it calls the BP_SFTP_Generic to do the work based on those parms. 

     

    Samantha Scott

    Sr Manager Application Services

     

     






  • 6.  RE: Using Current Date Values In Business Process

    Posted 8 days ago

    Thank you!



    ------------------------------
    Peter Milakovich
    ------------------------------