Announcement Announcement Module
Collapse
No announcement yet.
How to do the “accumulate” in my custom CompletionPolicy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to do the “accumulate” in my custom CompletionPolicy

    Hi,

    Checking existing CompletionPolicy implementations, I found they're mostly "item count" based.
    Which means no item information needed when do update().

    However, my completionPolicy will based on some of the item properties, like size.

    One solution I can come up with is to use item read listener:

    @AfterRead

    public void afterRead(Item item){
    MyRepeatContext ctx = (MyRepeatContext)RepeatSynchronizationManager.getC ontext();
    ctx.accumulate(item.getSize());

    }

    Is it the right way to do that? Any suggestions?

    Thanks
    Ma Ling

  • #2
    you could use somethign like mapitemwriter or listitemwriter to accumulate data into inmemory storage and then in next step use it

    Comment

    Working...
    X