1 Star 0 Fork 1

apiumc/工作流引擎

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Line.cs 3.81 KB
一键复制 编辑 原始数据 按行查看 历史
apiumc 提交于 2024-04-12 23:37 . BPM Init
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using UMC.Data;
namespace UMC.WorkFlow
{
/// <summary>
/// 流程线
/// </summary>
public class Line : UMC.Data.IJSONType
{
/// <summary>
/// 必须经过
/// </summary>
[DesignAttribute(Caption = "必须经过", ArgumentType = ArgumentType.NVSource, ArgumentValue = "是,True,否,False")]
public bool IsMust
{
get; set;
}
[DesignAttribute(Caption = "描述")]
public String Text { get; set; }
/// <summary>
/// 进入的工作点名字
/// </summary>
public string ToId { get; set; }
/// <summary>
/// 出入的工作点名字
/// </summary>
public string FromId { get; set; }
/// <summary>
/// 矢量的工作状态
/// </summary>
public LineStatus Status { get; set; }
/// <summary>
/// 在矢量唯一标志
/// </summary>
public string Id { get; set; }
/// <summary>
/// 当审批令牌经过时,所要做的事件
/// </summary>
/// <param name="shape">提交的</param>
/// <param name="task"></param>
public virtual void Activing(Shape shape, TaskInstance instance, TaskRuntime runtime)
{
}
protected virtual string JSONName()
{
return this.GetType().Name;
}
public virtual Func<object> GetInstance(string prototypeName)
{
return () => String.Empty;
//throw new NotImplementedException();
}
public virtual void Read(string key, object value)
{
switch (key)
{
case "IsMust":
this.IsMust = Convert.ToBoolean(value);
break;
case "Id":
this.Id = value as string;
break;
case "Status":
this.Status = Utility.Parse(value as string, LineStatus.UnPass);
break;
case "FromId":
this.FromId = value as string;
break;
case "ToId":
this.ToId = value as string;
break;
case "Text":
this.Text = value as string;
break;
//,LineStatus.UnPass);
}
}
protected virtual void WriteProperty(TextWriter writer)
{
writer.Write(',');
JSON.Serialize("Id", this.Id, writer);
if (String.IsNullOrEmpty(this.FromId) == false)
{
writer.Write(',');
JSON.Serialize("FromId", this.FromId, writer);
}
if (String.IsNullOrEmpty(this.ToId) == false)
{
writer.Write(',');
JSON.Serialize("ToId", this.ToId, writer);
}
if (String.IsNullOrEmpty(this.Text) == false)
{
writer.Write(',');
JSON.Serialize("Text", this.Text, writer);
}
if (this.IsMust)
{
writer.Write(',');
JSON.Serialize("IsMust", this.IsMust, writer);
}
if (this.Status > LineStatus.UnPass)
{
writer.Write(',');
JSON.Serialize("Status", this.Status, writer);
}
}
public void Write(TextWriter writer)
{
writer.Write('{');
JSON.Serialize(JSON.Constructor, writer);
writer.Write(":");
JSON.Serialize(JSONName(), writer);
WriteProperty(writer);
writer.Write('}');
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/apiumc/BPM.git
git@gitee.com:apiumc/BPM.git
apiumc
BPM
工作流引擎
master

搜索帮助