IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Attaching file to a record using the API

  • 1.  Attaching file to a record using the API

    Posted 05/27/16 02:39 PM

    Is there a way to upload one or more files to a record using the API? I can see this behavior using the web front end but can’t see any info in the wiki on how this is done through the API.

    Secondly, is there a way to upload files as part of creating the record or can it only be done after the record has been created?


    #webMethods-BPMS
    #webMethods
    #AgileApps


  • 2.  RE: Attaching file to a record using the API

    Posted 06/27/16 09:01 AM

    Hi Darren Lewis,

    I have a java snippet to take the image value from one object to another object. you can go through this. This code may help you…

    package com.platform.mounika.picktest;
    import com.platform.API.;
    import com.platform.API.mail.
    ;
    import com.platform.beans.;
    import java.util.
    ;

    public class pickImg
    {
    public void invoke(Parameters p) throws Exception
    {

    String id=p.get("id");
    PlatformFileBean file =null;
    String queryFrom="NewObjects";
    String queryWhat="image";
    String queryWhere="";
    Result queryResult=Functions.searchRecords(queryFrom,queryWhat,queryWhere);
    int SLAQueryCode = queryResult.getCode();
    ParametersIterator iterator = queryResult.getIterator();      
    while(iterator.hasNext())
    {
    Parameters SLAParams = iterator.next();
    String img =SLAParams.get("image");
    Result result = Functions.getDocument(img.split(":")[1]);
    Parameters params = result.getParameters();
    file =params.getPlatformFileBean(img.split(":")[1]);     
    }
    p.add("column_id","aaa");
    p.add("image",file);
    Result r=Functions.updateRecord("ImageObjects",id,p);
    }
    

    }

    Regards,
    Mounika


    #AgileApps
    #webMethods
    #webMethods-BPMS