SlideShare a Scribd company logo
Workflow Patterns and Correlation
Workflow Patterns and Correlation
• Understand how to use correlated workflows
• Understand how to use the message correlation scope
Goals
Workflow Patterns and Correlation
• Using singleton patterns with workflows
• Using correlation when sending and receiving messages
• Using the message correlation scope
• Using compensation
Lesson Plan
Workflow Patterns and Correlation
• It is a design pattern that restricts the instantiation of a class to one object
• It is useful when exactly one object is needed to coordinate actions across the system
• In workflow, this means that for a given set of messages, only one workflow instance will be
created
• Use cases:
• Aggregating messages for batch deliver – i.e. Collect Orders for FTP to partner
• Collecting data that is delivered across multiple messages – i.e. an order is delivered across multiple
files (header, line items, footer)
Singleton Pattern
Workflow Patterns and Correlation
Singleton Pattern
What’s required for a singleton?
• Create a “Correlated Workflow”
• In a loop:
• Receive Message
• Do something with the received
message
• Check condition
• Am I expecting a certain number of
files?
• Am I expecting a “terminating” file?
• Always put a time limit – avoid
“Zombies”
Workflow Patterns and Correlation
Correlation Sets
What is a Correlation Set?
• Identifies the message as being part of a
unique set
• Necessary for Neuron to associate messages
with one another
How else can you initialize a Correlation Set?
• Correlated Workflow
• Correlation Set Tab of the Workflow Endpoint
• Can use custom properties as well as aspects
of the message
• Message Correlation Scope
• Use this when there isn’t a one-way publish to
initialize the correlation set
• Define the Correlation Set on the Message
Correlation Scope
• Define a CorrelationID and set on the Receive
Activity Must be “correlationId”
Workflow Patterns and Correlation
• Long-running transactions require asynchronous communication with external systems
• How do you correlate a response that comes in 2 days later?
• What happens to the workflow instance while it’s waiting?
• Use cases:
• EDI (Send 850 via GEIS, partner receives 850 and send back an ACK the next day)
• Approvals – Send an email requiring a response
Correlated Send / Receive
Workflow Patterns and Correlation
What’s required for a correlated send/receive?
• Correlation ID – This is the value that is used for routing incoming messages to the correct instance of
the workflow. You must define this variable, but do not set it!
• Correlation Set – This defines the location of the value in the incoming message that will be used in
the Correlation ID. It’s easiest to use a message property!
• Publish Message Activity – Publishes the one-way request and initializes the correlation set
• Receive Message Activity – Participates in the correlation by creating an internal subscription for
message(s) that match the correlation set
Correlated Send / Receive
Workflow Correlation : Demo
Purpose:
To familiarize users with correlated workflows in the Neuron ESB Explorer
Objectives:
To acquaint users with how to create correlated workflows:
• Correlation Sets
• Correlating Send and Receive
Workflow Patterns and Correlation
Compensation
• What is compensation?
• The mechanism by which previously completed work can be
undone
• Why is it important?
• Not all systems are transactional!
• How do you do it?
• Compensable Activity
• See: https://msdn.microsoft.com/en-
us/library/system.activities.statements.compensableactivity(v=vs.110).a
spx
Workflow Patterns and Correlation : Lab
Purpose:
Learn how to create a a workflow which implements correlated send and receive.
Objectives:
• Create a workflow with correlated send and receive
• Test the correlated workflow at design time
Workflow Patterns and Correlation
Review
• Correlated workflows allow Neuron ESB to implement a singleton pattern
• Correlated IDs and Correlation Sets are necessary for implementing correlation
• When systems are not transactional they can be used in a compensation block

More Related Content

Similar to Workflow Patterns and Correlation 3.7

Module 18 - Workflow Patterns and Correlation
Module 18 - Workflow Patterns and CorrelationModule 18 - Workflow Patterns and Correlation
Module 18 - Workflow Patterns and Correlation
Courtney Doeing
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7
StephenKardian
 
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Cyber Group
 
Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7
StephenKardian
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
Hiệp Tiến
 
Object modeling
Object modelingObject modeling
Object modeling
Preeti Mishra
 
Publishing Data to REST APIs with Lightning Process Builder
Publishing Data to REST APIs with Lightning Process BuilderPublishing Data to REST APIs with Lightning Process Builder
Publishing Data to REST APIs with Lightning Process Builder
Scott Coleman
 
Sviluppare app per office
Sviluppare app per officeSviluppare app per office
Sviluppare app per office
Fabio Franzini
 
Best Practices for SharePoint Timer Jobs
Best Practices for SharePoint Timer JobsBest Practices for SharePoint Timer Jobs
Best Practices for SharePoint Timer Jobs
Shailen Sukul
 
stigbot_beta
stigbot_betastigbot_beta
stigbot_beta
Zachary Job
 
Commonly used design patterns
Commonly used design patternsCommonly used design patterns
Commonly used design patterns
Mojammel Haque
 
LDV.pptx
LDV.pptxLDV.pptx
LDV.pptx
Shams Pirzada
 
Why I am hooked on the future of React
Why I am hooked on the future of ReactWhy I am hooked on the future of React
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
Portal and Intranets
Portal and Intranets Portal and Intranets
Portal and Intranets
Redar Ismail
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOA
Mohamed Samy
 
IBM File Net P8
IBM File Net P8IBM File Net P8
IBM File Net P8
Mohammed El Rafie Tarabay
 
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Particular Software
 
L06 Using Design Patterns
L06 Using Design PatternsL06 Using Design Patterns
L06 Using Design Patterns
Ólafur Andri Ragnarsson
 
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
Muhammad Sajid
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
Allan Mangune
 

Similar to Workflow Patterns and Correlation 3.7 (20)

Module 18 - Workflow Patterns and Correlation
Module 18 - Workflow Patterns and CorrelationModule 18 - Workflow Patterns and Correlation
Module 18 - Workflow Patterns and Correlation
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7
 
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
Choosing the Right Salesforce Integration: The Questions You Should Ask - A C...
 
Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
Object modeling
Object modelingObject modeling
Object modeling
 
Publishing Data to REST APIs with Lightning Process Builder
Publishing Data to REST APIs with Lightning Process BuilderPublishing Data to REST APIs with Lightning Process Builder
Publishing Data to REST APIs with Lightning Process Builder
 
Sviluppare app per office
Sviluppare app per officeSviluppare app per office
Sviluppare app per office
 
Best Practices for SharePoint Timer Jobs
Best Practices for SharePoint Timer JobsBest Practices for SharePoint Timer Jobs
Best Practices for SharePoint Timer Jobs
 
stigbot_beta
stigbot_betastigbot_beta
stigbot_beta
 
Commonly used design patterns
Commonly used design patternsCommonly used design patterns
Commonly used design patterns
 
LDV.pptx
LDV.pptxLDV.pptx
LDV.pptx
 
Why I am hooked on the future of React
Why I am hooked on the future of ReactWhy I am hooked on the future of React
Why I am hooked on the future of React
 
Portal and Intranets
Portal and Intranets Portal and Intranets
Portal and Intranets
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOA
 
IBM File Net P8
IBM File Net P8IBM File Net P8
IBM File Net P8
 
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
 
L06 Using Design Patterns
L06 Using Design PatternsL06 Using Design Patterns
L06 Using Design Patterns
 
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 

More from StephenKardian

Deployment and Configuration 3.7
Deployment and Configuration 3.7Deployment and Configuration 3.7
Deployment and Configuration 3.7
StephenKardian
 
Tracing, Logging and Troubleshooting 3.7
Tracing, Logging and Troubleshooting 3.7Tracing, Logging and Troubleshooting 3.7
Tracing, Logging and Troubleshooting 3.7
StephenKardian
 
Operational Security 3.7
Operational Security 3.7Operational Security 3.7
Operational Security 3.7
StephenKardian
 
Workflow Hosting and Tracking 3.7
Workflow Hosting and Tracking 3.7Workflow Hosting and Tracking 3.7
Workflow Hosting and Tracking 3.7
StephenKardian
 
Monitoring Neuron ESB 3.7
Monitoring Neuron ESB 3.7Monitoring Neuron ESB 3.7
Monitoring Neuron ESB 3.7
StephenKardian
 
Building Custom Adapters 3.7
Building Custom Adapters 3.7Building Custom Adapters 3.7
Building Custom Adapters 3.7
StephenKardian
 
Using Adapters and Mediation to Integrate Systems 3.7
Using Adapters and Mediation to Integrate Systems 3.7Using Adapters and Mediation to Integrate Systems 3.7
Using Adapters and Mediation to Integrate Systems 3.7
StephenKardian
 
Introduction to Adapters 3.7
Introduction to Adapters 3.7Introduction to Adapters 3.7
Introduction to Adapters 3.7
StephenKardian
 
Web Security 3.7
Web Security 3.7Web Security 3.7
Web Security 3.7
StephenKardian
 
Developing and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesDeveloping and Hosting SOAP Based Services
Developing and Hosting SOAP Based Services
StephenKardian
 
Developing and Hosting REST APIs 3.7
Developing and Hosting REST APIs 3.7Developing and Hosting REST APIs 3.7
Developing and Hosting REST APIs 3.7
StephenKardian
 
Introduction to API and Service Hosting 3.7
Introduction to API and Service Hosting 3.7Introduction to API and Service Hosting 3.7
Introduction to API and Service Hosting 3.7
StephenKardian
 
Extending Business Processes 3.7
Extending Business Processes 3.7Extending Business Processes 3.7
Extending Business Processes 3.7
StephenKardian
 
Building Complex Business Processes 3.7
Building Complex Business Processes 3.7Building Complex Business Processes 3.7
Building Complex Business Processes 3.7
StephenKardian
 
Introduction to Business Processes 3.7
Introduction to Business Processes 3.7Introduction to Business Processes 3.7
Introduction to Business Processes 3.7
StephenKardian
 
Repository 3.7
Repository 3.7Repository 3.7
Repository 3.7
StephenKardian
 
`Neuron ESB Client API 3.7
`Neuron ESB Client API 3.7`Neuron ESB Client API 3.7
`Neuron ESB Client API 3.7
StephenKardian
 
Introduction to Messaging 3.7
Introduction to Messaging 3.7Introduction to Messaging 3.7
Introduction to Messaging 3.7
StephenKardian
 
Introduction to Neuron ESB 3.7
Introduction to Neuron ESB 3.7Introduction to Neuron ESB 3.7
Introduction to Neuron ESB 3.7
StephenKardian
 
ESB Fundamentals 3.7
ESB Fundamentals 3.7ESB Fundamentals 3.7
ESB Fundamentals 3.7
StephenKardian
 

More from StephenKardian (20)

Deployment and Configuration 3.7
Deployment and Configuration 3.7Deployment and Configuration 3.7
Deployment and Configuration 3.7
 
Tracing, Logging and Troubleshooting 3.7
Tracing, Logging and Troubleshooting 3.7Tracing, Logging and Troubleshooting 3.7
Tracing, Logging and Troubleshooting 3.7
 
Operational Security 3.7
Operational Security 3.7Operational Security 3.7
Operational Security 3.7
 
Workflow Hosting and Tracking 3.7
Workflow Hosting and Tracking 3.7Workflow Hosting and Tracking 3.7
Workflow Hosting and Tracking 3.7
 
Monitoring Neuron ESB 3.7
Monitoring Neuron ESB 3.7Monitoring Neuron ESB 3.7
Monitoring Neuron ESB 3.7
 
Building Custom Adapters 3.7
Building Custom Adapters 3.7Building Custom Adapters 3.7
Building Custom Adapters 3.7
 
Using Adapters and Mediation to Integrate Systems 3.7
Using Adapters and Mediation to Integrate Systems 3.7Using Adapters and Mediation to Integrate Systems 3.7
Using Adapters and Mediation to Integrate Systems 3.7
 
Introduction to Adapters 3.7
Introduction to Adapters 3.7Introduction to Adapters 3.7
Introduction to Adapters 3.7
 
Web Security 3.7
Web Security 3.7Web Security 3.7
Web Security 3.7
 
Developing and Hosting SOAP Based Services
Developing and Hosting SOAP Based ServicesDeveloping and Hosting SOAP Based Services
Developing and Hosting SOAP Based Services
 
Developing and Hosting REST APIs 3.7
Developing and Hosting REST APIs 3.7Developing and Hosting REST APIs 3.7
Developing and Hosting REST APIs 3.7
 
Introduction to API and Service Hosting 3.7
Introduction to API and Service Hosting 3.7Introduction to API and Service Hosting 3.7
Introduction to API and Service Hosting 3.7
 
Extending Business Processes 3.7
Extending Business Processes 3.7Extending Business Processes 3.7
Extending Business Processes 3.7
 
Building Complex Business Processes 3.7
Building Complex Business Processes 3.7Building Complex Business Processes 3.7
Building Complex Business Processes 3.7
 
Introduction to Business Processes 3.7
Introduction to Business Processes 3.7Introduction to Business Processes 3.7
Introduction to Business Processes 3.7
 
Repository 3.7
Repository 3.7Repository 3.7
Repository 3.7
 
`Neuron ESB Client API 3.7
`Neuron ESB Client API 3.7`Neuron ESB Client API 3.7
`Neuron ESB Client API 3.7
 
Introduction to Messaging 3.7
Introduction to Messaging 3.7Introduction to Messaging 3.7
Introduction to Messaging 3.7
 
Introduction to Neuron ESB 3.7
Introduction to Neuron ESB 3.7Introduction to Neuron ESB 3.7
Introduction to Neuron ESB 3.7
 
ESB Fundamentals 3.7
ESB Fundamentals 3.7ESB Fundamentals 3.7
ESB Fundamentals 3.7
 

Recently uploaded

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 

Recently uploaded (20)

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 

Workflow Patterns and Correlation 3.7

  • 1. Workflow Patterns and Correlation
  • 2. Workflow Patterns and Correlation • Understand how to use correlated workflows • Understand how to use the message correlation scope Goals
  • 3. Workflow Patterns and Correlation • Using singleton patterns with workflows • Using correlation when sending and receiving messages • Using the message correlation scope • Using compensation Lesson Plan
  • 4. Workflow Patterns and Correlation • It is a design pattern that restricts the instantiation of a class to one object • It is useful when exactly one object is needed to coordinate actions across the system • In workflow, this means that for a given set of messages, only one workflow instance will be created • Use cases: • Aggregating messages for batch deliver – i.e. Collect Orders for FTP to partner • Collecting data that is delivered across multiple messages – i.e. an order is delivered across multiple files (header, line items, footer) Singleton Pattern
  • 5. Workflow Patterns and Correlation Singleton Pattern What’s required for a singleton? • Create a “Correlated Workflow” • In a loop: • Receive Message • Do something with the received message • Check condition • Am I expecting a certain number of files? • Am I expecting a “terminating” file? • Always put a time limit – avoid “Zombies”
  • 6. Workflow Patterns and Correlation Correlation Sets What is a Correlation Set? • Identifies the message as being part of a unique set • Necessary for Neuron to associate messages with one another How else can you initialize a Correlation Set? • Correlated Workflow • Correlation Set Tab of the Workflow Endpoint • Can use custom properties as well as aspects of the message • Message Correlation Scope • Use this when there isn’t a one-way publish to initialize the correlation set • Define the Correlation Set on the Message Correlation Scope • Define a CorrelationID and set on the Receive Activity Must be “correlationId”
  • 7. Workflow Patterns and Correlation • Long-running transactions require asynchronous communication with external systems • How do you correlate a response that comes in 2 days later? • What happens to the workflow instance while it’s waiting? • Use cases: • EDI (Send 850 via GEIS, partner receives 850 and send back an ACK the next day) • Approvals – Send an email requiring a response Correlated Send / Receive
  • 8. Workflow Patterns and Correlation What’s required for a correlated send/receive? • Correlation ID – This is the value that is used for routing incoming messages to the correct instance of the workflow. You must define this variable, but do not set it! • Correlation Set – This defines the location of the value in the incoming message that will be used in the Correlation ID. It’s easiest to use a message property! • Publish Message Activity – Publishes the one-way request and initializes the correlation set • Receive Message Activity – Participates in the correlation by creating an internal subscription for message(s) that match the correlation set Correlated Send / Receive
  • 9. Workflow Correlation : Demo Purpose: To familiarize users with correlated workflows in the Neuron ESB Explorer Objectives: To acquaint users with how to create correlated workflows: • Correlation Sets • Correlating Send and Receive
  • 10. Workflow Patterns and Correlation Compensation • What is compensation? • The mechanism by which previously completed work can be undone • Why is it important? • Not all systems are transactional! • How do you do it? • Compensable Activity • See: https://msdn.microsoft.com/en- us/library/system.activities.statements.compensableactivity(v=vs.110).a spx
  • 11. Workflow Patterns and Correlation : Lab Purpose: Learn how to create a a workflow which implements correlated send and receive. Objectives: • Create a workflow with correlated send and receive • Test the correlated workflow at design time
  • 12. Workflow Patterns and Correlation Review • Correlated workflows allow Neuron ESB to implement a singleton pattern • Correlated IDs and Correlation Sets are necessary for implementing correlation • When systems are not transactional they can be used in a compensation block

Editor's Notes

  1. The goals of this lesson are to provide users with an understanding of how to use correlated workflows and the message correlation scope.
  2. This lesson has been broken down into four sections to make the information presented easier to understand. The sections that we will be covering are Using singleton patterns with workflows Using correlation when sending and receiving messages Using the message correlation scope Using compensation
  3. The singleton pattern is a software design pattern that restricts the instantiation of a class to one "single" instance. This is useful when exactly one object is needed to coordinate actions across the system. In workflows this means that for a given set of messages, only one workflow instance will be created. This is extremely useful in cases such as aggregating messages for batch deliver or collecting data that is delivered across multiple messages such as an order delivered from multiple files.
  4. In order to create a singleton pattern in a workflow definition you need to create a correlated workflow, as these are the only workflow types that support the singleton pattern. Inside the workflow you would need to create a loop, usually a while loop. Using a while loop allows you to determine when to stop listening for messages. Are you expecting a certain number of messages? Is there some sort of message that indicates it is the last message in the set? Regardless of what method you use to determine the end of the expected messages, you should always encapsulate your loop in a timeout activity. This will avoid encountering zombie workflows should the final message not come through. Inside of the loop you will need to receive the message and then do something with that message such as add it to collection so the next message through does not overwrite it.
  5. So how does Neuron ESB know which messages goes to which workflow? Neuron ESB uses parts of the message or custom properties to indicate the unique identifier that tells the system what set of messages a message belongs to. This identifier is called the correlation id. Once the correlation id is found, Neuron ESB puts that value in the correlation set for the workflow endpoint. Each time a new message comes in, Neuron compares the messages correlation id with the correlation set of the running workflows. If a match is found, the message is handed off to the workflow. If not, then a new workflow is instantiated with the correlation set as the value of the correlation id. The correlation set of a correlated workflow is set on the Correlation Set tab of the workflow endpoint. This tab is only active if the workflow definition associated with the endpoint is a correlated workflow definition. Correlation sets also play a part in the message correlation scope, which we will discuss later in this presentation. However, it is important to note that the message correlation scope must be used in conjunction with a receive activity in order to get messages from the bus for the correlation set associated with it.
  6. Correlated send and receive is used when a long running transaction requires asynchronous communication with external systems. For example in a case where an approval is needed before allowing the workflow to continue processing, think loan types situations, it may take a day or more before that approval comes back. This is far outside the normal time period for a request reply scenario, so the correlated send and receive would be used to correlate the response back the the original requester without having to worry about a request reply timeout. While the workflow is waiting, the workflow unloads itself until it is informed that a message has been received.
  7. In order to perform a correlated send and receive you will need Correlation ID – This is the value that is used for routing incoming messages to the correct instance of the workflow. You must define this variable, but do not set it! Correlation Set – This defines the location of the value in the incoming message that will be used in the Correlation ID. It’s easiest to use a message property! Publish Message Activity – Publishes the one-way request and initializes the correlation set Receive Message Activity – Participates in the correlation by creating an internal subscription for message(s) that match the correlation set
  8. Compensation is the ability to undo the work performed by a series of activities, which together define an eventually consistent operation, if one or more of the steps fail. This is important if you are attempting to use transactions with a system that does not support them. The CompensableActivity activity provides this functionality for you, allowing you to create a series of steps that tell the system how to undo what was done in a system the does not support transactions.