Seeq Team Brian Crandall Posted April 28, 2019 Seeq Team Share Posted April 28, 2019 When working with Conditions, it may be helpful to apply a property from another Condition with larger time frames, e.g. batch procedures, orders, and equipment states. Here is one approach: $childCondition.transform($cap -> $cap.setProperty('Stage', $ParentCondition.toGroup($cap).first().getProperty('Value') ) ) $childCondition are the red capsules and ‘Stage’ is the property that you will create with the ‘Value’ property from the green $parentCondition. 2 Link to comment Share on other sites More sharing options...
Seeq Team Brian Crandall Posted September 10, 2019 Author Seeq Team Share Posted September 10, 2019 This also works when assigning a value from a Signal to a Capsule property: $condition.transform($capsule -> $capsule .setProperty('Neat Property', $signal.toGroup($capsule).first().getValue()) ) 3 Link to comment Share on other sites More sharing options...
Seeq Team Emily Johnston Posted September 14, 2022 Seeq Team Share Posted September 14, 2022 It is also possible to set properties from child capsules to a parent capsule. This is more complex as there could be a variable number of child capsules associated with each parent capsule. Inside the transform, you will pick the desired child capsule (1st, 2nd, 3rd, etc.) and define an alternate capsule with a filler property value to be used if the desired pick does not exist within the parent capsule. $parentCondition.removeLongerThan(40h).transform($capsule -> $capsule.setProperty('1st Child Property', $childCondition.removeLongerThan(40h).toGroup($capsule).pick(1, capsule($capsule.endKey(), $capsule.endKey()).setProperty('Child Property', 'none')).property('Child Property'))) .transform($capsule -> $capsule.setProperty('2nd Child Property', $childCondition.removeLongerThan(40h).toGroup($capsule).pick(2, capsule($capsule.endKey(), $capsule.endKey()).setProperty('Child Property', 'none')).property('Child Property'))) .transform($capsule -> $capsule.setProperty('3rd Child Property', $childCondition.removeLongerThan(40h).toGroup($capsule).pick(3, capsule($capsule.endKey(), $capsule.endKey()).setProperty('Child Property', 'none')).property('Child Property'))) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now