Processing Template pattern

rmv_RU
Member Posts: 119
I want to offer to the community for discussion Processing Template Pattern.
We use processing template pattern to setup document workflow for Nav and external applications.
Basic concepts:
1. Document Status. Every document should have status.
2. Statuses list must be configured for document type.
3. Processing template defines document workflow, every line of the template contains:
3.1. Current Status
3.2 Handling Template (a Function or a Set of Functions). For example - checking template, reservation template, posting template and so-on. Every handling template should return true on success or false and error description otherwise.
3.3. Status on Success.
3.4. Status on Failure.
3.5. Manual-Switching Status Filter.
3.6. On run-time error Status.
4. It's possible to define diffent Processing Templates for one document type based on rules.
4. Switching between statuses is Event. New status is Event Type. All event logs in Event Table.
5. Application server and external application can subscribe on Event Type. For example - send e-mail notification or document data via EDI.
Main idea of the subscription - run parallel processes and allow external applications handle Nav documents
A main function SwitchStatus:
1. Find processing template line and Write new status in document.
2. Generate Event.
3. Commit.
4. If Handling Template is empty and onSuccessStatus<>'' then SwitchStatus(onSuccessStatus) else exit.
4. Set Handling Template for handling codeunit.
5. If not(handlingCU.run) then begin HandleLastError(); SwitchStatus(onRunTimeErrorStatus); end;
6. if handlingCU.GetResult then SwitchStatus(onSuccessStatus) else SwitchStatus(onFailereStatus);
Benefits:
1. An application server do all work wherever possible based on templates.
2. The commit between status switching makes transactions short as possible.
3. User have only one shortcut key (F11) to run handling function and analize errors or manual switch status.
4. Document workflow is equal to visio diagram and can be configured after diagram approval.
5. External applications can subscribe on Nav events.
6. I found many reasons for the occurrence of deadlocks using LastError field of event table
.
We use processing template pattern to setup document workflow for Nav and external applications.
Basic concepts:
1. Document Status. Every document should have status.
2. Statuses list must be configured for document type.
3. Processing template defines document workflow, every line of the template contains:
3.1. Current Status
3.2 Handling Template (a Function or a Set of Functions). For example - checking template, reservation template, posting template and so-on. Every handling template should return true on success or false and error description otherwise.
3.3. Status on Success.
3.4. Status on Failure.
3.5. Manual-Switching Status Filter.
3.6. On run-time error Status.
4. It's possible to define diffent Processing Templates for one document type based on rules.
4. Switching between statuses is Event. New status is Event Type. All event logs in Event Table.
5. Application server and external application can subscribe on Event Type. For example - send e-mail notification or document data via EDI.
Main idea of the subscription - run parallel processes and allow external applications handle Nav documents
A main function SwitchStatus:
1. Find processing template line and Write new status in document.
2. Generate Event.
3. Commit.
4. If Handling Template is empty and onSuccessStatus<>'' then SwitchStatus(onSuccessStatus) else exit.
4. Set Handling Template for handling codeunit.
5. If not(handlingCU.run) then begin HandleLastError(); SwitchStatus(onRunTimeErrorStatus); end;
6. if handlingCU.GetResult then SwitchStatus(onSuccessStatus) else SwitchStatus(onFailereStatus);
Benefits:
1. An application server do all work wherever possible based on templates.
2. The commit between status switching makes transactions short as possible.
3. User have only one shortcut key (F11) to run handling function and analize errors or manual switch status.
4. Document workflow is equal to visio diagram and can be configured after diagram approval.
5. External applications can subscribe on Nav events.
6. I found many reasons for the occurrence of deadlocks using LastError field of event table

Looking for part-time work.
Nav, T-SQL.
Nav, T-SQL.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions