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

Question

Question

Enable Tracking - Issue with Workflow

asked on January 30, 2014

Dears,

 

We have a major issue in one of our big implementation which is related to the enable tracking feature. Some documents in the repository are enabled for tracking versions as different users need to create different versions of them. The main issue is that these documents needs to be updated sometimes by the workflow, this is creating many versions of the documents while this is not needed. Can the workflow user be excluded from the tracking version?

 

Thanks,

Dory Mina

 

 

1 0

Answer

APPROVED ANSWER
replied on January 30, 2014

No, the Workflow user cannot be excluded. All document changes are creating versions regardless of who makes them.

1 0

Replies

replied on January 30, 2014

You can use the Laserfiche SDK (via a SDK Script activity) to delete specific versions from the version history of a document.  However, you should be aware that doing so will cause your version history to have "gaps" in its version numbers.  Also, the current version of a document cannot be deleted, so if Workflow created the most recent version, it would still be listed.

 

You would use a script similar to the following in your SDK Script activity:

protected override void Execute()
{
    if (this.ScriptEntryInfo != null)
    {
        if (this.ScriptEntryInfo is DocumentInfo)
        {
            DocumentInfo doc = (DocumentInfo)this.ScriptEntryInfo;
            if (doc.IsUnderVersionControl)
            {
                VersionHistory history = doc.GetVersionHistory();

                for (int i = 0; i < history.Count; ++i)
                {
                    DocumentVersion version = history[i];

                    // replace "Workflow" with your Workflow User
                    if (version.Creator == "Workflow")
                    {
                        // write an appropriate note for why this version is being deleted
                        version.Delete("This version was deleted because it was created as part of a workflow.");
                    }
                }
            }
            else
            {
                this.WorkflowApi.TrackWarning("The document '{0}' is not version controlled.", doc.Name);
            }
        }
        else
        {
            this.WorkflowApi.TrackWarning("The entry '{0}' is not a document.", this.ScriptEntryInfo.Name);
        }
    }
    else
    {
        this.WorkflowApi.TrackWarning("No entry was specified.");
    }
}

 

One other thing to note is that you would still need to determine when you wanted the workflow to run.

5 0
replied on January 30, 2014

What version of Workflow are you using?

0 0
replied on January 30, 2014

9.1

0 0
replied on January 31, 2014

It is already done  but the problem is that the version history is incorrect and last version cannot be  deleted.

0 0
replied on January 31, 2014

By "It is already done", do you mean some documents have already been processed and thus have versions created by Workflow?  If so, just create a workflow that contains that script and run it on the documents that have "contaminated" version histories.  You could use a starting rule, a schedule + Search Repository activity, or the Run Workflow feature to reprocess the documents.

 

How are you using versions? Do you envision a document only having a new version when a user replaces the document? (e.g., this is the second draft of the agenda, therefore it's version 2).

0 0
replied on August 27, 2015

Following up on this topic, a year and version later, is it possible to limit version changes to a particular user? Or only report version changes when the Electronic Document changes? (Without SDK)

 

I have a complex approval workflow with quite a few control variables and collaborative "Notes" fields, I would like to use version control with Microsoft Word so my users can view the changes within word. However, I cannot use the comparison feature in a practical manner if there are 100's versions being saved for each metadata change.

0 0
replied on August 28, 2015

No, all document changes count for versioning. I'm not sure I understand what you mean by "100's versions being saved for each metadata change". One Workflow Assign Field Values activity setting multiple fields would only make one version.

0 0
replied on April 2, 2020

Is this still the case?

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

Sign in to reply to this post.