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

Question

Question

Last Modified - What Counts as a Modification?

asked on April 2, 2019

Hi all,

I'm configuring a workflow that keeps 2 separate repositories "synced" ("mirrored" is perhaps a more accurate term).

One of the requirements is that the workflow does not run multiple times concurrently for a given entry. This is straightforward--the WF gets the Last Modified Date the first time it runs and, right before ending, checks this value again. It calculates the difference between the two values and if the difference != 0, the WF invokes itself on the same entry again, to sync new changes to the other repository.

The issue I'm running into is, apparently manually renaming an entry doesn't update the Last Modified Date. However, manually renaming an entry does trigger starting rules using the "changed" event...

Can anyone provide some insight into how I might account for document name changes when performing the check before invoking the WF again? CAVEAT: no databases!!

Thank you!

Rob

0 0

Replies

replied on April 5, 2019

Rename is technically a move in the Laserfiche Server, but since most users think of it as a change, Workflow treats it as a change event.

You could have your workflow assign a tag to the document as the first step and remove it as the last. Then you can add "Tag X is not set" to your starting rule. If the tag is set, that will indicate another workflow is working on the entry.

1 0
replied on April 5, 2019 Show version history

Hi Miruna,

Thanks for the feedback. I'm already using a "Syncing" tag to "lock" the file and essentially do what you describe above. What I need to figure out is a way to detect any user interaction during the interim. If user interaction, invoke the WF on the current starting entry.

On the topic of moving entries, is there a straightforward way to log any event for the starting entry (including a move) and auto-invoke the WF on it if any occur? Say a user moves the relevant entry while it's being synced--it would be great if WF could pick up on this and rerun. I imagine this would be possible to do by querying the Audit Trail DB... Thoughts?

EDIT: I know I said "no DBs" above--I meant external, non-LF DBs.

Thanks!

Rob

0 0
replied on April 5, 2019

Hm, I think I need more information. What does this workflow do and how were you accounting for the modified date changing as a result of Workflow making modifications to the entry?

0 0
replied on April 8, 2019

The workflow is essentially picking up most types of events (change, move, delete, restore, create, copy), primarily for documents, in one of two repos. These repos are mirrored, meaning if we have \root1\path\to\doc\doc in one of the repos, then we have root2\path\to\doc\doc in the other.

I've attached a single .wfi file (changed extension to .txt in order to attach) for you to look at if that will help. It contains 4 WFs--one is to prep the repositories for testing the other 3 WFs. The other 3 WFs consist of 2 "outgoing" WFs that invoke a "syncing" WF that actually does the syncing between the repos. The "outgoing" WFs lock down the starting entry so the same WF cannot act on it until the current sync is complete. This is handled by applying a "Syncing" tag to the starting entry at the beginning of the outgoing WF, and all starting rules (except for Delete and Restore events) contain a "Tag (Syncing) is not set" condition. I am not worried about WF acting on the entry since it's not changing anything--I want to pick up any user changes that occur on the starting entry during a given sync instance.

  1. Event on entry -> "Outgoing" WF starts
    • "Syncing" tag assigned
    • Last Modified Date retrieved via Additional Properties in Find Entry activity
    • Syncing WF invoked 
  2. Syncing WF completes successfully
    • Last Modified Date retrieved same as above
    • Calculate difference between Last Modified Dates retrieved pre- and post-Sync WF invocation
    • "Syncing" tag removed in order that...
      • The "Outgoing" WF can be invoked if difference between timestamps != 0 or...
      • WF ends if difference = 0

 

And since renames, which count as moves, don't update Last Modified Date for an entry, the WF will not run again to sync the rename to the other repo using this approach.

However, the Admin Guide indicates that these events are tracked in Audit Trail so I imagine I can do a custom query against it for a more comprehensive look at any events that may have occurred on the entry while it was being synced by WF.

Thanks!

Rob

Syncing WFs.txt (232.38 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.