I am able to replace one element in a collection to the othe

Posted by Kanchana Gopalakrishnan on 21-Dec-2016 03:01

All Replies

Posted by James Arsenault on 23-Dec-2016 00:22

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

Posted by Kanchana Gopalakrishnan on 23-Dec-2016 00:44

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.

Posted by mparish on 23-Dec-2016 02:44

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.

 

 

This thread is closed