Video Screencast Help

Need help comparing two workflow Collections - NS 7.1 Software Resources

Created: 05 Jun 2013 | 3 comments
kmccann's picture

I currently have a workflow running that copies New\Changed Software Rersources from our Stage 7.1 environment to Production.   Up to now I have been using SSIS and tables to create the compare data.  I am trying to integrate all of that into workflow and have created two components with the data extracts that need to be compared.  Basically I am trying to filterout all the items in the two collections that are identical and then take actions on the ones that are different.  I have tried the "Remove Items from Collection" component with a equals comparison and a mapping from one table to the other.  One other question I have is related to the datatypes of these SQL Components.  Each of the components has its own datatype and I feel that this may be impacting my ability to compare them correctly.  may next step may be to move to generating this dynamically or by acting directly on the NS Webservices and comparing that way.  Any thoughts or insight would be appreciated.  Thanks! 

Operating Systems:

Comments 3 CommentsJump to latest comment

reecardo's picture

To get a distinct list quickly, use the Test Collection For Duplicates component. There's a checkbox called Output Distinct Values List where you can output a distinct list along the Has Duplicates path. I'd call this component "after" the comparisons to get a distinct list quick and easy.

Trying to come up with a "pseudoflow" to find all elements that appear more than once in a list...

kmccann's picture

Thanks reecardo, I was able to get past the first hurdle and am able to get a list of all Software Releases in our stage environemnt that are not in our production environment by do a "Is in Collection" (Prod) check on each Guid from Stage.  My next step is to get a list of all items in Stage that are changed from the values in Prod.  Currently I am passing a date variable through to a SQL query and getting a collection of items chnages in the past day etc.  Does it make more sense to try to pass variables to SQL or to compare two collections in Workflow?

reecardo's picture

If an item in your collection of objects exposes a "datechanged" field, you can really go etiher way: use a SQL query, or run though every item in a collection and toss out elements that exceed the date threshold. As far as performance goes, the SQL query may be the quickest way.