Skip to content

Commit

Permalink
规则链适配
Browse files Browse the repository at this point in the history
  • Loading branch information
wq1234wq committed Nov 17, 2022
1 parent 4c0463b commit 2cd47cb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
22 changes: 12 additions & 10 deletions IoTSharp/Controllers/RulesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
FlowRule = rule,
Flowname = item.name,
bpmnid = item.nodeId,
FlowType = item.nodetype,
FlowType = item.@namespace,
FlowStatus = 1,
CreateId = CreatorId,
Createor = profile.Id,
Expand All @@ -696,7 +696,7 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
Tenant = rule.Tenant,

FlowClass = item.@class,
FlowNameSpace = item.@namespace,
FlowNameSpace = item.nodetype,
FlowIcon = item.icon,
Top = item.top,
Left = item.left
Expand All @@ -712,9 +712,9 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
FlowRule = rule,
Flowname = item.name,
bpmnid = item.nodeId,
FlowType = item.nodetype,
FlowType = item.@namespace,
NodeProcessParams = item.content,

NodeProcessClass = item.mata,
FlowStatus = 1,
CreateId = CreatorId,
Expand All @@ -724,9 +724,9 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
Tenant = rule.Tenant,

FlowClass = item.@class,
FlowNameSpace = item.@namespace,
FlowNameSpace = item.nodetype,
FlowIcon = item.icon,
Top=item.top,
Top = item.top,
Left = item.left
};
_context.Flows.AddRange(node);
Expand All @@ -740,7 +740,7 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
FlowRule = rule,
Flowname = item.name,
bpmnid = item.nodeId,
FlowType = item.nodetype,
FlowType = item.@namespace,
NodeProcessScript = item.content,
NodeProcessScriptType = item.mata,
FlowStatus = 1,
Expand All @@ -751,7 +751,7 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
Tenant = rule.Tenant,

FlowClass = item.@class,
FlowNameSpace = item.@namespace,
FlowNameSpace = item.nodetype,
FlowIcon = item.icon,
Top = item.top,
Left = item.left
Expand All @@ -774,10 +774,11 @@ public ApiResult<bool> SaveDiagramV(ModelDiagram m)
FlowRule = rule,
Flowname = item.linename,
bpmnid = item.lineId,
FlowType = "line",
FlowType = item.@namespace,
TargetId = item.targetId,
SourceId = item.sourceId,
Conditionexpression = item.condition,
FlowNameSpace = "line",
FlowStatus = 1,
CreateId = CreatorId,
Createor = profile.Id,
Expand Down Expand Up @@ -806,7 +807,7 @@ public async Task<ApiResult<ModelDiagram>> GetDiagramV(Guid id)
m.nodes = new List<NodeObject>();
foreach (var item in flows)
{
switch (item.FlowType)
switch (item.FlowNameSpace)
{
case "line":
{
Expand Down Expand Up @@ -883,6 +884,7 @@ public async Task<ApiResult<ModelDiagram>> GetDiagramV(Guid id)
}



[HttpGet]
public async Task<ApiResult<Activity>> GetDiagram(Guid id)
{
Expand Down
9 changes: 7 additions & 2 deletions IoTSharp/IoTSharp.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions IoTSharp/Models/Rule/ModelWorkFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class LineObject
public string linename { get; set; }
public string condition { get; set; }
public string lineId { get; set; }
public string @namespace { get; set; }
}


Expand Down

0 comments on commit 2cd47cb

Please sign in to comment.