iahmed

Multiple Signers With Same Email - hand drawn

0 votes

Hi there,

I have been trying to update documents that have FULL_NAME signers to HAND_DRAWN signers using the JAVA SDK.

Problem is that when there are 2 signers with the same email, the second signer needs to draw every time for each field across documents instead of only once like the first signer.

I tried the approach mentioned in the blog post https://www.onespan.com/blog/onespan-sign-developer-multiple-signers-sharing-same-email, but this doesn't fix anything.

Hoping for some clarification and help please.

Thanks!

Imran


Reply to: Multiple Signers With Same Email - hand drawn

1 votes

Hi Imran,

 

It's a known limitation that the SDK only links signatures to signer's email, not role ID. I have raised the issue to R&D team, and at the same time, if it's not a regular use case, you can try below code as a workaround:

 

import java.util.ArrayList;
import java.util.List;

import com.silanis.esl.sdk.Document;
import com.silanis.esl.sdk.DocumentPackage;
import com.silanis.esl.sdk.EslClient;
import com.silanis.esl.sdk.PackageId;
import com.silanis.esl.sdk.Signature;
import com.silanis.esl.sdk.SignatureStyle;

 

    public void execute() {

        EslClient eslClient = new EslClient(API_KEY, API_URL);
        String packageId = "wxs04csQp8zWx8izNHoF2Pw94qc=";
        String roleId = "44e47190-9aa3-45f4-bf02-f234f90afae9";
        
        DocumentPackage pkg = eslClient.getPackage(new PackageId(packageId));
        
        List<String> signatureIds = new ArrayList<>();
        com.silanis.esl.api.model.Package apiPackage = eslClient.getPackageService().getApiPackage(packageId);
        for (com.silanis.esl.api.model.Document document : apiPackage.getDocuments()) {
            for (com.silanis.esl.api.model.Approval approval : document.getApprovals()) {             
                if(roleId.equals(approval.getRole())) {
                    for (com.silanis.esl.api.model.Field field : approval.getFields()) {
                        if(field.getType().equalsIgnoreCase("SIGNATURE") && field.getSubtype().equalsIgnoreCase("FULLNAME")) {
                            signatureIds.add(approval.getId());
                            break;
                        }
                    }
                }
            }
        }
        
        for (Document document : pkg.getDocuments()) {
            boolean isUpdate = false;
            for (Signature signature : document.getSignatures()) {
                if(signatureIds.contains(signature.getId().getId())) {
                    signature.setStyle(SignatureStyle.HAND_DRAWN);
                    isUpdate = true;
                }
            }
            if(isUpdate) {
                eslClient.getApprovalService().updateSignatures(pkg, document.getId().getId(), new ArrayList<Signature>(document.getSignatures()));
            }
        }
        
    }

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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