int nr = data.upsertResult.length; for ( int j = 0; j < nr; j++ ) { if ( data.upsertResult[j].isSuccess() ) { String id = data.upsertResult[j].getId(); if ( data.upsertResult[j].isCreated() ) { incrementLinesOutput(); if ( log.isDetailed() ) { com.sforce.soap.partner.Error err = data.upsertResult[j].getErrors()[0]; throw new KettleException( BaseMessages .getString( PKG, "SalesforceUpsert.Error.FlushBuffer", new Integer( j ), err.getStatusCode(), err for ( int i = 0; i < data.upsertResult[j].getErrors().length; i++ ) { com.sforce.soap.partner.Error err = data.upsertResult[j].getErrors()[i]; errorMessage += BaseMessages.getString( PKG, "SalesforceUpsert.Error.FlushBuffer", new Integer( j ), err
for (int i = 0; i < upsertResults.length; i++) { ++batch_idx; if (upsertResults[i].getSuccess()) { if (upsertResults[i].getCreated()) { handleSuccess(upsertItems.get(i), upsertResults[i].getId(), "created"); } else { handleSuccess(upsertItems.get(i), upsertResults[i].getId(), "updated"); handleReject(upsertItems.get(i), upsertResults[i].getErrors(), changedItemKeys, batch_idx);
for (int i = 0; i < upsertResults.length; i++) { ++batch_idx; if (upsertResults[i].getSuccess()) { handleSuccess(upsertItems.get(i), upsertResults[i].getId()); } else { handleReject(upsertItems.get(0), upsertResults[i].getErrors(), changedItemKeys, batch_idx);
public int upsert(DataPayload data) throws ResourceException { SObject toCreate = new SObject(); toCreate.setType(data.getType()); for (DataPayload.Field field : data.getMessageElements()) { toCreate.addField(field.name, field.value); } SObject[] objects = new SObject[] {toCreate}; UpsertResult[] results; try { results = partnerConnection.upsert(ID_FIELD_NAME, objects); } catch (InvalidFieldFault e) { throw new ResourceException(e); } catch (InvalidSObjectFault e) { throw new ResourceException(e); } catch (InvalidIdFault e) { throw new ResourceException(e); } catch (UnexpectedErrorFault e) { throw new ResourceException(e); } catch (ConnectionException e) { throw new ResourceException(e); } for (UpsertResult result : results) { if(!result.isSuccess()) { throw new ResourceException(result.getErrors()[0].getMessage()); } } return results.length; }
@Override public com.sforce.soap.partner.IUpsertResult newIUpsertResult() { return new com.sforce.soap.partner.UpsertResult(); }
for (int i = 0; i < upsertResults.length; i++) { ++batch_idx; if (upsertResults[i].getSuccess()) { if (upsertResults[i].getCreated()) { handleSuccess(upsertItems.get(i), upsertResults[i].getId(), "created"); } else { handleSuccess(upsertItems.get(i), upsertResults[i].getId(), "updated"); handleReject(upsertItems.get(i), upsertResults[i].getErrors(), changedItemKeys, batch_idx);
public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof UpsertResult)) return false; UpsertResult other = (UpsertResult) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && this.created == other.isCreated() && ((this.errors == null && other.getErrors() == null) || (this.errors != null && java.util.Arrays.equals(this.errors, other.getErrors()))) && ((this.id == null && other.getId() == null) || (this.id != null && this.id.equals(other.getId()))) && this.success == other.isSuccess(); __equalsCalc = null; return _equals; }
public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; _hashCode += (isCreated() ? Boolean.TRUE : Boolean.FALSE).hashCode(); if (getErrors() != null) { for (int i = 0; i < java.lang.reflect.Array.getLength(getErrors()); i++) { java.lang.Object obj = java.lang.reflect.Array.get(getErrors(), i); if (obj != null && !obj.getClass().isArray()) { _hashCode += obj.hashCode(); } } } if (getId() != null) { _hashCode += getId().hashCode(); } _hashCode += (isSuccess() ? Boolean.TRUE : Boolean.FALSE).hashCode(); __hashCodeCalc = false; return _hashCode; }