You are viewing limited content. For full access, please sign in.

Question

Question

10.2 SDK Creation events causing issues with workflow starting rules

asked on October 22, 2019

As a solution provider, we have many products we have written for our customers.  We often integrate these products into various workflows to create a seamless process for our customers. Our software can be configured to post via the 8.3 SDK or the 10.2 SDK.  We have noticed that the way document creation happens when using the 8.3 SDK is different than using the 10.2 SDK. Checking to see if anyone else has had similar experiences/issues.  An example issue is described below.

 

Example Issue:

MVi has a product called LaserChecks that captures check information from a core processor and generates the check image and applies the appropriate authorization signature.  When the check is completed it is printed and a digital copy is passed to the Laserfiche repository.  Depending on the check, a workflow will look to see if this check is for an invoice that may already be in the repository.  If so, it will link the check in the checks folder to the invoice in its vendor folder.   

 

Here is the starting rule for the workflow that grabs the check and looks to see if there is a matching invoice in the system

Here is the issue, when using the 8.3 SDK the check is posted as a create event.  However, when using the 10.2 SDK the check is posted via two events.  The first is a create event that seems to create the placeholder record then a change event that seems to add the image pages and metadata. 

 

Here is the info on two checks posted a minute apart, the one highlighted in blue was posted via the 8.3 SDK and the other two (same entry name) were posted via the 10.2 SDK .  

 

Posting in two steps causes issues with our workflows since we try to just trigger on creation events and they fail because the metadata hasn't been posted yet.  We don't want to trigger on change events because someone may come in later and change the check by adding a sticky note, extra field data, or some other action that would then cause the check to go through the workflow and attach again to the invoice. We have also thought about adding a delay in the workflow on create events to wait for the document to be finished in the change event.   The issue is, the shortest delay we can put in the workflow is 1 minute.  We would like this to be a few seconds rather than a minute or more.  

Thoughts on how to make this work a little smother using the 10.2 SDK?

0 0

Answer

SELECTED ANSWER
replied on November 21, 2019

Switching from Document.Create to DocumentInfo.Create immediately places a lock on the document and prevents the Workflow create event from firing until the document is unlocked. Thank you.

1 0

Replies

replied on October 22, 2019

The issue might be the sequence of events in the code.

I created a versioning script a couple years back, and my initial attempts were creating new versions for each individual change because it was saving them as it went instead of applying all changes and saving the finished product.

What code, and order of events, are you using to create the document and apply the metadata?

Also, are you using Document or DocumentInfo objects?

4 0
replied on October 22, 2019

I will check with our developers.  I am pretty sure there aren't many if any differences in the code for posting via the two different SDKs.

0 0
replied on October 22, 2019

I think Jason Smith is on the right track. I'm guessing you've switched from LFSO to RA in the process and are using Document.Create to create documents. You want to use DocumentInfo.Create instead so the document is created and locked until you're done adding contents and fields.

3 0
replied on October 23, 2019

Thanks Miruna, I will pass this along to our dev team to see what they are using.

0 0
SELECTED ANSWER
replied on November 21, 2019

Switching from Document.Create to DocumentInfo.Create immediately places a lock on the document and prevents the Workflow create event from firing until the document is unlocked. Thank you.

1 0
replied on October 22, 2019

Make sure they are locking the document right after creating it. Workflow will check to see if it is locked and then will pick up the file after it is unlocked.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.