Import feed containing trigger doesn't change category name in the pre-condition

Description

Steps:
1.Create a feed with trigger precondition in source environment (VM1)
2.Export Feed from source environment (VM1) with category as 'category A'
3.Import Feed into destination environment (VM2). while importing specify category as 'category B'

Actual Behaviour:
Check feed details, it will show category as 'category A' . Since category A is not available in destination environment (VM2) feed will throw runtime error.

Expected behaviour:
Feed import should change category to 'category B'. This will let the feed run without errors

Environment

None

Activity

Show:
Scott Reisdorf
March 22, 2017, 8:53 PM

code needs to be added to look for the currentFeed from the precondition rule and update to the newly created feed/category.

code should be:

//repoint the trigger feed dependencies for the currentfeed to this newly imported feed name
if(metadata.getSchedule().hasPreconditions()){
metadata.getSchedule().getPreconditions().stream().flatMap(preconditionRule -> preconditionRule.getProperties().stream()).filter(fieldRuleProperty -> PolicyPropertyTypes.PROPERTY_TYPE.currentFeed.name().equals(fieldRuleProperty.getType())).forEach(fieldRuleProperty -> fieldRuleProperty.setValue(metadata.getCategoryAndFeedName()));
}

Done

Assignee

Scott Reisdorf

Reporter

saktheesh Balaraj

Labels

None

Reviewer

None

Story point estimate

None

Sprint

None

Fix versions

Priority

Medium