It is possible to pass to a workflow a list of objects and object old versions - identified by version identifiers: the object id for current versions, and the object id + the time stamp of the version creation for old versions.
The complete list of object and object old version passed to the workflow is accessible with the new property 'ObjectIdVersions' of both SequentialWorkflow and NavigatorWorkflow.
There is the ObjectVersionsReplicator activity that enumerates the object version ids.
The activity LoadObjects has been modified so that it can load not only current objects but also old versions. It has a new property 'ObjectIdVersions' specifying the list of object version identifiers to load.
Here is a simmple 'export' sequential workflow that saves the XML of objects / object old versions to files:
<SequentialWorkflow
x:Name="main"
xmlns="http://www.teradp.com/schemas/GN4/1/Workflow/Activity"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="http://schemas.microsoft.com/winfx/2006/xaml/workflow"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DisplayProgress="false">
<ObjectVersionsReplicator
x:Name="replicator"
ObjectIdVersions="{wf:ActivityBind main, Path=ObjectIdVersions}">
<LoadObjects
x:Name="loadObjects"
ObjectIdVersions="{wf:ActivityBind replicator, Path=ObjectIdVersionsOut}">
<SaveXml
x:Name="saveXml"
XmlIn="{wf:ActivityBind loadObjects, Path=XmlOut}">
<Save
x:Name='save'
Data='{wf:ActivityBind saveXml, Path=DataOut}'
To='c:\temp\objs{0}.xml'
Mode='Overwrite'>
<Save.Pars>
<wf:WorkflowParameterBinding
ParameterName="p0"
Value="{wf:ActivityBind replicator,Path=CurrentIndex}"/>
</Save.Pars>
</Save>
</SaveXml>
</LoadObjects>
</ObjectVersionsReplicator>
</SequentialWorkflow>
when called like this:
cmd4 wf -name export -ids 3752 -userName xxxx -password yyyy
where xxxx is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and yyyy is the password.
Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.
saves the XML of the object with id 3752 to the file 'c:\temp\objs0.xml'; when called like this:
cmd4 wf -name export -ids 3752v2010-10-22T21:47:27.807Z -userName xxxx -password yyyy
where xxxx is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and yyyy is the password.
Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.
saves the XML of the old version of the object with id 3752 created on 2010-10-22T21:47:27.807Z to 'c:\temp\objs0.xml'.
The pre-existing property 'ObjectIds' of the SequentialWorkflow and NavigatorWorkflow is filled only the ids of the current objects - so in the first example above it will contain 3752, in the second example it will be empty - because the workflow has been called with only an object old version.