Skip to content

Commit

Permalink
corrected bug wrt incoming flows and gateways executing without prope…
Browse files Browse the repository at this point in the history
…r conditions being met.
  • Loading branch information
roger-castaldo committed May 30, 2019
1 parent 46c6614 commit d6e8494
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 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.9</Version>
<Version>1.9.10</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 package to use a single control thread for the time delays in all business processes instead of multiple threads per process</PackageReleaseNotes>
<AssemblyVersion>1.9.9.0</AssemblyVersion>
<FileVersion>1.9.9.0</FileVersion>
<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>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
48 changes: 28 additions & 20 deletions BusinessProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,30 +1149,38 @@ private void _ProcessElement(string sourceID,IElement elem)
}
}
}
bool gatewayComplete = false;
lock (_state)
{
_state.Path.StartGateway(gw, sourceID);
}
if (_onGatewayStarted != null)
_onGatewayStarted(gw, new ReadOnlyProcessVariablesContainer(elem.id, _state,this));
string[] outgoings = null;
try
{
outgoings = gw.EvaulateOutgoingPaths(def, _isFlowValid, new ProcessVariablesContainer(elem.id, _state,this));
}
catch (Exception e)
{
WriteLogException(new StackFrame(1, true), DateTime.Now, e);
if (_onGatewayError != null)
_onGatewayError(gw, new ReadOnlyProcessVariablesContainer(elem.id, _state,this));
outgoings = null;
if (gw.IsIncomingFlowComplete(sourceID, _state.Path))
{
gatewayComplete = true;
_state.Path.StartGateway(gw, sourceID);
}
}
lock (_state)
if (gatewayComplete)
{
if (outgoings == null)
_state.Path.FailGateway(gw);
else
_state.Path.SuccessGateway(gw, outgoings);
if (_onGatewayStarted != null)
_onGatewayStarted(gw, new ReadOnlyProcessVariablesContainer(elem.id, _state, this));
string[] outgoings = null;
try
{
outgoings = gw.EvaulateOutgoingPaths(def, _isFlowValid, new ProcessVariablesContainer(elem.id, _state, this));
}
catch (Exception e)
{
WriteLogException(new StackFrame(1, true), DateTime.Now, e);
if (_onGatewayError != null)
_onGatewayError(gw, new ReadOnlyProcessVariablesContainer(elem.id, _state, this));
outgoings = null;
}
lock (_state)
{
if (outgoings == null)
_state.Path.FailGateway(gw);
else
_state.Path.SuccessGateway(gw, outgoings);
}
}
}
else if (elem is AEvent)
Expand Down
1 change: 1 addition & 0 deletions Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static Utility()
_backgroundMREEvent = new ManualResetEvent(true);
_suspendedEvents = new List<sProcessSuspendEvent>();
_backgroundSuspendThread = new Thread(new ThreadStart(_BackgroundSuspendStart));
_backgroundSuspendThread.Name = "Background Suspend Thread";
_backgroundSuspendThread.IsBackground = true;
_backgroundSuspendThread.Start();
_xmlConstructors = new Dictionary<Type, ConstructorInfo>();
Expand Down

0 comments on commit d6e8494

Please sign in to comment.