초기 커밋.
This commit is contained in:
23
DDUtilityApp/WORKFLOW/DATA/DynamicActivity.cs
Normal file
23
DDUtilityApp/WORKFLOW/DATA/DynamicActivity.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class DynamicActivity
|
||||
{
|
||||
|
||||
public List<Parameter> Parameters { get; set; } = new List<Parameter>();
|
||||
|
||||
public Parameter Result { get; set; }
|
||||
|
||||
public ViewState ViewState { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
17
DDUtilityApp/WORKFLOW/DATA/FlowBase.cs
Normal file
17
DDUtilityApp/WORKFLOW/DATA/FlowBase.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class FlowBase
|
||||
{
|
||||
|
||||
public ViewState ViewState { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
19
DDUtilityApp/WORKFLOW/DATA/FlowDecision.cs
Normal file
19
DDUtilityApp/WORKFLOW/DATA/FlowDecision.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class FlowDecision : FlowBase
|
||||
{
|
||||
|
||||
public FlowBase True { get; set; }
|
||||
|
||||
public FlowBase False { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
20
DDUtilityApp/WORKFLOW/DATA/FlowStep.cs
Normal file
20
DDUtilityApp/WORKFLOW/DATA/FlowStep.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using DDUtilityApp.DATA;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class FlowStep : FlowBase
|
||||
{
|
||||
|
||||
public DynamicActivity DynamicActivity { get; set; }
|
||||
|
||||
public FlowBase Next { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
61
DDUtilityApp/WORKFLOW/DATA/Flowchart.cs
Normal file
61
DDUtilityApp/WORKFLOW/DATA/Flowchart.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using JWH;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
public class Flowchart
|
||||
{
|
||||
|
||||
public List<Parameter> Variables { get; set; } = new List<Parameter>();
|
||||
|
||||
public ViewState ViewState { get; set; }
|
||||
|
||||
public FlowBase StartNode { get; set; }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
public Flowchart()
|
||||
{
|
||||
}
|
||||
|
||||
public Flowchart(XmlNode root)
|
||||
{
|
||||
//this.DisplayName = root.Attributes[$"DisplayName"].Value;
|
||||
foreach(XmlAttribute attribute in root.Attributes)
|
||||
if (string.Compare(attribute.Name, "DisplayName", true) == 0) this.DisplayName = attribute.Value;
|
||||
|
||||
// Variables
|
||||
XmlNode nodeVariables = root.GetSingleNodeByName($"Flowchart.Variables");
|
||||
if (nodeVariables != null)
|
||||
{
|
||||
Parameter[] variables = this.GetVariables(nodeVariables);
|
||||
if (variables.Length > 0) this.Variables.AddRange(variables);
|
||||
}
|
||||
|
||||
// ViewState
|
||||
XmlNode nodeViewState = root.GetSingleNodeByName($"sap:WorkflowViewStateService.ViewState");
|
||||
if (nodeViewState != null) this.ViewState = new ViewState(nodeViewState);
|
||||
|
||||
}
|
||||
|
||||
private Parameter[] GetVariables(XmlNode node)
|
||||
{
|
||||
List<Parameter> lstVariables = new List<Parameter>();
|
||||
foreach (XmlNode nodeVariable in node.ChildNodes)
|
||||
{
|
||||
if (string.Compare(nodeVariable.Name, "Variable", true) != 0) continue;
|
||||
|
||||
Parameter variable = new Parameter(nodeVariable);
|
||||
if (variable != null) lstVariables.Add(variable);
|
||||
}
|
||||
|
||||
return lstVariables.ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
33
DDUtilityApp/WORKFLOW/DATA/Parameter.cs
Normal file
33
DDUtilityApp/WORKFLOW/DATA/Parameter.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class Parameter
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public Parameter()
|
||||
{
|
||||
}
|
||||
|
||||
public Parameter(XmlNode node)
|
||||
{
|
||||
foreach (XmlAttribute attribute in node.Attributes)
|
||||
{
|
||||
if (string.Compare(attribute.Name, "Name", true) == 0) this.Name = attribute.Value;
|
||||
if (string.Compare(attribute.Name, "x:TypeArguments", true) == 0) this.Type = attribute.Value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
27
DDUtilityApp/WORKFLOW/DATA/ViewState.cs
Normal file
27
DDUtilityApp/WORKFLOW/DATA/ViewState.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW.DATA
|
||||
{
|
||||
|
||||
public class ViewState
|
||||
{
|
||||
|
||||
public Dictionary<string, object> Dictionary { get; set; } = new Dictionary<string, object>();
|
||||
|
||||
public ViewState()
|
||||
{
|
||||
}
|
||||
|
||||
public ViewState(XmlNode node)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
219
DDUtilityApp/WORKFLOW/FrmWorkflow.Designer.cs
generated
Normal file
219
DDUtilityApp/WORKFLOW/FrmWorkflow.Designer.cs
generated
Normal file
@@ -0,0 +1,219 @@
|
||||
namespace DDUtilityApp.WORKFLOW
|
||||
{
|
||||
partial class FrmWorkflow
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.btnSample = new System.Windows.Forms.Button();
|
||||
this.grid = new JWH.CONTROL.GridViewEx();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.lstFile = new System.Windows.Forms.ListView();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid.MasterTemplate)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||
this.splitContainer2.Panel1.SuspendLayout();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel5.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.splitContainer1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.panel1.Size = new System.Drawing.Size(965, 612);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(3, 3);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.panel3);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.panel2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(959, 606);
|
||||
this.splitContainer1.SplitterDistance = 149;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel2.Controls.Add(this.grid);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(959, 453);
|
||||
this.panel2.TabIndex = 0;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel3.Controls.Add(this.splitContainer2);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(959, 149);
|
||||
this.panel3.TabIndex = 0;
|
||||
//
|
||||
// btnSample
|
||||
//
|
||||
this.btnSample.Location = new System.Drawing.Point(6, 8);
|
||||
this.btnSample.Name = "btnSample";
|
||||
this.btnSample.Size = new System.Drawing.Size(125, 32);
|
||||
this.btnSample.TabIndex = 0;
|
||||
this.btnSample.Text = "button1";
|
||||
this.btnSample.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// grid
|
||||
//
|
||||
this.grid.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.grid.Location = new System.Drawing.Point(0, 0);
|
||||
//
|
||||
//
|
||||
//
|
||||
this.grid.MasterTemplate.ViewDefinition = tableViewDefinition2;
|
||||
this.grid.Name = "grid";
|
||||
this.grid.Size = new System.Drawing.Size(957, 451);
|
||||
this.grid.TabIndex = 0;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.panel5);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.panel4);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(957, 147);
|
||||
this.splitContainer2.SplitterDistance = 617;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel4.Controls.Add(this.btnSample);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel4.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.panel4.Size = new System.Drawing.Size(336, 147);
|
||||
this.panel4.TabIndex = 0;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.Controls.Add(this.lstFile);
|
||||
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel5.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.panel5.Size = new System.Drawing.Size(617, 147);
|
||||
this.panel5.TabIndex = 0;
|
||||
//
|
||||
// lstFile
|
||||
//
|
||||
this.lstFile.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lstFile.HideSelection = false;
|
||||
this.lstFile.Location = new System.Drawing.Point(3, 3);
|
||||
this.lstFile.Name = "lstFile";
|
||||
this.lstFile.Size = new System.Drawing.Size(611, 141);
|
||||
this.lstFile.TabIndex = 0;
|
||||
this.lstFile.UseCompatibleStateImageBehavior = false;
|
||||
this.lstFile.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// FrmWorkflow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(965, 612);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "FrmWorkflow";
|
||||
this.Text = "FrmWorkflow";
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel3.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid.MasterTemplate)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
|
||||
this.splitContainer2.Panel1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private JWH.CONTROL.GridViewEx grid;
|
||||
private System.Windows.Forms.Button btnSample;
|
||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
private System.Windows.Forms.ListView lstFile;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
}
|
||||
}
|
||||
220
DDUtilityApp/WORKFLOW/FrmWorkflow.cs
Normal file
220
DDUtilityApp/WORKFLOW/FrmWorkflow.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
using DDUtilityApp.DATA;
|
||||
using DDUtilityApp.WORKFLOW.DATA;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using JWH;
|
||||
|
||||
namespace DDUtilityApp.WORKFLOW
|
||||
{
|
||||
|
||||
public partial class FrmWorkflow : Form
|
||||
{
|
||||
|
||||
public FrmWorkflow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.SetLayout();
|
||||
this.SetEventHandler();
|
||||
}
|
||||
|
||||
protected void SetLayout()
|
||||
{
|
||||
this.grid.AddColumn("ModelID");
|
||||
this.grid.AddColumn("FileName");
|
||||
this.grid.AddColumn("DisplayName");
|
||||
this.grid.AddColumn("LibraryName");
|
||||
this.grid.AddColumn("ClassName");
|
||||
this.grid.AddColumn("MethodName");
|
||||
this.grid.AddColumn("ArgumentsText");
|
||||
}
|
||||
|
||||
protected void SetEventHandler()
|
||||
{
|
||||
this.btnSample.Click += BtnSample_Click;
|
||||
}
|
||||
|
||||
public Flowchart StartFlowchart { get; set; }
|
||||
|
||||
private void BtnSample_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
//dlg.InitialDirectory = $@"C:\download\";
|
||||
if (dlg.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
XmlDocument document = new XmlDocument();
|
||||
document.Load(dlg.FileName);
|
||||
|
||||
XmlNode nodeActivity = document.GetSingleNodeByName("Activity");
|
||||
if (nodeActivity == null) return;
|
||||
|
||||
XmlNode nodeFlowchart = nodeActivity.GetSingleNodeByName("Flowchart");
|
||||
if (nodeFlowchart == null) return;
|
||||
this.StartFlowchart = new Flowchart(nodeFlowchart);
|
||||
}
|
||||
|
||||
private void xBtnSample_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dlg = new OpenFileDialog();
|
||||
if (dlg.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
XmlDocument document = new XmlDocument();
|
||||
document.Load(dlg.FileName);
|
||||
|
||||
XmlNodeList activityNodes = document.GetElementsByTagName($"ead:DynamicInvokeActivity");
|
||||
XmlNodeList aInNodes = document.GetElementsByTagName($"ead:DynamicInvokeActivity.Parameters");
|
||||
XmlNodeList aOutNodes = document.GetElementsByTagName($"ead:DynamicInvokeActivity.Result");
|
||||
|
||||
List<Workflow> lstWorkflow = new List<Workflow>();
|
||||
string libraryName = string.Empty;
|
||||
string className = string.Empty;
|
||||
string methodName = string.Empty;
|
||||
string aName = string.Empty;
|
||||
string aType = string.Empty;
|
||||
string aValue = string.Empty;
|
||||
|
||||
string aTitle = string.Empty;
|
||||
|
||||
string aData = string.Empty;
|
||||
|
||||
string fnName = string.Empty;
|
||||
string fnKey = string.Empty;
|
||||
string fnValue = string.Empty;
|
||||
string fnData = string.Empty;
|
||||
|
||||
int aCount = 0;
|
||||
int aaCount = 0;
|
||||
int attributeCount = 0;
|
||||
int fnCount = 0;
|
||||
|
||||
|
||||
foreach (XmlNode activityNode in activityNodes)
|
||||
{
|
||||
libraryName = activityNode.Attributes["LibraryName"].Value;
|
||||
className = activityNode.Attributes["ClassName"].Value;
|
||||
methodName = activityNode.Attributes["MethodName"].Value;
|
||||
aCount = activityNode.ChildNodes.Count;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder fnsb = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < aCount; i++)
|
||||
{
|
||||
aaCount = activityNode.ChildNodes[i].ChildNodes.Count;
|
||||
|
||||
for (int j = 0; j < aaCount; j++)
|
||||
{
|
||||
attributeCount = activityNode.ChildNodes[i].ChildNodes[j].Attributes.Count;
|
||||
aTitle = activityNode.ChildNodes[i].ChildNodes[j].Name;
|
||||
|
||||
sb.Append($"{aTitle} => ");
|
||||
for (int k = 0; k < attributeCount; k++)
|
||||
{
|
||||
if (activityNode.ChildNodes[i].ChildNodes[j].ChildNodes[0].Attributes != null)
|
||||
{
|
||||
fnCount = activityNode.ChildNodes[i].ChildNodes[j].ChildNodes.Count;
|
||||
}
|
||||
aName = activityNode.ChildNodes[i].ChildNodes[j].Attributes[k].Name;
|
||||
aValue = activityNode.ChildNodes[i].ChildNodes[j].Attributes[k].Value;
|
||||
aData = activityNode.ChildNodes[i].ChildNodes[j].InnerText;
|
||||
|
||||
if (fnCount > 0)
|
||||
{
|
||||
for (int m = 0; m < fnCount; m++)
|
||||
{
|
||||
fnName = activityNode.ChildNodes[i].ChildNodes[j].ChildNodes[m].Name;
|
||||
fnKey = activityNode.ChildNodes[i].ChildNodes[j].ChildNodes[m].Attributes[m].Name;
|
||||
fnValue = activityNode.ChildNodes[i].ChildNodes[j].ChildNodes[m].Attributes[m].Value;
|
||||
fnData = activityNode.ChildNodes[i].ChildNodes[j].ChildNodes[m].InnerText;
|
||||
|
||||
fnsb.Append($"({fnName}=> {fnKey}={fnValue} , {fnData})");
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append($"{aName}=");
|
||||
sb.Append($"{aValue} ");
|
||||
}
|
||||
|
||||
sb.Append(fnsb.ToString());
|
||||
sb.AppendLine($" {aData} ");
|
||||
|
||||
string aaa = ($"Name= {aName}, Value= {aValue}");
|
||||
}
|
||||
}
|
||||
|
||||
string sba = sb.ToString();
|
||||
|
||||
aName = activityNode.ChildNodes[0].ChildNodes[0].Attributes[0].Name;
|
||||
aValue = activityNode.ChildNodes[0].ChildNodes[0].Attributes[0].Value;
|
||||
//aName = activityNode.ChildNodes.Item(0).Attributes["x:TypeArguments"].Value;
|
||||
|
||||
Workflow workflow = new Workflow();
|
||||
workflow.DisplayName = "";
|
||||
workflow.LibraryName = libraryName;
|
||||
workflow.ClassName = className;
|
||||
workflow.MethodName = methodName;
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
lstWorkflow.Add(workflow);
|
||||
}
|
||||
|
||||
this.grid.AutoBinding(lstWorkflow.ToArray());
|
||||
}
|
||||
|
||||
private Workflow[] GetWorkflows(string fullName)
|
||||
{
|
||||
string modelID = "SPECTYPE_01_DSENT";
|
||||
string fileName = System.IO.Path.GetFileNameWithoutExtension(fullName);
|
||||
List<Workflow> lstWorkflow = new List<Workflow>();
|
||||
Workflow workflow = null;
|
||||
|
||||
workflow = new Workflow(modelID, fileName);
|
||||
workflow.DisplayName = "GetReturnCode";
|
||||
workflow.LibraryName = "DDEIS.Common";
|
||||
workflow.ClassName = "DDEIS.BaseActivityforB1";
|
||||
workflow.MethodName = "GetDDEISMessageReturnCode";
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
lstWorkflow.Add(workflow);
|
||||
|
||||
workflow = new Workflow(modelID, fileName);
|
||||
workflow.DisplayName = "UpdateEismsgName";
|
||||
workflow.LibraryName = "DDEIS.Common";
|
||||
workflow.ClassName = "DDEIS.BaseActivityforB1";
|
||||
workflow.MethodName = "UpdateDDEISMessageName";
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
workflow.Arguments.Add(new Argument("name", "String", "CARRIERINFOSEND"));
|
||||
lstWorkflow.Add(workflow);
|
||||
|
||||
workflow = new Workflow(modelID, fileName);
|
||||
workflow.DisplayName = "UpdateEismsgName";
|
||||
workflow.LibraryName = "DDEIS.Common";
|
||||
workflow.ClassName = "DDEIS.BaseActivityforB1";
|
||||
workflow.MethodName = "UpdateDDEISMessageName";
|
||||
workflow.Arguments.Add(new Argument("eisMsg", "Object", "IN_DATA"));
|
||||
workflow.Arguments.Add(new Argument("name", "String", "PROCESSCANCEL"));
|
||||
lstWorkflow.Add(workflow);
|
||||
|
||||
workflow = new Workflow(modelID, fileName);
|
||||
workflow.DisplayName = "DynamicInvokeActivity";
|
||||
workflow.LibraryName = "DDEIS.B2.Activity";
|
||||
workflow.ClassName = "DDEIS.HSMSActivity_DDEIS";
|
||||
workflow.MethodName = "Send_S2F41_HostCommandSend";
|
||||
workflow.Arguments.Add(new Argument("msg", "Object", "obj"));
|
||||
lstWorkflow.Add(workflow);
|
||||
|
||||
return lstWorkflow.ToArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
120
DDUtilityApp/WORKFLOW/FrmWorkflow.resx
Normal file
120
DDUtilityApp/WORKFLOW/FrmWorkflow.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
106
DDUtilityApp/WORKFLOW/Workflow.cs
Normal file
106
DDUtilityApp/WORKFLOW/Workflow.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using JWH.DATA;
|
||||
|
||||
namespace DDUtilityApp.DATA
|
||||
{
|
||||
|
||||
public class Workflow : DataTableBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Model ID
|
||||
/// </summary>
|
||||
public string ModelID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File Name
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Library Name
|
||||
/// </summary>
|
||||
public string LibraryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Class Name
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Method Name
|
||||
/// </summary>
|
||||
public string MethodName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Argument collection
|
||||
/// </summary>
|
||||
public List<Argument> Arguments { get; set; } = new List<Argument>();
|
||||
|
||||
[ReadOnly(true)]
|
||||
public string ArgumentsText
|
||||
{
|
||||
get { return this.GetArgumentsText(); }
|
||||
}
|
||||
|
||||
|
||||
public Workflow()
|
||||
{
|
||||
}
|
||||
|
||||
public Workflow(string modelID, string fileName)
|
||||
{
|
||||
this.ModelID = modelID;
|
||||
this.FileName = fileName;
|
||||
}
|
||||
|
||||
private string GetArgumentsText()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (Argument arg in this.Arguments)
|
||||
{
|
||||
if (sb.Length > 0) sb.Append(", ");
|
||||
sb.Append(arg.ToString());
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Argument
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
|
||||
|
||||
public Argument()
|
||||
{
|
||||
}
|
||||
|
||||
public Argument( string name, string type, string value)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Type = type;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Name = {this.Name}, type = {this.Type}, Value = {this.Value}";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user