2. Extending Business Processes
• Know how to create and use, custom business process steps in Neuron ESB.
• Provide an understanding of the Neuron ESB Business API
Goals
3. Extending Business Processes
• Custom Business Process steps
• What is a custom process step?
• When to use a custom process step
• Custom process step API
• Registering a custom process step
• Introduction to the Business Process API
• What is the business process API?
• Executing a business process
• Creating a business process from configuration
Lesson Plan
4. Extending Business Processes
Custom Business Process Step
• An extension of the Neuron ESB
Business Process Designer
• Encapsulates reusable business
logic written in C#
• Compiled into a .NET assembly
• Added to the Process Step library
in the Neuron ESB Explorer
Business Process designer
• Supports property grid and drag /
drop functionality in the Business
Process Designer
5. Extending Business Processes
When to use Custom Business Process Steps
• When you want to encapsulate and abstract proprietary business logic for reuse in business
processes
• When properties or message content can be used to drive the behavior of business logic
• When developers should not have access to, or be able to makes changes to, business logic
Note:
• When using the Client API remotely, you must redistribute the custom process step DLL and
any dependencies along with it
Using Custom Business Process Steps
6. Extending Business Processes
Custom Process Step Project
• An extension of the Neuron ESB
Business Process Designer
• Encapsulates reusable business
logic written in C#
• Compiled into a .NET assembly
• Added to the Process Step library
in the Neuron ESB Explorer
Business Process designer
• Supports property grid and drag /
drop functionality in the Business
Process Designer
7. Extending Business Processes
Simple Custom Business Process
Only needs to inherit from CustomPipelineStep
• Must include references
• System.ComponentModel.Composition.dll
• Neuron.dll
• Neuron.Esb.dll
• System.Runtime.Serialization.dll
• Must be decorated with
• System.Runtime.Serialization.DataContractAttribute
• Neuron.Pipelines.ProcessStepAttribute
• Can optionally include a resource file (RESX)
• Access Modifier must be set to public
• Can have either 1 or 2 icons (16 x 16)
• RESX is needed to support icons
• Provides greater property grid control over “Simple”
• Has the same requirements as “Simple” with a few additions
• Additional class which inherits from StepUIElement
• Control UI experience by decorating with
[Neuron.Pipelines.StepUIElement(typeof(<class inheriting
StepUIElement>))]
• Allows dynamic adjustment of property visibility based on user input
• Supports ordering of properties
Custom Business Process Step Projects
Complex Custom Business Process
8. Extending Business Processes
• Registration Steps
• Custom Process Step must be registered with Neuron ESB Explorer
• Manual
• Edit neuronpipelines.config in Pipelines directory (deprecated)
• Automatic
• Use ProcessStepAttribute to define properties on class
• Copy .NET assembly to Pipelines folder
• Copy Icon to Pipelines folder
• Should be PNG, 16x16
• Name should be <class>.png
Registering Custom Business Process Steps
9. Custom Business Process Steps : Demo
Purpose:
Familiarize users with building and deploying a custom process step.
Objectives:
Acquaint users with the following aspects of a custom process step.
• Creating a simple business process step
• Registering the custom process step with the Neuron ESB Explorer
• Using a custom process step in a business process
10. Extending Business Processes
• Used to create / execute instances of processes and process steps, allowing business process to be added to unit testing
• Business process = A pipeline
• References
• Neuron.dll
• Neuron.Esb.dll
• Neuron.Pipelines.dll
• System.Configuration.dll
• Neuron.Pipelines.PipelineRuntime
• Creates an instance of PipelineInstance<ESBMessage> from a pipeline object
• Neuron.Pipelines.Pipeline<ESBMessage>
• Represents a business process
• Neuron.Pipelines.PipelineInstance<ESBMessage>
• Executes an instance of the pipeline (Business Process)
Business Process API
11. Extending Business Processes
• Create the Pipeline Runtime
PipelineRuntime runtime = new PipelineRuntime { DesignMode = true };
• Create an instance of the Neuron.ESB.Administrator
using (Administrator admin = AdminOffLine())
• Use the Administrator to access the Neuron ESB configuration
admin.OpenConfiguration();
• Initialize the DesignModeEsbConfigSelector for process steps
InitializeProcessStepDesignTimeConfig(admin.Configuration);
• Return Neuron.ESB.Administrator.ESBMessagePipelineStorage
processStorage = admin.GetPipelineListItemByName(processName);
• Create an instance of the ClientPipelineItem from ESBMessagePipelineStorage
ClientPipelineItem clientProcess = CreateProcessItemFromStorage(processStorage)
Executing a Business Process
12. Extending Business Processes
• Create an instance of the Pipeline
ClientPipelineItem clientProcess = CreateProcessItemFromStorage(processStorage);
var instance = runtime.CreateInstance(clientProcess.ThePipeline);
• Create an ESB Message
ESBMessage msg = new ESBMessage();
• Execute the process, which will return an ESBMessage;
Neuron.Esb.ESBMessage outMsg = instance.Execute(msg);
Sample can be found in the Neuron ESB Explorer Samples
Testing Processes from Visual Studio
Executing a Business Process
13. Extending Business Processes : Lab
Goal
In this lab, you will learn how to extend business processes, by creating a custom business process step.
Objectives
• Create a custom business process
• Register a custom business process step with the Neuron ESB Explorer
14. Extending Business Processes
Review
• Custom process steps can be used to encapsulate proprietary business logic
• Business logic can be parameterized via Property Grid
• Custom Process Steps work identically to built in Process Steps
• Business Processes can be executed and tested within Microsoft Visual Studio
• Business Processes are stored as XML blobs within the Neuron ESB Configuration
• The Pipeline Runtime is used to create an Instance of a Business Process
• The PipelineInstance is used to execute the Business Process
• The execution of a Business Process always returns an ESB Message