Hattabitos | Posts: 24

getSigners() for a DocumentPackage

0 votes
I have a client that is having an issue where they are not getting an accurate list of signers for a transaction initiated in eSignLive through their Associate account. They have the following code to process notifications coming from eSignLive, but only the package sender is getting sent as the signer:
private List buildSigners(DocumentPackage documentPackage) {
              final List signers = new ArrayList();

              for (Map.Entry entry : documentPackage.getSigners().entrySet()) {
                     final com.silanis.esl.sdk.Signer eslSigner = entry.getValue();

                     final Signer signer = new Signer();
                     signer.setSignerId(eslSigner.getId());
                     signer.setFirstName(eslSigner.getFirstName());
                     signer.setLastName(eslSigner.getLastName());
                     signer.setEmailAddress(eslSigner.getEmail());
                     signer.setAuthenticationType(AuthenticationType.getByAuthenticationType(
                                  eslSigner.getAuthenticationMethod().name()));
                     signer.setSigningOrder(Integer.valueOf(eslSigner.getSigningOrder()));

                     signers.add(signer);
              }

              return signers;
       }

harishaidary | Posts: 1812

Reply to: getSigners() for a DocumentPackage

1 votes
Can your client try this:
private static List buildSigners(DocumentPackage documentPackage) {
        
		List signers = new ArrayList();

        for (Signer entry : documentPackage.getSigners()) {
        	
        	Signer signer = newSignerWithEmail(entry.getEmail())
        			.withFirstName(entry.getFirstName())
        			.withLastName(entry.getLastName())
        			.withCustomId(entry.getId())
        			.signingOrder(entry.getSigningOrder())
        			.withAuthentication(entry.getAuthentication())
        			.build();
        			
               signers.add(signer);
        }

        return signers;
 }
Let me know if it works for him.

erinjbockgmail-com | Posts: 3

Reply to: getSigners() for a DocumentPackage

0 votes
This is not an accurate way to iterate through the Signer map returned by documentPackage.getSigners().

harishaidary | Posts: 1812

Reply to: getSigners() for a DocumentPackage

0 votes
Hey Erin, Are you referring to my post or the previous one? If you are replying to my post, my code works with the latest SDK. What version are you using? If you are replying to the original post, I couldn't the code to work on my end. That's why I suggested something else.

erinjbockgmail-com | Posts: 3

Reply to: getSigners() for a DocumentPackage

0 votes
Oh I was referring to your post, your code doesn't work for me but the first code does. Using SDK 10.8.3. Thanks for your suggestion though!

harishaidary | Posts: 1812

Reply to: getSigners() for a DocumentPackage

0 votes
My pleasure. Good to know that the original code works in 10.8.3. I would suggest always trying to use the latest SDK for the best possible experience :)

erinjbockgmail-com | Posts: 3

Reply to: getSigners() for a DocumentPackage

0 votes
I upgraded to the new SDK and still experienced the issue. Turns out we were retrieving Signers upon event notification "Package_Create" and the signers are not added to the package yet when the "Package_Create" notification is sent. Thanks again for your help.

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