Possible bug in com.silanis.esl.sdk.SignatureStyle.java
Thursday, November 9, 2017 at 06:41amThis is related to a post by CConverse_lm over a year ago Getting an exception using FULL_NAME + INITIALS signature styles in one document. To summarize the issue: a package is created and Sent with a document that has both INITIALS and FULL_NAME signature styles. The package send succeeds without issue. Then, the package is retrieved using EslClient.getPackage. At this point, all of the FULL_NAME signature styles have unexpectedly changed to ACCEPTANCE. I believe the issue resides in the SignatureStyle.java class. I believe the bug is on line 10:
public static final SignatureStyle ACCEPTANCE = new SignatureStyle("FULLNAME", "ACCEPTANCE", 0);
Shouldn't this new SignatureStyle be instantiated with an apiValue of "ACCEPTANCE" instead of "FULLNAME" ? Could this bug be causing the issue we are seeing with attempting to update the package with some other minor changes to it?
Reply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java
Thursday, November 9, 2017 at 07:36amReply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java
Thursday, November 9, 2017 at 08:12amSystem.out.println("List Signature Style for Documents in Package before calling CreatePackage()"); listSignatureStylesForDocuments(pkg); System.out.println("Call CreatePackage()"); packageId = eslClient.createPackage( pkg ); System.out.println("Call getPackage()"); DocumentPackage createdPackage = eslClient.getPackage(packageId); System.out.println("List Signature Style for Documents in Package from calling getPackage()"); listSignatureStylesForDocuments(createdPackage); System.out.println("Update the package with changes."); eslClient.updatePackage(packageId, createdPackage); -------------------------------- void listSignatureStylesForDocuments(DocumentPackage pkg) { int docNumber = 1; for(Document document : pkg.getDocuments()) { System.out.println(" > Document # " + docNumber + " (" + document.getName() + ") Signatures:"); for (Signature signature : document.getSignatures()) { System.out.println("Signature id:" + signature.getId() + " Style: " + signature.getStyle()); } docNumber++; } }The output looks like this: List Signature Style for Documents in Package before calling CreatePackage() > Document # 1 (Application) Signatures: Signature id:null Style: FULL_NAME Signature id:null Style: INITIALS Call CreatePackage() Call getPackage() List Signature Style for Documents in Package from calling getPackage() > Document # 1 (Electronic Disclosures and Signatures Consent) Signatures: > Document # 2 (Application) Signatures: Signature id:zHloZyW9nBIB Style: ACCEPTANCE Signature id:n30t2WCfno0V Style: INITIALS Update the package with changes. com.silanis.esl.sdk.EslException: It is not allowed to use acceptance signature styles and other signature styles together in one document. at com.silanis.esl.sdk.EslClient.validateMixingSignatureAndAcceptance(EslClient.java:289) at com.silanis.esl.sdk.EslClient.validateSignatures(EslClient.java:276) at com.silanis.esl.sdk.EslClient.updatePackage(EslClient.java:231)Reply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java
Wednesday, November 15, 2017 at 05:24amEslClient esl = new EslClient(info.API_KEY_SANDBOX, info.API_URL_SANDBOX); DocumentPackage pkg = PackageBuilder.newPackageNamed("Package with Initials and Fullname") .withSigner(SignerBuilder.newSignerWithEmail("[email protected]") .withFirstName("John") .withLastName("Smith") .withCustomId("Signer1")) .withDocument(DocumentBuilder.newDocumentWithName("test doc") .fromFile("C:/Users/hhaidary/Desktop/pdfs/doc1.pdf") .withSignature(SignatureBuilder.initialsFor("[email protected]") .atPosition(100, 100) .onPage(0)) .withSignature(SignatureBuilder.signatureFor("[email protected]") .atPosition(100, 200) .onPage(0))) .build(); PackageId packageId = esl.createPackage(pkg); System.out.println(packageId); DocumentPackage retrievedPackage = esl.getPackage(packageId); List docs = retrievedPackage.getDocuments();
for(Document doc : docs) {
Collection sigs = doc.getSignatures();
for (Signature sig : sigs) {
System.out.println(sig.getStyle().toString());
}
} And I got INITIALS and FULL_NAME respectively as signature styles. Would you be able to send me your complete code to [email protected]?