Sample pre-processing and post-processing extension point in Java™ API

The following sample code shows how to use the pre-processing and post-processing extension point.

The pre-processing and post-processing scripts share extension points. When you use the script, you need to specify which type of processing you want.

The pre-processing script runs before any other operation, such as value rules and validation rules on an item or category. The post-processing script runs after any other operation.

Sample code for the pre-processing and post-processing extension point

public class UserCode implements PrePostProcessingFunction 
{
  public UserCode()
  {
  }

  public void prePostProcessing(ItemPrePostProcessingFunctionArguments inArgs)
  {
	  Item item = inArgs.getItem();
           item.setPrimaryKey("FISH");
  }
  
  
  public void prePostProcessing(CollaborationItemPrePostProcessingFunctionArguments inArgs)
  {
	  CollaborationItem item = inArgs.getCollaborationItem();
           item.setPrimaryKey("FISH");
  }
  
  public void prePostProcessing(CategoryPrePostProcessingFunctionArguments inArgs)
  {
	  Category cat = inArgs.getCategory();
      cat.setAttributeValue("attributeInstancePath", "value");
  }
  
  public void prePostProcessing(CollaborationCategoryPrePostProcessingFunctionArguments inArgs)
  {
	  CollaborationCategory cat = inArgs.getCollaborationCategory();
      cat.setAttributeValue("attributeInstancePath", "value");
  }
  
}