mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-14 03:46:34 +08:00
修改了流程运行中的bug
This commit is contained in:
30
Serein.BaseNode/Serein.BaseNode.csproj
Normal file
30
Serein.BaseNode/Serein.BaseNode.csproj
Normal file
@@ -0,0 +1,30 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>1.0.0</Version>
|
||||
<!--<TargetFrameworks>net8.0</TargetFrameworks>-->
|
||||
<BaseOutputPath>D:\Project\C#\DynamicControl\SereinFlow\.Output</BaseOutputPath>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Title>SereinFow</Title>
|
||||
<Description>基础节点</Description>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/fhhyyp/serein-flow</RepositoryUrl>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\LICENSE">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>\</PackagePath>
|
||||
</None>
|
||||
<None Include="..\README.md">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>\</PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
52
Serein.BaseNode/SereinBaseNodes.cs
Normal file
52
Serein.BaseNode/SereinBaseNodes.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Utils.SereinExpression;
|
||||
|
||||
namespace Serein.BaseNode
|
||||
{
|
||||
|
||||
public enum ExpType
|
||||
{
|
||||
Get,
|
||||
Set
|
||||
}
|
||||
[DynamicFlow(Name ="基础节点")]
|
||||
internal class SereinBaseNodes
|
||||
{
|
||||
[NodeAction(NodeType.Action,"条件节点")]
|
||||
private bool SereinConditionNode(IDynamicContext context,
|
||||
object targetObject,
|
||||
string exp = "ISPASS")
|
||||
{
|
||||
var isPass = SereinConditionParser.To(targetObject, exp);
|
||||
context.NextOrientation = isPass ? ConnectionInvokeType.IsSucceed : ConnectionInvokeType.IsFail;
|
||||
return isPass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[NodeAction(NodeType.Action, "表达式节点")]
|
||||
private object SereinExpNode(IDynamicContext context,
|
||||
object targetObject,
|
||||
string exp)
|
||||
{
|
||||
|
||||
exp = "@" + exp;
|
||||
var newData = SerinExpressionEvaluator.Evaluate(exp, targetObject, out bool isChange);
|
||||
object result;
|
||||
if (isChange || exp.StartsWith("@GET",System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
result = newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = targetObject;
|
||||
}
|
||||
context.NextOrientation = ConnectionInvokeType.IsSucceed;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user