besley / Slickflow

.NET Open Source Workflow Engine, .NET 开源工作流

Home Page:http://www.slickflow.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slickflow core functionality

nitinjs opened this issue · comments

hi besley

great library indeed,
I am trying to setup the workflow engine in a new clean MVC project

Question 1
what are slickflow core tables,
I mean the tables which must be present in the db to run the slickflow.

In the provided sample db I see a lot of extra tables.
bs

Question 2
Dapper nuget package reference,
I see dapper is referenced through dll file, but when I refer the latest nuget package in project,
it throws error related to DapperExtensions.

Question 3
The provided first sample code in the article fails because "ProcessModelBuilder",
how do I initialize ProcessModelBuilder,
am I missing something?

//Create Flow Chart
var pmb = ProcessModelBuilder.CreateProcess("BookSeller Process", "BookSeller Process Code", "1");
var process = pmb.Start("Start")
      .Task("Package Books", "PB001")
      .Task("Deliver Books", "DR001")
      .End("End")
      .Store();

Question 3
can we load this process creation step from a xml/json file?

thanks

-nitin

Question 1:
The table with prefix wf*** are the neccessary tables for the workflow engine product. If you need to bind user/role for activity property, the table with prefix sys*** is a choice.

Question 2:
The dapper library is refrenced by the dapper project in the solution, there is an extension directory, you can download it from the Github project. We dont use the latest version from the nuget, this will be included later.
https://github.com/besley/Slickflow/tree/master/NETCORE/Slickflow/Source/Dapper/Extensions

Question 3:
ProcessModelBuilder is a static class in the Slickflow.Graph project, there is a code modeling page to help users to create a new process diagram:
http://demo.slickflow.com/sfd/model

CodeProject Artile:
https://www.codeproject.com/Articles/5246528/Slickflow-NET-Core-Open-Source-Workflow-Engine
https://www.codeproject.com/Articles/5252483/Slickflow-Coding-Graphic-Model-User-Manual

Question 4:
Can you tell us what format of a xml do you want to import to create a diagram? If you compare it from the xmlcontent field in the wfprocess table, you will get some information. For example, if there is a json file contain some sequential steps information, we can parse it into a diagram by using a text parser similary as the slickflow.graph logical.

thanks for your reply.

Can you tell us what format of a xml do you want to import to create a diagram?

I do not have any specific format,

the scenario is:

  1. define workflow in a xml/json file
  2. load the workflow in workflow engine
  3. run the workflow - process1
  4. edit the workflow xml/json (add/update/delete steps)
  5. reload the workflow in workflow engine
  6. run the workflow - process 2 (process 2 starts without affecting workflow defined for process1)

A. I saw the slickflow graph fluent API,
https://github.com/besley/Slickflow/wiki/Slickflow-Coding-Graphic-Model-User-Manual
http://demo.slickflow.com/sfd/model
it is good but I am looking for xml/json based solution where user binds workflow steps with C# function
B. Also in the samples above there is no event binding, I mean I want to execute business logic at each step

Hi, there is a xml content persistenced in the database loaded every time when the engine running the process. I can described the xml here, this is a very simple book seller process:

<Package>
	<Participants/>
	<WorkflowProcesses>
		<Process name="BookSellerProcess2086" id="ea19a3b1-2928-4402-89ce-64c37218d63e">
			<Description>null</Description>
			<Activities>
				<Activity id="786a0241-117b-45bf-9c5c-406d1a461057" name="Start" code="Start" url="">
					<Description></Description>
					<ActivityType type="StartNode" trigger="null"/>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="symbol;image=scripts/mxGraph/src/editor/images/symbols/event.png">
						<Widget left="50" top="160" width="32" height="32"/>
					</Geography>
				</Activity>
				<Activity id="73e24c67-b154-4e38-ab89-cf1b799826db" name="Package Books" code="003" url="">
					<Description></Description>
					<ActivityType type="TaskNode"/>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="">
						<Widget left="210" top="160" width="72" height="32"/>
					</Geography>
				</Activity>
				<Activity id="2c007aa9-5b28-4d34-9bf0-a5fd23aef43b" name="Deliver Books" code="005" url="">
					<Description></Description>
					<ActivityType type="TaskNode"/>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="">
						<Widget left="370" top="160" width="72" height="32"/>
					</Geography>
				</Activity>
				<Activity id="65946f24-a924-4b34-9fd2-5c4114897fc8" name="End" code="End" url="">
					<Description></Description>
					<ActivityType type="EndNode" trigger="null"/>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="symbol;image=scripts/mxGraph/src/editor/images/symbols/event_end.png">
						<Widget left="580" top="160" width="32" height="32"/>
					</Geography>
				</Activity>
			</Activities>
			<Transitions>
				<Transition id="6bdfa0cd-1266-46be-bacd-b2582069cb8b" from="786a0241-117b-45bf-9c5c-406d1a461057" to="73e24c67-b154-4e38-ab89-cf1b799826db">
					<Description></Description>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="null"/>
				</Transition>
				<Transition id="979f77e0-13dc-4b09-ae81-dafdf446bf46" from="73e24c67-b154-4e38-ab89-cf1b799826db" to="2c007aa9-5b28-4d34-9bf0-a5fd23aef43b">
					<Description></Description>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="null"/>
				</Transition>
				<Transition id="2bd2d1a0-b014-4d3e-90b4-2ee8afe97f12" from="2c007aa9-5b28-4d34-9bf0-a5fd23aef43b" to="65946f24-a924-4b34-9fd2-5c4114897fc8">
					<Description></Description>
					<Geography parent="75a82eb3-3848-4b84-d3e9-e38a5ff2f447" style="null"/>
				</Transition>
			</Transitions>
		</Process>
	</WorkflowProcesses>
	<Layout>
		<Swimlanes/>
		<Groups/>
	</Layout>
</Package>

its process diagram picture is below:

Sequence Flow Chart

  1. If you can reference the above xml format , the engine will run normally every time.
  2. The enterprise editon supports event binding which can be found on activity property page. The event included local c# program, webapi method, sql, store procedure and python script all be supported.
  3. I think you can make your feature based on the slickflow.engine product. It will save much time.