Examples for Purge Activity

Example1

<Activity Name="Purge">
  <Start/>
  <Action>Purge</Action>
  <Description lang="en">Purge Historical Data</Description>
  <Parameter direction="in" type="string" eval="constant"   name="eventState">Purge</Parameter>
  <Parameter direction="in" eval="xpath" type="string" name="RetentionUOM"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUOM']     /Value/text()">inDoc</Parameter>
  <Parameter direction="in" eval="xpath" type="string" name="RetentionUnits"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUnits'/Value/t  ext()">inDoc</Parameter>
  <Parameter direction="in" name="InDocument" type="document"   eval="variable">inDoc</Parameter>
<Parameter direction="in" eval="xpath" type="string"   name="DeleteRecordVersions"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='IncludeRecords']/Value/  text()">inDoc</Parameter>
  <Parameter direction="in" eval="xpath" type="string" name="EnterpriseName"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  text()">inDoc</Parameter>
</Activity>

Example 2

This example illustrates how to delete both history and data.

Activity 1:
<Activity Name="PurgeHistory">
  <Start/>
  <Action>Purge</Action>
  <Description lang="en">Purge Historical Data</Description>
  <Parameter direction="in" type="string" eval="constant"   name="eventState">PURGE</Parameter>
  <Parameter direction="in" eval="xpath" type="string" name="RetentionUOM"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUOM']/Value/
  text()">inDoc</Parameter>
  <Parameter direction="in" eval="xpath" type="long" name="RetentionUnits"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUnits']/Value/  text()">inDoc</Parameter>
  <Parameter direction="in" eval="xpath" type="string" name="EnterpriseName"   source="/Message/Body/Document/BusinessDocument/CatalogAction/
  CatalogActionHeader/MasterCatalog/Extension[@name='EnterpriseName']/Value/  text()">inDoc</Parameter>
  <Parameter direction="in" name="InDocument" type="document"   eval="variable">inDoc</Parameter>
</Activity>
Activity 2:
<Activity Name="InitiatePurgeRecordVersions">
	  <Action>Purge</Action>
	  <Description lang="en">Initiate purge for record versions</Description>
	   <Parameter direction="in" type="string" eval="constant" name="eventState">PURGERECORDVERSION</Parameter>
	   	<Parameter direction="in" type="string" eval="constant" name="PurgeExecMode">history</Parameter>
	   	<Parameter direction="in" eval="xpath" type="string" name="RetentionUOM" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUOM']/Value/text()">inDoc</Parameter>
	   	<Parameter direction="in" eval="xpath" type="long" name="RetentionUnits" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='RetentionUnits']/Value/text()">inDoc</Parameter>
	   	<Parameter direction="in" eval="xpath" type="string" name="DeleteRecordVersions" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='IncludeRecords']/Value/text()">inDoc</Parameter>
	   	<Parameter direction="in" eval="xpath" type="string" name="VersionsToRetain" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='VersionsToRetain']/Value/text()">inDoc</Parameter>
	   <Parameter direction="in" eval="xpath" type="string" name="MasterCatalog" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/RevisionID/BaseName/text()">inDoc</Parameter>
	   	<Parameter direction="in" name="InDocument" type="document" eval="variable">inDoc</Parameter>
	   	<Parameter direction="in" eval="xpath" type="long" name="Interval" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='Interval']/Value/text()">inDoc</Parameter>
	   <!-- <Parameter direction="in" name="PurgeEnterpriseOption" type="string" eval="constant">ALL</Parameter> -->
</Activity>
Transition:
<Transition FromActivity="UpdatePurgeEvent" ToActivity="InitiatePurgeRecordVersions">
		  <Description>Use Delete Forms if action is Delete.</Description>
  		<Rule>
   			<Parameter name="IncludeRecords" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='IncludeRecords']/Value/text()" direction="in">inDoc</Parameter>
   			<Parameter name="result" type="boolean" direction="out"/>
   			<Condition format="java">				<![CDATA[com.tibco.mdm.workflow.engine.transition.WfSharedConditionTransition.isYes(IncludeRecords);
   			</Condition>
  		</Rule>
	</Transition>