Skip to content

Commit

Permalink
Merge pull request #158 from SainsburyWellcomeCentre/environment-dev
Browse files Browse the repository at this point in the history
Add environment condition operator
  • Loading branch information
glopesdev authored Oct 13, 2023
2 parents a3d7cfd + ba79fe4 commit 3973669
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Aeon.Environment/Aeon.Environment.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageTags>Bonsai Rx Project Aeon Environment</PackageTags>
<TargetFramework>net472</TargetFramework>
<VersionPrefix>0.1.0</VersionPrefix>
<VersionSuffix>build231005</VersionSuffix>
<VersionSuffix>build231007</VersionSuffix>
</PropertyGroup>

<ItemGroup>
Expand Down
51 changes: 51 additions & 0 deletions src/Aeon.Environment/EnvironmentCondition.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:aeon="clr-namespace:Aeon.Environment;assembly=Aeon.Environment"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="Value" />
</Expression>
<Expression xsi:type="rx:Condition">
<Name>EnvironmentCondition</Name>
<Workflow>
<Nodes>
<Expression xsi:type="SubscribeSubject">
<Name>EnvironmentState</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Value.Type</Selector>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="Value" />
</Expression>
<Expression xsi:type="Equal">
<Operand xsi:type="WorkflowProperty" TypeArguments="aeon:EnvironmentStateType">
<Value>Experiment</Value>
</Operand>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="3" Label="Source1" />
<Edge From="2" To="3" Label="Source2" />
<Edge From="3" To="4" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="2" Label="Source1" />
<Edge From="1" To="2" Label="Source2" />
<Edge From="2" To="3" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>

0 comments on commit 3973669

Please sign in to comment.