Skip to content

Commit

Permalink
expanded support to unsigned short,integer and long values.
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-castaldo committed May 31, 2019
1 parent d6e8494 commit b361a65
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BpmEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<TargetFrameworks>netstandard2.0;net452;net20</TargetFrameworks>
<RootNamespace>Org.Reddragonit.BpmEngine</RootNamespace>
<PackageId>Org.Reddragonit.BpmEngine</PackageId>
<Version>1.9.10</Version>
<Version>1.9.11</Version>
<Authors>Roger Castaldo</Authors>
<Description>A BPMN Engine written in .net. The engine attempts to read in a bpmn notation xml document defining both the process(s) as well as the diagrams. From here you can then load/unload the state, render the diagram in its current state or animated into a gif. Using the delegates for a process, you intercept and handle task and condition checking by reading additional xml held within flow and task objects.</Description>
<PackageProjectUrl>https://github.com/roger-castaldo/BPMEngine</PackageProjectUrl>
<PackageLicenseUrl>https://www.gnu.org/licenses/gpl-3.0.en.html</PackageLicenseUrl>
<RepositoryUrl>https://github.com/roger-castaldo/BPMEngine</RepositoryUrl>
<PackageTags>BPMN</PackageTags>
<PackageReleaseNotes>updated to correct bug wrt not dealing with gateways properly for the incoming paths.</PackageReleaseNotes>
<AssemblyVersion>1.9.10.0</AssemblyVersion>
<FileVersion>1.9.10.0</FileVersion>
<PackageReleaseNotes>updated to support unsigned short, integer and long as variable values</PackageReleaseNotes>
<AssemblyVersion>1.9.11.0</AssemblyVersion>
<FileVersion>1.9.11.0</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
3 changes: 3 additions & 0 deletions Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ internal enum VariableTypes
Integer,
Short,
Long,
UnsignedInteger,
UnsignedShort,
UnsignedLong,
Double,
Decimal,
String,
Expand Down
42 changes: 42 additions & 0 deletions Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@ internal static object ExtractVariableValue(VariableTypes type,string text)
case VariableTypes.Short:
ret = short.Parse(text);
break;
case VariableTypes.UnsignedInteger:
ret = uint.Parse(text);
break;
case VariableTypes.UnsignedLong:
ret = ulong.Parse(text);
break;
case VariableTypes.UnsignedShort:
ret = ushort.Parse(text);
break;
case VariableTypes.String:
ret = text;
break;
Expand Down Expand Up @@ -453,6 +462,30 @@ internal static void EncodeVariableValue(object value,XmlElement variableContain
variableContainer.ChildNodes[variableContainer.ChildNodes.Count - 1].AppendChild(doc.CreateCDataSection(b.ToString()));
}
break;
case "System.UInt32":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedInteger.ToString();
foreach (uint b in (IEnumerable)value)
{
variableContainer.AppendChild(doc.CreateElement("Value"));
variableContainer.ChildNodes[variableContainer.ChildNodes.Count - 1].AppendChild(doc.CreateCDataSection(b.ToString()));
}
break;
case "System.UInt64":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedLong.ToString();
foreach (ulong b in (IEnumerable)value)
{
variableContainer.AppendChild(doc.CreateElement("Value"));
variableContainer.ChildNodes[variableContainer.ChildNodes.Count - 1].AppendChild(doc.CreateCDataSection(b.ToString()));
}
break;
case "System.UInt16":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedShort.ToString();
foreach (ushort b in (IEnumerable)value)
{
variableContainer.AppendChild(doc.CreateElement("Value"));
variableContainer.ChildNodes[variableContainer.ChildNodes.Count - 1].AppendChild(doc.CreateCDataSection(b.ToString()));
}
break;
case "System.String":
variableContainer.Attributes["type"].Value = VariableTypes.String.ToString();
foreach (string b in (IEnumerable)value)
Expand Down Expand Up @@ -517,6 +550,15 @@ internal static void EncodeVariableValue(object value,XmlElement variableContain
case "System.Int16":
variableContainer.Attributes["type"].Value = VariableTypes.Short.ToString();
break;
case "System.UInt32":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedInteger.ToString();
break;
case "System.UInt64":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedLong.ToString();
break;
case "System.UInt16":
variableContainer.Attributes["type"].Value = VariableTypes.UnsignedShort.ToString();
break;
case "System.String":
variableContainer.Attributes["type"].Value = VariableTypes.String.ToString();
break;
Expand Down

0 comments on commit b361a65

Please sign in to comment.