mmathien | Posts: 3

Possible bug in com.silanis.esl.sdk.SignatureStyle.java

0 votes
This 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?

harishaidary | Posts: 1812

Reply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java

0 votes
Hi there, Would you be able to share your package creation code so I can run some tests on my end?

mmathien | Posts: 3

Reply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java

0 votes
Here is my code the has the calls to create and get package and also lists the Signature styles before createPackage and after getPackage.
System.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)

harishaidary | Posts: 1812

Reply to: Possible bug in com.silanis.esl.sdk.SignatureStyle.java

0 votes
Hi there, I apologize for the delay. I was very busy and overlooked this post. I am not able to reproduce this issue on my end. I am using the latest SDK (11.8). Here's the test code I ran:
EslClient 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]?

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off