Tuesday, 30 July 2013

Java Embedding in BPEL


Embed Activity : 

com.ge.cis.oraclesoa.renderintegration.ReadRenderAPI restobject = new com.ge.cis.oraclesoa.renderintegration.ReadRenderAPI();              
String Var=getVariableData("GetAnyVar").toString();                      
try{                              
  String resp=rest.readRenderAPI(Var);                           
  setVariableData("Result",resp);                          
    }                              
finally{                                                   
        addAuditTrailEntry("Result: ",restobject.getAuditAsString());  
  }


Java Code To Add AuditTril

private void addAuditTrailEntry(String pMessage) {
      mLog.append(pMessage).append(" \r\n");
  }

  public String getAuditAsString() {
      return mLog.toString();
  }


Java Code to Create BPEL Fault

import com.oracle.bpel.client.BPELFault; .

 javax.xml.namespace.QName errorQ =
              new javax.xml.namespace.QName("http://schemas.oracle.com/bpel/extension",
                                            "remoteFault");
          BPELFault fault =
              new BPELFault(errorQ, "Could not invoke: "+wsURL+" with verb: GET");
          fault.initCause(e); // Gives actuall fault info.
          addAuditTrailEntry(fault.toString()); // Returns error to audit train, when call in Embed activity
          throw fault;

No comments:

Post a Comment