If we want to arrange the documents in a Specified Order after Execution,
We have to Create a new Action library Named as "RearrangeDocuments.rrx"
1.Open Notepad and paste the fallowing code in to it .
---------------------------------------------------------------------------------------------------------------------------
<?xml version='1.0' ?>
<rrx namespace="ReaarangeDoccuments" v="8.0.0"><i ref="rrunner.rrx"/><g>
<![CDATA[
'*********************************
'Rotation Actions
'rotation.rrx
'IBM Corporation (c)2011
' Version
' 8.0.0 - 06/01/2011 Tom Stuart
' - Original Scripting Class RRX File
'
'*********************************
]]></g>
<f name="RearrangeDoc" access="public" qi="Sample starter RRX Library">
<p name="OrderString"/>
<ap>
Document your parameters here<br/>
</ap>
<h>
Explain the usage of your action here<br/>
<e>
Place an example action call<br/>
</e>
</h>
<lvl>
Place the level (Batch,Document,Page, or Field) that you need the action to be run from if there
is any dependency.
</lvl>
<ret>
List your return conditions. <br/>
<b>TRUE or FALSE</b> If you want to affect the rules order execution for some reason, or if this is a validation
action, you may want to conditionally return <b>FALSE.</b> Otherwise, <b>TRUE.</b>
</ret>
<see>
Reference other related actions here <br/>
<scr>RelatedFunctionName</scr>
</see>
<g>
<![CDATA[
'Your VBScript code goes here.
Dim FieldAr
Dim FieldIndex
FieldAr = Split(OrderString,",")
For i = uBound(FieldAr) to 0 step - 1
Writelog("Moving: " & FieldAr(i))
FieldIndex = 0
While CurrentObj.GetChild(FieldIndex).Type <> FieldAr(i)
FieldIndex = FieldIndex + 1
if FieldIndex = CurrentObj.NumOfChildren then
Writelog("Could not find child: " & FieldAr(i) & " Exiting.")
Exit Function
end if
Wend
Call CurrentObj.MoveChild(FieldIndex ,0)
next 'i
]]>
</g>
</f>
</rrx>
----------------------------------------------------------------------------------------------------------------------------
2.save the Notepad Content As the "RearrangeDocuments.rrx" and place this Action
into the "C:\Datacap\***\dco_******\rules\"
i.e Rules folder of your application.
3. Refresh Your Datacap Studio.Now u can find a new action in Your Action Library.
4.Create a new Ruleset named ImageSorting and the actions as mentioned below.

5.Apply this rule set at the DocumentLevel as shown bellow.

6.Place this Ruleset in the PageID of Task Profile After the PageID Rule as shown bellow.
