dynamic multicast? #1220
Answered
by
edmundchong
edmundchong
asked this question in
Q&A
-
Hi, I was wondering if it is possible to dynamically change the subject of |
Beta Was this translation helpful? Give feedback.
Answered by
edmundchong
Jan 14, 2023
Replies: 2 comments 4 replies
-
Edit: the following solution wont work. Sorry for the misleading information!If you manage to defer their creation (e.g. inside a Click me - Copy&Paste<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="rx:BehaviorSubject" TypeArguments="sys:Int32">
<rx:Name>A</rx:Name>
</Expression>
<Expression xsi:type="rx:BehaviorSubject" TypeArguments="sys:Int32">
<rx:Name>B</rx:Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Timer">
<rx:DueTime>PT5S</rx:DueTime>
<rx:Period>PT0S</rx:Period>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>A</Value>
</Combinator>
</Expression>
<Expression xsi:type="rx:SelectMany">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Name" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>0</Value>
</Combinator>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>A</Name>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="3" Label="Source2" />
<Edge From="2" To="3" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>B</Value>
</Combinator>
</Expression>
<Expression xsi:type="rx:SelectMany">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Name" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>0</Value>
</Combinator>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>B</Name>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="3" Label="Source2" />
<Edge From="2" To="3" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>A</Name>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>B</Name>
</Expression>
</Nodes>
<Edges>
<Edge From="2" To="3" Label="Source1" />
<Edge From="2" To="5" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
|
Beta Was this translation helpful? Give feedback.
4 replies
-
answer: see above in replies (and thanks bruno for the discussion) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edmundchong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
answer: see above in replies (and thanks bruno for the discussion)