I am working on a workflow to capture the original path before the entry moves. The value I am getting from "Entry Path" token is the new location of the entry after it moves. Is there a way to get the original path?
I am working on a workflow to capture the original path before the entry moves. The value I am getting from "Entry Path" token is the new location of the entry after it moves. Is there a way to get the original path?
Dim sourceParentPath as String = "" Dim uuid as Guid = me.StartingEntryInfo.Uuid Dim currentParent as Integer = me.StartingEntryInfo.ParentId Dim reader as ActivityLogReader = new ActivityLogReader(uuid, SortDirection.Descending, me.RASession) Try Dim count as Integer = 0 ' Only check up to the last 100 events for performance reasons while reader.Read() and count < 100 Dim activity as ActivityRecord = reader.Item if activity.ActivityType = ActivityType.MoveEntry then Dim moveActivity as MoveEntryActivity = activity ' Check the destination parent id to make sure its the move to the current folder. if moveActivity.DestinationParentId = currentParent then sourceParentPath = moveActivity.SourceParentPath exit While end if end if count = count + 1 end While WorkflowApi.SetTokenValue("path1", sourceParentPath, False) Finally reader.Close() end Try
I'll add a feature request to the product to get this information more directly and efficiently.
With a little bit of scripting you could get this from the activity log of the server. If using RepositoryAccess, use the ActivityLogReader class, pass in the uuid of the entry and look for the last move activity (MoveEntryActivity). The source parent path and id would be available. Be sure to check the destination properties to account for multiple move events happening in quick succession.
HI Ed,
I tried this and I was able to pass the UUID to ActivityLogReader to look for the last move activity but I couldn't figure out how to get the value in MoveEntryActivity. I can get to SourcePath from MoveEntryActivity but the session entry value is not being retrieved. Do you have a sample script for this? Any suggestion is appreciated
Below is what I tried ...
Dim MySession as Session = me.RASession
Thanks for your help
AJ
Who is doing the moving? Is a user moving it, or is there another workflow?
We would have to know more about the WF with events before the move. Is the document you are moving the starting entry? You could also add a Find Entry before the move step in the Workflow to get the path.
From the research I have done there is no way to get this information. I run into this problem too. The only token available on an entry move event is the final destination. However the entry deleted event does pass a token for the original destination. If only entry moved could do this as well.