I am able to replace one element in a collection to the other collection. How I can do it for all the elements in the collection? - Forum - Corticon - Progress Community

I am able to replace one element in a collection to the other collection. How I can do it for all the elements in the collection?

 Forum

I am able to replace one element in a collection to the other collection. How I can do it for all the elements in the collection?

This question is not answered

All Replies
  • Kanchana,

    Can you provide more details on what you are trying to achieve. Are you trying to move all the elements in one collection to another collection?

    Thanks,

    Jim

    James Arsenault  |  Product Development  |  Progress Software
    email: james.arsenault@progress.com |  direct: 781-280-4934

  • Yes, I want to move the elements from one entire collection to another collection.

    For what the Corticon specified syntax is <collection1>=<collection2>.

    But I am not getting the desired output.

  • Looking at your test results it appears that the results are exactly what your rules are asking to do.

    Without filters, the meaning of b1 is "all of the books in a library" and the meaning of b2 is also "all of the books in the same library"

    So your rule is not changing the books that belong to a library at all.

    Your rule basically says “all of the books in a library = all of the books in a library”

    It might be easier to follow if you were moving the books from one library to another library based on the type of book and type of library

    Eg

    All the books start off in one library and we move them to other libraries based on type

    This rule sheet will do it

     

     

    Here’s the implementation

     

    Action A removes a book from the books in library2 and B adds it to books in library 1

    The reference "booksInLibrary2" actually has a dual meaning - it means "the set of books in library 2" on the left of the = and also the specific book that was identified In the condition (a) on the right of the =.

     

    Take a look here for some examples of manipulating collections.

    This might address what you are trying to do.

    https://community.progress.com/community_groups/corticon/m/documents/2435 

     

    Also take a  look at the documentation section on aliases and collections and filters.