Return to site

Workflow Engine Tutorial

broken image


Many of you asked me to make a video about my Blender to Unreal Engine 4 workflow. You ask, I make! Here it is!In this video I explain how I set up my charac. Only non-commercial use. For commercial use, please contact sales@optimajet.com. Official site - https://workflowengine.iohttps://workflowengine.io. WorkflowEngine.NET - component that adds workflow in your application. It can be fully integrated into your application, or be in the form of a specific service (such as a web service). We can use SAP Business Workflow (WebFlow Engine) to define business processes that are not yet mapped in the SAP System.Business Workflow is particularly suitable for situations in which work processes have to be run through repeatedly, or situations in which the business process requires the involvement of a large number of agents in a specific sequence. QUICK OVERVIEW Workflow Engine is a perfect solution if you are dealing with business entities life cycle management in a project. Using embedded drag&drop designer you can create processes in your system and manage your workflows via simple API. Basic set of elements allows business users to modify workflow schemes by themselves.

You can download the sample of intergation WorkflowEngine in the end of this article.

#ComponentsDescriptionDocumentation
1WFE DesignerIt's a javascript object on a web page where you want the designer to be displayed, and a function that will process requests from the designer and pass them to WorkflowRuntime.Designer
2WFE RuntimeThis object allows to create a process, retrieve a list of commands, execute commands, set a process state, etc. It also provides an API for the designer. So, you have to create one WorkflowRuntime object in your application or service and call its methods to enable document management functionality.Runtime, Basic Operations
3DB ProviderYou have to use persistence providers to connect to the process database. Depending on your database type, you have to create an object and pass it to WorkflowRuntime.Persistence
4Workflow tablesA set of database tables. It's needed for workflow storage.Persistence
5IWorkflowRuleProviderProvides for security integration. It allows you to call the available authorization methods, or write new ones. Rules represent the functions that are called at a certain moment in time.Rules
6IWorkflowActionProviderProvides for business logic integration. It allows you to call your own business functions for each step of the workflow.Actions

Integrating Workflow Engine into any application takes about an hour and consists of 5 simple steps. This article lists examples for ASP.NET MVC and MS SQL.

Integration with solutions based on other technologies (ASP.NET WebForms, .NET WinForms, JVM) or databases (MySQL, PostgreSQL, Orcale, MongoDB and others) is roughly the same and should not entail any difficulties.

We recommend you to follow integration steps in this order:

  1. Setting up your database
  2. Initializing WorkflowRuntime
  3. Connecting Designer
  4. Creating a document workflow scheme
  5. Creating a process and calling commands

If you plan to integrate Workflow Designer into an Angular- or React-based application, read the following guide.

1. Setting up your database

1.1. Download your persistence provider here.

1.2. Execute the CreatePersistenceObjects.sql script from the SQL folder in the archive.

After you execute it, the following tables will be created in the database:

Learn more about persistence.

2. Initializing WorkflowRuntime

2.1. Create a Class Library project in Visual Studio. Name it WorkflowLib.

If you have created the .NET framework class library, use packages mentioned below. If you are creating .NET Core class library use packages for .NET Core, their names start from 'WorkflowEngine.NETCore-..' instead of 'WorkflowEngine.NET-..'

2.2. Add the following NuGet packages into your project:

for .NET Framework:

for .NET Core:

2.3. Add reference System.Configuration (for .NET Framework only).

2.4. Create a WorkflowInit.cs file. Add the following namespaces to the usings section:

Add the initialization of the WorkflowRuntime object. It should look like this:

If you have a license key, add a call to the WorkflowRuntime.RegisterLicense method with the license key.

You can find more information in documentation.

3. Connecting Designer

Workflow

If you have created the .NET framework web application, use packages mentioned below. If you are creating .NET Core application use packages for .NET Core, their names start from 'WorkflowEngine.NETCore-..' instead of 'WorkflowEngine.NET-..'

3.1. Create an ASP.NET Web Application MVC project or use an existing one. If you are creating a project from scratch, you can use the instructions from Microsoft:

3.2. Add a reference to WorkflowLib from step 2 to have access to the WorkflowRuntime object.

3.3. Add the following NuGet packages to the project of your solution:

for .NET Framework:

for .NET Core:

3.4. For .NET Core only (!): Visual Studio don't add designer's resouces to a project. Please download this, unzip and copy the following resources to your MVC project:

  • Designer.cs to Controllers folder
  • Index.cshtml to Views/Designer folder
  • wwwroot/css to wwwroot/css folder
  • wwwroot/templates to wwwroot/templates folder
  • wwwroot/js to wwwroot/js folder

3.5. Add the WorkflowRuntime object call from step 2 to the getRuntime method in the Controllers/DesignController.cs file.

Before:

After:

The following lines of code can be different and usually depends from the class library name created in step 2. For example you have to write 'ClassLibrary.WorkflowInit.Runtime' instead of 'WorkflowLib.WorkflowInit.Runtime' if you named the library as ClassLibrary.

Workflow Engine Tutorial

If you have created the .NET framework web application, use packages mentioned below. If you are creating .NET Core application use packages for .NET Core, their names start from 'WorkflowEngine.NETCore-..' instead of 'WorkflowEngine.NET-..'

3.1. Create an ASP.NET Web Application MVC project or use an existing one. If you are creating a project from scratch, you can use the instructions from Microsoft:

3.2. Add a reference to WorkflowLib from step 2 to have access to the WorkflowRuntime object.

3.3. Add the following NuGet packages to the project of your solution:

for .NET Framework:

for .NET Core:

3.4. For .NET Core only (!): Visual Studio don't add designer's resouces to a project. Please download this, unzip and copy the following resources to your MVC project:

  • Designer.cs to Controllers folder
  • Index.cshtml to Views/Designer folder
  • wwwroot/css to wwwroot/css folder
  • wwwroot/templates to wwwroot/templates folder
  • wwwroot/js to wwwroot/js folder

3.5. Add the WorkflowRuntime object call from step 2 to the getRuntime method in the Controllers/DesignController.cs file.

Before:

After:

The following lines of code can be different and usually depends from the class library name created in step 2. For example you have to write 'ClassLibrary.WorkflowInit.Runtime' instead of 'WorkflowLib.WorkflowInit.Runtime' if you named the library as ClassLibrary.

3.6. Add a database connection string in the connectionStrings section of the Web.config configuration file:

Make sure that the address of the server, authentication type,login and password match your settings.

For .NET Framework:

For .NET Core:

3.7. Init ConnectionString for WorkflowRuntime

For .NET Framework: Check that the following code in InitWorkflowRuntime method from WorkflowLib/WorkflowInit.cs is uncommented:

For .NET Core: Insert the following code to the end of Configure method from Startup.cs:

3.8. Probably, you will need to edit the styles of your application and the size of designer in the InitWFE function of the View/Designer/Index.cshtml file.

3.9. Run your web project. To do that, right-mouse-button-click on the Views/Designer/Index.cshtml file and click View in Browser.

Designer should open.

If this does not happen, check for errors on the page and refer to FAQ. You can learn more about Designer in documentation.

If you see some strange designer appearance, for example a modal windows or check boxes are looking strange, it probably mean a css conflict. Feel free to drop us a message via the contact form or at support@optimajet.com, we will do our best to fix it.

4. Creating a document workflow scheme

4.1. Create 2 commands: go, back.

4.2. Create 4 activities: Begin, State1, State2, End. Set the Initial flag for the Begin activity and the Final flag for the End activity.

4.3. Create transitions between activities. For each transition set the Trigger, Command and Classifier parameters (this step is optional).

4.4. Click Save Scheme

You can learn more about Schemes in documentation.

You can download the final scheme here.

5. Creating a process and calling commands

If you have created the .NET framework console application, use packages mentioned below. If you are creating .NET Core application use packages for .NET Core, their names start from 'WorkflowEngine.NETCore-..' instead of 'WorkflowEngine.NET-..'

If you would like to see how to manage workflows in web-application, download one of our samples.

5.1. Create a Console Application project.

5.2. Add the following NuGet packages to the project:

Java Workflow Engine

for .NET Framework

for .NET Core

5.3. Add a Reference to the project from step 2.

5.4. Add a database connection string

For .NET Framework:Add a database connection string to the connectionStrings section of the App.config configuration file:

For .NET Core:Add a database connection string to the ConnectionStrings section of the appsettings.json configuration file:

Pathfinder kingmaker gloves of dexterity. Make sure that the address of the server, authentication type, login and password match your settings.

5.5. Study documentation on how to manage workflows.

5.6. Add the following namespaces to the Program.cs file:

The following lines of code can be different and usually depends from the class library name created in step 2. For example you have to write 'using ClassLibrary;' instead of 'using WorkflowLib;' if you named the library as ClassLibrary.

Add the following extra usings for .NET Core:

Sharepoint Workflow Tutorial

Here's a sample code that shows you how to call basic operations: creating a process, getting a list of available commands, executing commands, setting a state and deleting a process:

5.7. Run your project. To do that, right-mouse-button-click the project and click Start new instance.

Jboss Workflow Engine Tutorial

The console application where you can create processes and execute commands should launch.

You can learn more about basic operations here.

Conclusion

Copper Workflow Engine Tutorial

If you completed all the aforementioned steps, by now you should have a project that looks like this.

Workflow Engine is one of the easiest workflow engines for document approval when it comes to integration. We recommend it to companies who develop information systems with workflow functionality.

You can download our samples here.

Workflow Engine Tutorial Download

If you have any questions, please, do not hesitate to contact us.





broken image