Topic
  • No replies
JavierRodriguezUrbano
1 Post

Pinned topic How to obtain the correct action in Java postprocesing and postsave

‏2014-01-07T10:39:58Z |

Excuting this code in a postsave script a don't get the correct action executed over one category (MODIFIED,ADDED, DELETED,UNKNOWN ).

 

if one category is added and you save again, you obyain again the added result.

package es.elcorteingles.n0141.apl2WP.postprcesing;
 
//-> //script_execution_mode=java_api="japi://es.elcorteingles.n0141.apl2WP.postprcesing.PostSave.class"
 
import java.util.List;
 
import com.ibm.pim.attribute.AttributeChanges;
import com.ibm.pim.attribute.AttributeInstance;
import com.ibm.pim.extensionpoints.PostCategorySaveFunctionArguments;
import com.ibm.pim.extensionpoints.PostCollaborationCategorySaveFunctionArguments;
import com.ibm.pim.extensionpoints.PostCollaborationItemSaveFunctionArguments;
import com.ibm.pim.extensionpoints.PostItemSaveFunctionArguments;
import com.ibm.pim.extensionpoints.PostSaveFunction;
import com.ibm.pim.hierarchy.category.Category;
import com.ibm.pim.hierarchy.category.Category.SaveResult;
 
public class PostSave implements PostSaveFunction{
 
@Override
public void postsave(PostItemSaveFunctionArguments inArgs) {
System.out.println("Movimiento Post Save->"+inArgs.getItem().getSaveResult());
 
}
 
@Override
public void postsave(PostCategorySaveFunctionArguments inArgs) {
System.out.println("Movimiento Post Save->"+inArgs.getCategory().getSaveResult());
}
 
@Override
public void postsave(PostCollaborationItemSaveFunctionArguments inArgs) {
System.out.println("Movimiento Post Save->"+inArgs.getCollaborationItem().getSaveResult());
 
}
@Override
public void postsave(PostCollaborationCategorySaveFunctionArguments inArgs) {
System.out.println("Movimiento Post Save->"+inArgs.getCollaborationCategory().getSaveResult());
}
 
}