You are on page 1of 201

BUSINESS ACTIVITY MANAGER | CHAPTER 10

Chapter 10
Business Activity Manager

The Business Activity Manager (BAM) is a communication tool you can use to track data changes by monitoring
fields from selected tables within the database. As users enter and update data, an event is triggered. The Business
Activity Manager can then communicate this data event through change logs, global alerts, and automatically
printed reports.

Use the Change Log to view changes made to records throughout the database. Run these logs to track a list of data
updates made to pre-selected areas of sales orders, purchase orders, jobs, parts, and so on. You define which fields from
these records you want to monitor, so only changes important to your business processes are tracked.

Global Alerts are email messages automatically sent to a specific user or a defined group of users when certain events occur
within your company’s database. For example, you can set up a global alert that sends an email out to your sales staff when
a sales order is placed on hold. Global Alerts can also create system memos when these events occur. Several default global
alerts are provided by the application, but you can use the Business Activity Manager to create your own custom alerts.

You can extend BAM alert functionality by creating procedure programs. Use these programs to automatically generate tasks,
create .xml files from the changed data, and update data within multiple records.

Use the Auto-Printing functionality to automatically print out reports and labels when changes you define occur within a
table. This data is automatically sent to a printer – giving users either a preview display or a hard copy printout of the labels
or reports.

Lastly, you can define when these BAM events are triggered by setting up a series of rules. These rules define conditions
that limit how often change logs update, global alerts run, and auto-printed reports activate.
BUSINESS ACTIVITY MANAGER | CHAPTER 7

EPICOR SOFTWARE CORPORATION | 393


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Business Activity Manager


The core piece of this functionality is the Business Activity Manager (BAM) program. You use this key tool to select the tables and
fields you want to monitor – and the communication method you use to display the information (change list, global alert, auto-print,
and other options).

To do this, you first must create an Event. This event record defines the table and the fields monitored by the Business Activity
Manager. You then assign an Action, or Actions, that run when the event is triggered by a change in the data. If you need, you can
also add Rules to the event. These rules regulate when the event is launched, limiting it to specific changes within the database.

This section of the chapter explains the main features of this program. Later sections of this chapter explore change logs, global alerts,
and auto-printing through specific examples.

Main Menu Path: Executive Analysis > Business Activity Management > Setup > Business Activity Manager

Business Activity Manager - Event


To begin using the Business Activity Manager, you must create an event. An event defines the specific table and the fields used in the
change log, global alert, or auto-printout.

Create an Event

You create an event on the Detail > Event sheet. Here’s how:

1. Click the Down Arrow


next to the New button; 1
select New BAM.
8
2. Now select the Table Name
from which to create the
event. You can enter this
name directly, select it from 2
the drop-down list, or click
the Table Name button to 3
find and select it. For this 4 7
example, you select the
JobHead table.
6
3. Enter a Description for the
event. In this example, you
enter Requested Due Date.
5
Click Save.

4. The Available Fields list


displays all the fields that you
can monitor within the
selected table.

5. To add a field to the event,


highlight a field on the
Available Fields list.

6. Click the Right


Arrow button.7
6

394 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

7. The field displays within the Selected Fields list. Any data within this field is now monitored by the event.

You can both add and remove multiple fields from the Selected Fields list. To add all the fields from the table, click the Double-
Right Arrow button. To remove a single field, highlight it from the Selected Fields list and click the Left Arrow button. To
remove all the fields from the event, click the Double-Left Arrow button.

8. To record your event, click Save on the Standard toolbar.

Business Activity Manager - Action


Use the Actions sheet to define the purpose for the current event. You first indicate if this event is for a change log, a customized
global alert, an auto-print report, or a combination of these three options.

Depending on the action(s) you select, you enter other items on this sheet – such as selecting the global alert’s recipients or defining
which automatic report prints out.

Create an Action

Here’s how you create an action for the current event:

1. Select the Create Log check


box to activate a change log
for this event. Any changes
made to the table’s fields
monitored by the event record
on this log. For more 2 3
information, read the Change
Log section later in 1
this chapter.
4
2. Select the Send Alert check 5
box to indicate the current
event causes a global alert to 6
be sent. Each time data
changes within the selected
table’s fields, a global alert is
sent to the users you define
on this sheet. Selecting this
check box activates the From,
To and Additional Alert
Procedure sections.

To use global alerts, you


must assign the Global
Alerts/Email Server process
to a recurring schedule.
To learn how to activate
this process, read the
Global Alerts section later
in this chapter.

3. Select the Auto-Print check box if you want the data change to cause a report to automatically print. Selecting this check box
activates the Auto-Print fields.

4. The Email Address field defines from whom the custom global alert is sent. Enter an email address in this field.

5. Enter a Label for the custom global alert. This value is the title that appears in the Subject line for the email alert message,
for example, Job Change or Update.

6. Now enter the Alert Text for this custom global alert. This text appears within the alert message. Enter text that best
communicates the reason why this custom global alert was sent.

EPICOR SOFTWARE CORPORATION | 395


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

7. Select the Append Log Text


check box to indicate this alert
message also displays within
the change log for this event.
The global alert automatically 16
becomes an entry within the
change log.
7
8. Select the Include Link check
8
box to cause an Alert.mfgsys
(configuration) file to be
attached to the alert message.
Users can save this 9 10 11
configuration file within their
Client/Config folders and
point their shortcut icon to
this configuration file. When
users launch their shortcut
icon using this file, the record 12 13
that caused the alert
automatically displays within
its appropriate program. 14
15
For more information about
this feature, read the Alert
Attachments section later in
this chapter.

9. Click the Related button to find and select roles for the custom global
Use roles to define groups of people that perform
alert. All users assigned to the selected role receives the email alert. In
similar functions within your company. You create
this example, the ProductionPlanner and AlertGroup-ShpSupervisor roles
roles within Role Code Maintenance and then assign
are selected.
these codes to specific people within Workforce
Maintenance. For more information, review these
10. Use the To: field to define specific users that receive this custom global
program topics within application help.
alert. You directly enter user email addresses in this field.

11. Use the CC: field if you want additional users to receive a courtesy copy of this custom global alert. You directly enter user email
addresses in this field.

12. Click the Alert Program… button to find and select a custom procedure (.p) program that automatically runs when an alert is
sent. These optional programs extend the functionality of the global alert. For more information about this feature, read the
Global Alerts section later in this chapter.

13. After you find and select the Alert Program you want, its path and filename display in this field.

14. If you are setting up an auto-print action, the Report ID drop-down list becomes active. Select the identifier for the report that is
used to automatically print a report from this data. For more information, read the Auto-Printing section later in this chapter.

15. Select the Data Definition ID assigned to the generated report. This defines the customized report that automatically displays or
prints through this BAM event. The data definition indicates the tables and fields that populate a Crystal report or BarTender
label. For more information, read the Report Data Maintenance section later in this chapter.

16. When you finish defining the action, click Save on the Standard toolbar.

396 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Business Activity Manager – Rules


Use the Rules sheet to define the conditions that must occur before an action is launched from the BAM event. Use this sheet as
a filter to prevent an action from running every time data within the table is added or updated.

Create a Rule

Here’s how you add a rule to the BAM event:

1. Click the Down Arrow


next to the New button;
select New BAM Rule.
1
2. Three check boxes are
available – For Log, For Alert
and For Print. Use them to 2 3 4 5 6
indicate the action you are
creating with this rule. You
can select one or multiple
check boxes. The active BAM
action(s) you select are then
affected by this rule.

3. Use the And/Or drop-down


list to define how this rule
works in relationship with
other rules for this event.
Available options:

• And – This rule must be


TRUE in addition to any
other rule.

• Or – Either this rule must


be TRUE, or another rule
must be TRUE.

• Blank – This option must be selected for the first rule. It causes all the other “And/Or” rules to run after it.

4. If you wish to nest two or more rules together, enter the Open Parenthesis “(“ character values you need here. You can enter
as many open parenthesis characters as you need. Use this functionality to define the beginning of a group of nested rules.

5. The Field Name (Evaluate, the first Field Name field on the row) displays the name of the field evaluated by the rule. The only
fields that display on this drop-down list are the fields selected on the Event > Detail sheet.

6. Use the Operator drop-down list to define how the evaluated field is compared with either a Constant field or the Field Name
(Comparison) field. The operator list that displays depends on the type of field that will be compared:

• Numbers: >, <, =, >=, <=, < >

• Strings: >, <, =, >=, <=, < >, BEGINS, MATCHES

• Booleans (check boxes): =, < >


4567

EPICOR SOFTWARE CORPORATION | 397


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

7. When the Constant check


box is selected, the item used
to compare against the Field
Name (Evaluate) field is a set,
or constant, value. Depending 15 14
on the value selected in the
Field Name (Evaluate) field, 7 8 9 10 11 12 13
either the Value field or the
Date field is available. If the
Field Name (Evaluate) field is
a date, then the Date field is
available. For all other data
types, the Value field is active.
Use this field to enter the
constant value you need.

If this check box is clear,


however, the second Field
Name (Comparison) field
becomes active. You can then
select a different field from
the BAM event table to
compare against the first Field
Name (Evaluate) field.

8. Use the Field Name (Comparison, the second Field Name field on the row) to define the value this rule uses to compare
against the Field Name (Evaluate) value. This field is available only if the Constant check box is clear and the evaluated field is not
a date field.

If this field is available, all the fields from the event’s selected table display on this drop-down list. Select the field you need.

9. The Value field defines the constant value used to compare against the table field. This field is available only if the Constant
check box is selected and the Field Name (Evaluate) being compared against is a value other than a date value. You can
enter the value you need for the condition in this field.

10. The Date field displays the specific date used to compare against the Field Name (Evaluate). This field is only available if
the Constant check box is selected and the Field Name that will be evaluated is a date value.

11. Select the From Today check box if the rule criterion is based on a number days from the current date (Today). This check box is
available only if the Constant check box is selected. Selecting this check box activates the Days From Today field.

12. The Days From Today field displays how many days, from the current system date (Today), are used to satisfy the condition for
this rule. This field is available if the From Today check box is selected. Enter a numeric value in this field.

13. If you wish to nest two or more rules together, enter the Close Parenthesis “)“ values you need here. You can enter as many
close parenthesis values as you need in this field; you can then end a series of nested rules.

14. To make sure your rules are valid, click the Test button. If the rules are
You must validate your rules after you add them.
correct, a green icon displays.
If the rules are not validated, the actions they
regulate do not run.
15. You can add as many rules as you need. When you finish, click Save on
the Standard toolbar.

This completes the overview of the Business Activity Manager program. The next sections show you specific examples about how to
create and use change logs, global alerts, and auto-printing.

11 12 13 14

398 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Change Logs
You use a change log to track changes made to a specific record. Change logs are available for several areas throughout
the database.

During the example in this section, you use the Requested Due Date BAM created earlier in the chapter. You activate
a change log that monitors updates made to the Requested Due Date field on a job record.

Activate the Change Log

Here is how to turn on the change log:

1. Return to the Detail > Event sheet.

2. Click the Table Name… button to find


and select the BAM record you need.
1
In this example, you select the JobHead
table (the Requested Due Date BAM).
2
3. Verify the ReqDueDate displays within 3
the Selected Fields list.

4. Click the Detail > Action tab.

5. Select the Create Log check box.


6 4
6. Click Save on the Standard toolbar.
BUSINESS ACTIVITY MANAGER | CHAPTER
7 5

EPICOR SOFTWARE CORPORATION | 399


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Change Log – Test the Log

You are ready to see if the change log is working correctly. To do this, launch Job Entry and change the Requested Due Date on a job.
Here is how:

1. Navigate to this program: 1


Production Management >
Job Management > General
Operations > Job Entry
2
2. Click the Job… button.

3. The Job Search 3


window displays.

4. From the Job Status drop-down list,


select Open.

5. Click Search.
5
6. All the open jobs display in the Search
Results grid. Select a job on this grid.
4
7. Click OK.

400 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

8. You return to 8
Job Entry.

9. Clear the Engineered


and Released check boxes.

10. Enter or select a different date


within the Req By field.
9

10

11. Select the Engineered and


Released check boxes again.

12. Click Save on the 12


Standard toolbar.

13. You are asked if you want to


schedule the job. Click Yes.
BUSINESS ACTIVITY MANAGER | 11
CHAPTER 7

13

14. The Schedule Job 14


window displays.

15. Click Ok.

15

EPICOR SOFTWARE CORPORATION | 401


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

View the Change Log

You can now see the change you made to the job. Here’s how:

1. Return to Job Entry. 1

2. Click the Change Log button


on the Standard toolbar. 2

3. The Change Log Viewer 3


window displays.

4. Click a change log entry


4 5 6
within the Tree View.

5. Now click the List tab. Each change


made to the current record displays.

6. To view information on a specific


transaction, click the Detail tab.

Update from the Previous Version


If you want to use a change log created in a previous version of the application, you may need to redo the BAM event’s tables so it
uses the current database schema. If the change log displays a “[Field Name] not valid error message,” you must update the BAM
event.

To do this, launch the Data Dictionary Viewer. Use this program to find out where For more information about the Data Dictionary
the information from the obsolete field is now currently stored. When you know Viewer, review Chapter 6: Customization Utilities
what changes were made, launch the Business Activity Manager to update the within the Epicor ICE User Experience and
fields monitored by the event. Customization Guide.

402 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Global Alerts
Two kinds of global alerts are available within the application. One kind is a series of standard alerts activated through Global Alert
Maintenance. You cannot modify these standard alerts; you can only activate or inactivate them. Several standard alerts are
available, so review this list first to see if an alert you want already exists.

If an alert is not among the standard alerts, you can also create custom global alerts through the Business Activity Manager.
You define the fields that trigger the custom alert, the message that displays, the users who receive the alert, and so on.

The basics of how you create custom global alerts were described in the previous Business Activity Manager section. This section now
explores all aspects of global alerts – setup, default alerts, custom alerts, and alert (.p) programs.

Global Alerts Setup


Before you can use global alerts, you must define the email settings your application uses. You do this within Company Configuration
Maintenance. You then need to schedule the Global Alerts/Email Server Process. This process must be set to a recurring schedule so
the alerts are regularly generated and distributed.

Company Configuration – Email

You first need to define the email settings within Company Configuration.

Main Menu Path: System Management > Company Maintenance > Company

You use the System > General Settings sheet to define the SMTP Server that distributes email throughout your company. Much like a
post office receives your mail and then delivers it to various locations; the SMTP Server also receives your company’s email and then
distributes it through your company’s email application – for example, Microsoft® Outlook®.

The SMTP Server must be defined for each company within your Epicor
While the SMTP Server is required to send email,
application. Before you can send email within the current company, set up the
an Exchange Server is not required.
server on this sheet.

Here’s how you define the email settings:

1. Click the System > General


Settings tab. 7

2. The Email Link Port field defines


the port number used for email 1
within the current company. Enter
an unused port number within 2
this field. This port is used when
3
sending a global alert with an
attachment. When the user 4
opens the alert and clicks on the
5
attachment, the application
listens on this port to retrieve 6
the correct data in the program
related to the alert. For example: 51000

3. The Email Address field displays the


default From email address used for all
global alert email. This address displays
on all From fields within the email. If
you need, you can change this value on
a specific alert.

EPICOR SOFTWARE CORPORATION | 403


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

4. The Email Label field defines the default From label for all global email. This label automatically displays on standard and
custom global alerts. For this example, you enter Epicor Auto Mail.

5. The SMTP Server field displays the name of the SMTP Server. Enter the The application cannot authenticate or authorize
server that processes your company’s email. (using passwords and logins) email sent to the SMTP
Server. If your server does not permit Anonymous
6. The SMTP Port field displays the port number that handles your connections, you can set up a relay connection that
company’s email. This value is the port number on the SMTP Server. authenticates its connection before it is sent to the
For example, 25. SMTP Server.
7. When you finish, click Save on the Standard toolbar. This relay connection acts as a virtual server that
provides security for your actual SMTP Server. When
the mail is received by this virtual server, it is sent to
the SMTP Server. The global alerts email is then
distributed throughout your company. Be sure to
work with your Epicor consultant before you set up a
virtual server.
1
Activate Global Alerts/Email Server Process

To run global alerts, the Global Alerts/Email Server Process must be assigned to a schedule within the system agent. You create
schedules within System Agent Maintenance. You do not need to have email running when the global alert is sent. The global alert is
instead sent out when the process is run through the schedule.

The Global Alert/Email Server Process must run each time you start the
To learn how to create a new schedule, review the
application, so you must create a Start Up Schedule within System Agent
System Agent Maintenance section within
Maintenance that automatically runs this process.
Chapter 1: Automatic Data Processing.

Main Menu Path: System Management > Utilities > Global Alerts/Email Server Process

Here’s how to set up the Global Alerts/Email Server Process:

1. Select the Continuous


Processing check box to
indicate this process should
run constantly. Because this
6
process is a start up task, you
must select this check box.
Only continuous processes
can be added to the Start 1
Up Schedule.
2
2. The Continuous Processing
Delay field defines how many 3 5
minutes can pass before this 4
continuous process is run
again. This field is available if
the Continuous Processing
check box is selected. In this
example, the process is run
every minute.

3. The Log Filename defines the path and the filename used to track the activity of this process. You can enter this path and
filename directly, or click the Log Filename… button to find and select it. Later in this chapter, the Global Alerts Log section
details how you can locate and display this log file.

4. From the Schedule drop-down list, select the Startup Task Schedule. The Global Alerts/Email Server Process must be scheduled
as a startup task.

404 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

5. When you select a schedule other than Now, the Recurring check box becomes available. Select this check box to indicate this
process is run on a regular basis.

6. Click the Submit button.

The process is now added to the schedule. This causes the global alerts process to run when the Process Server and the Task Agent
are active.
BUSINESS ACTIVITY MANAGER | CHAPTER 74
Stop/Restart Process Server and Task Agent

To complete the global alerts setup, you next must stop and then restart both
Stopping the Process Server and the Task Agent does
the Process Server and the Task Agent for your database.
not push users out of the application. If you shut
down the main AppServer, however, users are forced
You use the Progress Explorer Tool to stop and restart these items.
to exit the application.
Here’s how:

1. Click your Start button


and navigate to the Progress 1
Explorer Tool. Launch
this program. 2
3
2. Click the Action menu.

3. Select Connect.

4. The localhost Login window displays.

5. Enter your User name and Password.

6. Click OK.

4
5

EPICOR SOFTWARE CORPORATION | 405


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

7. You now see the AppServer


folder. Select this folder.

8. The Process Server and the


Task Agents for your
databases display.

9. Right-click the Process


Server for your database.

10. From the context menu, 9


select Stop.

8 10

406 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

11. Now right-click the Task


Agent for your database.

12. From the context menu,


select Stop.

11

12

13. When both the Process Server


and the Task Agent have the
Not Running status, you can
start them again. To do this,
right-click the Process Server.

14. From the context menu,


select Start. 13

14

EPICOR SOFTWARE CORPORATION | 407


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

15. Now right-click the


Task Agent.

16. Select Start. 17

17. Exit the Progress


Explorer Tool.

You have stopped and restarted 15


these database tools. You can now
run global alerts within your
Epicor application. 16

If at any time you change your


SMTP settings, you must stop
and restart the Process Server
and Task Agent again. The
application then initializes with
your new email configuration.

Global Alerts Log

All the activity generated by the Global Alerts/Email Server Process is automatically recorded by the Global Alerts Log. You can use this
file to review this activity and troubleshoot issues that may occur during the global alert process.

You locate and open this file through Microsoft Windows® Explorer®. Here’s how:

1. Navigate through the path


defined within the Global
Alerts/Email Server Process
window. You define this path
within the Log Filename
field. The previous section,
Activate Global Alerts/Email
Server Process, explains what
you enter in this field. 1

In this example, the log is


stored within this directory
path: C:\epicor\Epicor900

2. Open the
GlobalAlertsEmail.log file.
17

408 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

3. The log file displays 3


within the
Notepad application.

4. The left columns of the log


display the Date and
Time the alert
processing occurred.

5. The Computer Name and


the Database that initiated
the activity are shown. In this
example, MNSONOMA:3831
displays. MNSONOMA is the
name of the client, while
3831 is the installation
specific database.

6. The name of the process


that ran displays.

7. If any processing errors


occurred, the errors display on
the right side of this log file.
Some typical errors:

• SMTP Code 0 – This error


message displays because
either the SMTP Server is 4 5 6 7
set up incorrectly on the
Company Configuration > Email sheet, or something is blocking the communication.

For example, many virus applications block traffic on port 25 because this software assumes it is spam. You may need
to modify your virus protection so that traffic can travel through this port.

To check your SMTP Server, launch a DOS shell. At the command prompt, enter this command: telnet smtpservername 25
(or the port number you use). This should connect you to the SMTP Server. You can now enter “Hello” and press <Enter> to
see if you get a response.

• 550 Relaying Not Allowed – A common issue, this occurs because the application sends out the alerts and email without
any authentication. Most mail servers do not permit this mail to be sent.

You need to update your mail server so it can use relaying, or global alerts will not work. Most mail servers permit
relaying from a specific host. For example, you could identify that your system server needs to permit relaying. Global alerts
then work as expected.

Global Alert Maintenance


Although you can create custom global alerts, the application contains several
Custom global alerts are created within the Business
pre-built global alerts that may address your needs. These global alerts are
Activity Manager program. To learn how to create
activated through Global Alert Maintenance.
your custom alerts, read the Custom Global Alerts
section later in this chapter.
The events that trigger these standard global alerts are pre-defined and
cannot be changed. When you first install the application, these global alerts
are inactive. You must first set up your application to run global alerts; the
steps to do this are described in the previous Global Alerts Setup section. You
can then use Global Alert Maintenance to activate the global alerts you want.
4567

EPICOR SOFTWARE CORPORATION | 409


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Global Alert Maintenance – How to Use

You can launch Global Alerts Maintenance from several locations within the Main Menu. This program is available within the Setup
folders for these modules:

• Customer Relationship Management

• Quote Management

• Order Management

• Accounts Receivable

• Accounts Payable

• Job Management

• Quality Assurance

In this example, Global Alerts Maintenance is launched from Production Management > Job Management > Setup >
Global Alert.

Here’s how you activate a global alert:

1. Click the ID… button to find


and select the global alert.
In this example, you
select global alert 1170.

2. The Description field displays


the detailed text of the global
3 4 5
alert. In this example, the field
displays: Job released status
has been changed.
1
3. If you use this global alert,
select the Active check box. 2

4. Select the Create Memo


check box if you want a
memo created when this alert
triggers. This memo is linked
to the record (the job, order,
quote, and so on) that
triggered the alert. You can
display the memo by clicking
the Memos button in the
Entry or Tracker program.

5. Select the Send Alert check


box if you want an email alert
message sent when this alert If the Send Alert option is selected as well, but the
triggers. When you select this email cannot be sent (for example, if the mail server
check box, related email alert is not available), the application creates a memo
message fields, like the From instead. This happens even if the Create Memo
Email Address and Alert check box is not selected for the alert.
fields, activate.

410 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

6. The From Email Address


field displays the email
address from whom the
global alert is sent. The
default email address defined 12
within the Company
Configuration > Email sheet
displays here by default. If you
need, however, you can enter
a different email address here.

To learn more about this 6


feature, read the previous
Company Configuration – 7
Email section.

7. The Label field defines the 8


text that appears with the
9 10
From portion of the email
message. The default label
11
defined within the Company
Configuration > Email sheet
displays here by default. If you
need, however, you can enter
a different label here.

8. Some alert messages have a


Specific Recipient already defined for them. These are defined by the For a complete list of the standard alerts and the
standard alert and cannot be changed. In this example, the standard specific recipient that receives them, read the Global
alert has Groups defined as a specific recipient. Alerts Maintenance – Listing of Alerts topic within
application help.
9. Use the To: field to enter the email addresses of the people who should
receive this global alert. You can enter as many email addresses as
you need.

10. Use the CC: field to enter the email addresses of any people you want to receive a courtesy copy of this alert message. You can
enter as many email addresses as you need.

11. Enter any additional Text you want displayed with the alert message.

12. When you finish, click Save on the Standard toolbar.

This global alert is now active within your application. Some global alerts require additional setup before
they can be used. These are the CheckOff Box alerts
available for both Opportunity/Quote Entry and Job
Entry; the user-defined alerts activate for quoting
and production tasks. To leverage these alerts, you
first need to customize the Job Entry and
Opportunity/Quote Entry programs to display these
special checkoff boxes; you can then activate their
corresponding global alerts. To learn how to add
check boxes and labels to a user interface, review
the Basic Customization chapter within the Epicor
ICE User Experience and Customization Guide. For
more information on these specific alerts, review the
Global Alert Maintenance topics within
application help.

EPICOR SOFTWARE CORPORATION | 411


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Global Alert Maintenance – Test Alert

You are ready to test the standard global alert. To create a global alert using this example, you need to change the release status
of a current job. Here’s how:

1. Navigate to Job Entry: 1


Production Management >
Job Management >
General Operations 4
> Job Entry

2. Click the Job… button to 2


find and select an existing job.
3
3. Select this job’s Released
check box.

4. Click Save on the


Standard toolbar.

5. Because the Global


Alerts/Email Server Process
is set to continuous processing
every minute, the global alert
soon sends an email to its
selected recipients. In this
example, the “Job released
status has been changed”
email is sent. 5

6. Notice an Alert.mfgsys 6
configuration file is also sent
as an attachment. You can 7
use this file to launch the
application and immediately 8
display the changed record.
For more information about
this feature, read the Alert
Attachments Maintenance
section later in this chapter.

7. The Job Number that


changed displays.

8. The Change Log Text you entered is also shown.

Now each time a job’s release status changes, the users assigned to this global alert receive these email messages.
BUSINESS ACTIVITY MANAGER | CHAPTER 7
Custom Global Alerts
You might have a business requirement where you need to create your own global alerts or automatically update data. You can do
both functions by creating custom alerts within the Business Activity Manager.

412 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Custom Global Alerts – How to Use

You create a custom alert by first selecting the fields you want the BAM event to monitor. You then create the alert by using fields that
are similar to those found within Global Alert Maintenance.

Here is what you do:

1. Launch the Business 1


Activity Manager.

2. Navigate to the Detail >


Event sheet. 2

3. Click the Table Name…


button to find and select the 3
table that contains the event
you want to turn into a global
alert. In this example, you
select the JobHead table. 4

4. The Selected Fields list


contains the fields
monitored by the global alert.
In this example, the
ReqDueDate field is monitored
by the Business
Activity Manager.

5. Click the Detail >


Action tab.

6. Select the Send Alert


check box. 13 5

7. Enter the Email Address used 6


to send out the global
alert email.
7 11
8. Enter the Label that appears 8 12
for the title of the email. For
9
this example, you enter:
Epicor Auto Mail.
10
9. Now enter the Alert Text you
want to display within the
body of the email message.
For this example, you enter:
Please verify that the new
requested due data is valid.

10. Use the fields in the To group


box to define the roles,
specific users, and courtesy
copy users you want to
receive this custom alert.

11. To have this custom alert text also display within the change log, select the Append Log Text check box.

EPICOR SOFTWARE CORPORATION | 413


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

12. Select the Include Link check box to have an Alert.mfgsys configuration file sent with the alert as an attachment. You can use
this file to launch the application and immediately display the changed record. For more information about this feature, read the
Alert Attachments Maintenance section later in this chapter.

13. Click Save on the Standard toolbar.

Custom Global Alert – Test Alert

You now can see your custom global alert in action. Here’s how:

1. Navigate to Job Entry: 1


Production Management >
Job Management > General
Operations > Job Entry 4

2. Click the Job… button to


2
find and select an existing job.

3. Select a new date within the


3
Req By field.

4. Click Save on the


Standard toolbar.

5. Because the Global


Alerts/Email Server Process
is set to continuous processing
every minute, the custom
global alert is soon sent as an
email to its selected recipients.
In this example, the
Requested Due Date
6
email is sent.
5
6. Notice the From: and To: 7
addresses selected on the
BAM event’s Action 8
sheet display.
9
7. An Alert.mfgsys
configuration file is also sent
as an attachment. You can
use this file to launch the
application and immediately
display the changed record.
For more information about
this feature, read the Alert
Attachments Maintenance section later in this chapter.

8. The Text you entered for the action displays in the main field of the email.

9. Notice the new Req. By: date displays in the message.

414 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Custom Global Alerts – Procedure Programs


You can further extend the functionality of a custom global alert by creating a procedure (.p) program. When you select a .p program
as an Additional Alert Procedure on the Business Activity Manager – Action sheet, automatic functions defined within the .p program
run. Available functions:

• Generate Tasks – These tasks relate to the updated data; the tasks are distributed to the specific users linked to the task.
You can generate several task types through this feature.

• Create .XML Files – These .xml files use data from the updated fields within the event’s selected table. These .xml files can then
be viewed and managed through any .xml tool that you want to use.

• Update Data – You can update data by using a global alert as a trigger. To do this, you run another process related to
the custom global alert. This process updates the data and displays it within the appropriate programs.

Procedure Method Coding

The procedure programs run these features by referencing functions contained within the Global Alert Include (GlbAlert.i) file.
This .i file is located within the user-defined (ud/GlbAlert.i) directory.

In this example, the directory path is:


\\mnepicdoc\Epicor905\server\ud

While you create the .p file, you must


reference this GlbAlert.i file. The application
then recognizes which functions you are
calling by creating the tasks, .xml files, and
data updates you specify within your custom
.p program.

To create a .p file, you need some


programming knowledge. If you are not
a programmer – but still want to leverage
this functionality – the Epicor Custom
Solutions Group can create .p programs
for you on a billable basis. Contact
your Epicor Account Manager
for more information.

You first reference the functions you need within the .p file, and then define which record to pass to the procedure.
Here is an example of the syntax you use for each function:

{ud/GlbAlert.i &TableName = “Customer”}

The following list displays all the parameter variables available within the GlbAlert.i file. Use this list to help you define which tables,
users, and actions are affected by the procedure program. The parameter variables:

• Include Parameters:

• &TableName – A required parameter, the name of the database table.

EPICOR SOFTWARE CORPORATION | 415


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

• Record Parameters:

• OLD<tablename> – Defines the original values of the database record that will change.

• <tablename> – Defines the new values of the database record that will change.

• ChgLogGA – Defines the record of the Change Log that will process.

• Email Parameters:

• Email-From – The email address from which this email is sent.

• Email-To – A semi-colon delimited list of email addresses to which the email is sent.

• Email-CC – A semi-colon delimited list of email addresses to which the email is courtesy copied.

• Email-Subject – The subject line of the email.

• Email-Text – The body of the email.

• Email-Mime-Header – Defines the type of email that will be sent. The preprocessors {&TEXT-Mime} and {&HTML-Mime} can
be used to switch between text and HTML email.

• Email-BodyType – This value should always be “text”.

• SendEmail – The default value is TRUE. Setting this to FALSE cancels sending out the email.

• Return Values:

• “Cancel Send” – Cancels sending out of the email.

The GlbAlert.i file contains functions you use with these parameter variables. The functions and what they do:

• GetFileName.i – A temp-table to hold tasks that will be created. It is very important that the RelatedToFile and Key fields
populate before you save them to the database.

• CreateSalesRepTask – This function automatically creates a sales representative task.

• CreateCustomerTask – This function automatically creates a customer task.

• CreateECOTask – This function automatically creates an Engineering Change Order (ECO) task for the
Engineering Workbench.

• CreateHelpDeskTask – This function automatically creates a HelpDesk task.

• CreateQuoteTask – This function automatically creates a quote task.

• CreateTask – This function automatically creates a general task.

• SaveTasks – This function automatically records the tasks generated through the procedure program.

• DumpRecordAsXMLFile – This function automatically creates .xml files that contain the data generated through the
procedure program.

The following sections provides examples on how you can use each of these functions.

416 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Generate and Save Tasks

Through a .p program, you can define which tasks generate when specific data is updated within a table. Any tasks defined within
this procedure program distribute throughout the application. If the BAM event is optionally set up to send email, a global alert email
is sent out to the users defined on the action and the linked .p program is also run.

An example will guide you through creating


a .p program that generates tasks. In this
example, the program, BAMQuoteHed.p, is
found within the application using this
directory path: \\mnepicdoc\Epicor905\
server\ud\Test

This sample code shows you how to create all the tasks available within the GlbAlert.i file:

/* Copyright 2005 by Epicor Software Corp, Inc. All Rights Reserved.


*/
/*——————————————————————————————————: ud/test/BAM-QuoteHed.p
Description: Sample to demonstrate how to create Tasks thru Global
Alert.
This file requires the functions defined in include file ud/GlbAlert.i.
Input Parameters: <none>
Output Parameters: <none>
Author: Product Marketing / Product Management
Created: 06/23/05
Special Notes and Considerations:
This program was created as an example and is intended to showcase the possibilities of the
Business Activity Manager. The content and formatting of this example is reasonably correct but
any use of this example a true business environment is at your own risk. Remember this is an
example and NOT standard code.
Technical Support is not supporting this example. Help can be available on a billable basis
from the Custom Solutions Group. By using this program you are accepting responsibility for
the content of the data updated in the MfgSys database.
Revision History:
————————-
06/23/05 Raj Initial Create.
——————————————————————CHAPTER 7 | BUSINESS ACTIVITY MANAGER
———————————————————- */
{ud/GlbAlert.i &TableName = “QuoteHed”}

define variable lSuccess as logical init false no-undo.


define variable cErrorMessage as character no-undo.
if MfgSys.QuoteHed.Reference <> OldQuoteHed.Reference then do:
/********************

EPICOR SOFTWARE CORPORATION | 417


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

There are a few functions to choose from: (These functions are


coded in ud/GlbAlert.i
1) function CreateSalesRepTask returns logical private ( input
ipSalesRepCode as character )
If you want to create a task RelatedToFile “SalesRep”
2) function CreateCustomerTask returns logical private ( input
ipCustNum as integer )
If you want to create a task RelatedToFile “Customer”
3) function CreateECOTask returns logical private ( input ipECOGroupID as character )
If you want to create a task RelatedToFile “ECOGroup”
4) function CreateHelpDeskTask returns logical private ( input
ipHDCaseNum as integer )
If you want to create a task RelatedToFile “HDCase”
5) function CreateQuoteTask returns logical private ( input
ipQuoteNum as integer )
If you want to create a task RelatedToFile “QuoteHed”
6) function CreateTask returns logical private ( input
pcRelatedToFile as character, input pcKey1 as character, input pcKey2 as character,input pcKey3
as character)
Generic function. You pass in the RelatedToFile and all Keys to
the table.
For this sample we will use the generic function createTask.
You have to run function 1) thru 6) once for each Task record you want to create.
**********************/

lSuccess = createTask(input “QuoteHed”:U, /*


RelatedToFile, string datatype */
input string(MfgSys.QuoteHed.QuoteNum), /*
Key1, string data type */
input “”:U, /*
Key2, string data type */
input “”:U /*

Key3, string data type */


).
if not lSuccess then do:
assign cErrorMessage = “Task could not be saved to the database
for Quote# “ + string(MfgSys.QuoteHed.QuoteNum).
/* This error message is logged in Appserver’s Server log file.
*/
message “Error executing createTask in BAM :” file-info:fullpathname
“Error: “ cErrorMessage.
return error cErrorMessage.
end. /* if not lSuccess */

/* NewTask is same as MfgSys.Task table. To write to table


MfgSys.Task please refer to it by name NewTask
All the assigns to Task table go here.
*/
assign NewTask.Company = MfgSys.QuoteHed.Company
NewTask.CreateDCDUserID = “” /* Valid Vantage UserID
e.g. Manager */
NewTask.ChangeDcdUserID = “” /* Valid Vantage UserID
e.g. Manager */
NewTask.TaskID = “L070” /* Character, Valid TaskID
defined in TaskMast table */
BUSINESS ACTIVITY MANAGER | CHAPTER 7
NewTask.TaskDescription = “Created from BAM-QuoteHed” /*
Will be defaulted from TaskMast */
NewTask.TaskComment = “Comments go here”
NewTask.TaskSeqNum = 0 /* Will be automatically
generated by SaveTasks */
NewTask.TaskQuoteNum = MfgSys.QuoteHed.QuoteNum /* Task

418 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

this Quote is related to */


NewTask.TaskCustNum = MfgSys.QuoteHed.CustNum
NewTask.TaskShipToNum = MfgSys.QuoteHed.ShipToNum
NewTask.TypeCode = “” /* Required */
NewTask.SalesRepCode = “” /* Required */
NewTask.Conclusion = “NEXT”:U
NewTask.Milestone = no
NewTask.Mandatory = no
NewTask.CurrentStage = “”:U
NewTask.StartDate = today
NewTask.DueDate = today
NewTask.CreateDate = today
.
/* Unless you run SaveTasks Task records will not be saved to the
database.
Save commits all the NewTask records to the MfgSys.Task table.
You have to run SaveTask once to commit multiple NewTask records.
*/
lSuccess = SaveTasks().
if not lSuccess then do:
assign cErrorMessage = “Task could not be saved to the database
for Quote# “ + string(MfgSys.QuoteHed.QuoteNum).
/* This error message is logged in Appserver’s Server log file. */
message “Error executing SaveTasks in BAM :” file-info:fullpathname
“Error: “ cErrorMessage.
return error cErrorMessage.
end. /* if not lSuccess */
end. /* if MfgSys.QuoteHed.Reference <> OldQuoteHed.Reference */

Generate .XML Files

The GlbAlert.i file contains the DumpRecordAsXMLFile function; this defines the function you use to generate .xml files from the
selected data. It pulls a new or updated record from a table into a separate .xml file. To call this function within the procedure
program, you need to define which ABL program runs when a specific table is updated.

The following code example shows you how to call the DumpRecordAsXMLFile from a .p program:

{ud/GlbAlert.i &TableName = “Orderrel”} /*** <==== Change the table


name here ****/

/*** If you pass blank as OutputXMLFileName then the system will


generate the file name.
But you can override it by writing your own logic.
***/
define variable OutputXMLFileName as character no-undo.
OutputXMLFileName = ‘c:\Temp\’ + string(orderrel.ordernum) + ‘-’ +
string(orderrel.orderline) + ‘-’ + string(orderrel.orderrelnum) +
‘.xml’ .
/*** <==== Override, change the OutputXMLFileName in the above line.
****/

if not DumpRecordAsXMLFile(input OutputXMLFileName) then


return error.

You can write similar code for the specific table referenced by the event. Be sure this ABL code is accessible at your system server. You
want the server to quickly access the directory location where the .xml files are created; you should point the server to dump the .xml
files directly onto the server drive.

CHAPTER 7 | BUSINESS ACTIVITY MANAGER

EPICOR SOFTWARE CORPORATION | 419


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Update Data

A procedure program also has the ability to change records within the database. Use this functionality to create a custom alert that
causes other uniform data changes to occur when the BAM event triggers.

Normally you can only update tables within the current transaction. If you need to update tables outside of the transaction, you either
need to purchase a provision for this additional functionality or create a special routine to handle this function. To review an example
of a special routine, read the Update Data Procedure – Other Tables Example section later in this chapter.

To update data, you first need to create an UpdateTableBuffer.p program. Here is an example:

define variable tblQuery as character no-undo.


define variable CurRowHandle as handle no-undo.
define variable ipFieldName as char no-undo.
define variable ipFieldValue as char no-undo.
define variable ipc-Table as char no-undo.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
/* define query */
assign tblQuery = “for each OrderHed where OrderHed.Company = ‘VN10T’
and OrderHed.OrderNum = 371”.
ipc-Table = “OrderHed”.

CREATE QUERY hQuery.


CREATE BUFFER hBuffer FOR TABLE ipc-Table NO-ERROR.

IF ERROR-STATUS:ERROR THEN return.

hQuery:SET-BUFFERS(hBuffer).
hQuery:QUERY-PREPARE(tblQuery) NO-ERROR.
IF ERROR-STATUS:ERROR then return.

hQuery:QUERY-OPEN().

do TRANSACTION on error undo, return :


hQuery:GET-FIRST().
ASSIGN CurRowHandle = hbuffer:handle.
end.

/* Set field name and value to update */


assign ipFieldName = “CheckBox06”
ipFieldValue = “yes”.

/* IMPORTANT: Directly updating the database through the use of this documented program
(updateBufferTable.p) may, if used improperly, cause data integrity and/or corruption issues.
Care must be taken by the user to ensure that all possible side-effects and consequences
are foreseen and handled properly. It is strongly urged that a test environment be used
to
initially test any use of this program (or any other method of directly changing the data by
bypassing the business logic) and EXTENSIVE testing is performed to fully satisfy the user that
no undesired side-effects result from this action PRIOR to attempting to do this in any sort of
live environment.

If in doubt, assistance may be obtained on a billable basis. Research, diagnosis, and/or repair
by Epicor of any data integrity issues that result from the user directly modifying the data in
the database by any method may not be covered by the support agreement and may be handled on a
billable basis. */

run C:\temp\UpdateTableBuffer.r(CurRowHandle, ipFieldName, ipFieldValue ).

This UpdateTableBuffer.p program can then be referenced by other procedure programs. The next code example,
SetTravelerReadyToPrint.p, causes all Engineered jobs to automatically select their Mass Print check boxes.
BUSINESS ACTIVITY MANAGER | CHAPTER 7

420 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

/* Copyright 2006 by Epicor Software Corp, Inc. All Rights Reserved. */


/*——————————————————————————————————
File: ud\test\SetTravelerReadyToPrint.p
Description: Set the Jobhead Mass Print flag when Engineered
Input Parameters: <none>
Output Parameters: <none>
Author: Product Marketing / Product Management
Created: 15 March 2006
Special Notes and Considerations:
This program was created as an example and intend to showcase the possibilities of the Business
Activity Manager. The content and formatting of this example is reasonably correct but any use
of this example a true business environment is at your own risk.
Remember this is an example and NOT standard code. Technical Support is not supporting this
example. Help can be available on a billable basis from the Custom Solutions Group.
Revision History:
————————-
03/15/06, RvL, First Draft
—————————————————————
————————————————————- */
{ud/GlbAlert.i &TableName = “JobHead”}
SendEmail = FALSE. /* Cancel Email */
/* Here we check if the Engineered flag is set */
IF OLDJobHead.JobEngineered <> JobHead.JobEngineered
AND JobHead.JobEngineered = TRUE THEN DO:
/* Set the Mass print flag to True when the Job is engineered */
RUN lib\UpdateTableBuffer.p(input BUFFER JobHead:HANDLE,
‘TravelerReadyToPrint’, TRUE).
END.

Update Data Procedure – Mass Print Example

In this example, you add a procedure program that causes all Engineered jobs to automatically select their Mass Print check boxes.
Here’s how you add this procedure program to a custom global alert:

1. Return to the Business 1


Activity Manager. 4

2. Click the Alert Program…


button. Use this search
program to navigate to the .p
program you created. In this
example, you select the
ReadytoPrint.p program.

3. After you find and select this


program, its menu path
displays within the Alert
Program field.

4. Click Save on the


Standard toolbar.

2 3

EPICOR SOFTWARE CORPORATION | 421


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

5. Now when this alert is sent, it


checks the job record that is
updated. If it finds that the
job has its Engineered check
box selected, it automatically
selects the Mass Print check
box on this record.

Update Data Procedure – Update Other Tables Example

Typically you can only write Progress code that updates tables within the current transaction. You can, however, create a routine that
updates data from one table and then populates this data change in another table.

For example, you can set up an UpdateTableBuffer.p program to update sales orders with data from the Configurator. During this
example, you enter an Input Quantity for the configured part which then automatically updates on a sales order created for the
configured part.

1. Within the 1
Configurator Designer,
display the configuration for a
selected part. In this example,
you display the
NewConfiguredPart
configuration.
2
2. For the Input Name, you
define the Quantity value.
3
3. Enter a Format that has zero
(0) decimal places.

422 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

4. Next add the On Leave


expression for Input Quantity.

Notice the parameters defined


within the expression. These
parameters are the current
row, the name of the sales
order field updated, and the
input value assigned
to this field.

5. These parameters are then


passed along to the 4
UpdateTableBuffer.p program.
This function is run through 5
the following command:

Run lib\UpdateTable
Buffer.p(input BUFFER
OrderDtl:HANDLE,
’OrderQty’,Quantity),

6. Within Sales Order 6


Entry, create a new sales
order for the configured part.

CHAPTER 7 | BUSINESS ACTIVITY


MANAGER
7. Return to the Configurator
Designer. Enter a Quantity
input value. In this example,
you enter 123.

EPICOR SOFTWARE CORPORATION | 423


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

8. The On Leave expression is


processed within the
Configurator Designer.
Because of the data change,
the alert’s .p program is also
run. When complete, the
Order Quantity field updates
with the new 123 value.

Alert Attachment Maintenance


Each standard or custom alert can also have a configuration (Alert.mfgsys) file attached to it. Users that receive these global alerts can
then use this attached configuration file to open the application directly to the record that caused the global alert.

You can set up client installations to do this in two ways. Right-click the mfgsys.exe file you want to use and select the Open With
(or Open) command. Within the Open With window, click the Browse button to find and select the mfgsys.exe file. Click OK to return
to the Open With window. Select the Always use the selected program to open this kind of file check box. Now the application always
launches using this configuration file.

If you do not want to permanently associate those files, however, you can For more information about runtime arguments
also do this by saving this configuration file within their client installation’s and configuration files, review the Startup
config folder (for example, C:\epicor\905\client\config). By using the CONFIG Configurations chapter within the Epicor ICE User
Run Time Argument for a desktop icon’s properties, the application then Experience and Customization Guide.
launches and automatically displays the program and the record that caused
the global alert.

All standard global alerts activated through Global Alerts Maintenance automatically have the Alert.mfgsys attachment. You can also
attach this file to a custom global alert by selecting its Include Link check box. For more information about these two global alert
types, read the previous Global Alert Maintenance and Custom Global Alerts sections in this chapter.

Use Alert Attachment Maintenance to define which tables can be launched through the Alert.mfgsys file. When data is entered
or changed within one of these tables, the Alert.mfgsys file is then set up to launch the program used to enter data into this table.

Main Menu Path: Executive Analysis > Business Activity Management > Setup > Alert Attachments
BUSINESS ACTIVITY MANAGER

424 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Alert Attachment Maintenance – How to Use

You first need to indicate which tables can be launched using the Alert.mfgsys file. Here’s how:

1. Click New on the


Standard toolbar. 1

2. Click the Table… button to


find and select the table you 8 7
want to add to the .mfgsys
file. In this example, you select 2
the JobHead table.
3
3. The rest of the fields now 4
display default information. If
you need, however, you can 5
change these values. The 6
Process ID field displays the
menu identifier for the
program that appears when
the application launches with
this Alerts.mfgsys
configuration file. If you need,
you can select a different
Process ID from the
drop-down list. In this All the menu identifiers available within the
example, SVG00012 application appear on this list. Be sure to select the
is selected. menu identifier that matches the data you want to
display. If you select a program that does not display
4. The Shortcut Table displays the specific table that appears when the the fields contained within the selected table, the
shortcut launches. Use this field to define what displays when a global alert attachment does not work.
alert triggers from the selected table. In this example, JobHeadList
is selected.

5. The DataSource Type field defines the type of data that displays through this configuration file. A type appears by default,
but if you need, you can change this value; for example, JobHeadListDataSet.

6. If the selected table is a child table, the Parent Table identifier displays as well. The parent table is required to display the data
through this configuration file. In this example, JobHead is a parent table, so this field is blank.

7. You can also modify the Alert.mfgsys file that is automatically sent. To
do this, click the Template tab. Use this sheet to modify the
The settings you can change through this file are
Alert.mfgsys file to match your system. You can change many settings in
documented in the Startup Configurations chapter
this file; modify it to fit the needs of your organization.
within the Epicor ICE User Experience and
Customization Guide. Read this chapter for an
8. When you finish modifying the Alert.mfgsys file, click Save on the
explanation of each setting – and the different
Standard toolbar.
values you can enter. You can also review the
Configuration Settings File topic within
Now when a standard global alert is sent that was triggered by the JobHead
application help.
table, this Alert.mfgsys file can be used as a shortcut to the record with the
new or updated data. Likewise, any custom global alert triggered by the
JobHead table that has its Include Link check box selected can also receive this
Alerts.mfgsys configuration file.

MANAGER | CHAPTER 7

EPICOR SOFTWARE CORPORATION | 425


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Update from the Previous Version


If you want to use a custom global alert created in a previous version of the application, you may need to redo the BAM event’s tables
so that it uses the current database schema. If the global alert log displays a “[Field Name] not valid” error message, you need to
update the BAM event.

To do this, launch the Data Dictionary Viewer. Use this program to find out For more information about this program, review the
where the information from the obsolete field is now currently stored. When Customization Utilities chapters within the Epicor ICE
you know what changes were made, launch the Business Activity Manager to User Experience and Customization Guide.
update the fields that are monitored by the event.

Auto-Printing
You can set up an event within Business Activity Manager to automatically preview or print out a report that displays the data which
triggered it. You can use this feature to auto-print standard reports, custom reports, and barcode labels.

This functionality requires you to first add a network printer to Windows and This section builds on the information described in
then create a printer record within the application. Once this is done, you can Chapter 3: Reporting Tools. Review this chapter to
set up the report, workstation, and/or company to automatically default to this learn about the overall reporting tools available
printer. After the default printer is set up, you next define the report you want within the Epicor application.
to auto-print. You can then select this report on a BAM action.

Windows Printer Setup


To begin, you first must add network printers to Windows. Your system administrator can help you connect to all the various printers
available on your network; you do this by modifying the printer’s Sharing properties. After you have set up the network printer on your
computer, verify it is connected by printing out a test document.

If you want to auto-print BarTender labels, the network printer must be accessible by the server where the BarTender is installed.

Printer Maintenance
You next create printer records within the application that identifies these printers. Use Printer Maintenance to define how the
application interacts with printers. You can create as many printer records as you need. For more information on entering printer
records, review Chapter 3: Reporting Tools.

Location Levels
The Auto-Print functionality searches for the added network printers through a location level hierarchy. If Auto-Print does not find
a printer at one level, it then moves on to the next level to locate the printer record. This hierarchy is:

1. The Auto-Print functionality first looks for a printer selected on a Report Rule defined for a Report Data Definition record.
The Auto-Print Rules section found later in this chapter describes how to set up a default printer for a report rule on the report
data definition.

2. If a printer is not defined on a report rule, it next looks for a printer selected on the current workstation. Later in this chapter,
the Work Station Maintenance section describes how to set up a default printer for this location.

3. If a printer is not defined on a workstation record, it next looks for a printer selected for the company currently logged on. Later
in this chapter, the Company Configuration – Forms and Label Printers section describes how to set up a default printer for
this location.

If the application cannot find the default printer at any of these levels, an error message displays within the System Monitor. This error
message displays on the History Tasks tab, indicating that a default printer was not found.

The next sections describe how you select the default printer for each of these location levels.

426 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Company Configuration – Forms and Label Printers

Once your network printers are defined for your application, you can indicate the default printer the company uses for printing Forms
and Labels. You do this through Company Configuration.

Main Menu Path: System Management > Company Maintenance > Company

Here’s how you define the default printers:

1. Navigate to the System >


General Settings sheet. 4

2. You select the default printers


within the Auto-Print Defaults 1
group box. Select the default
Forms Printer from the drop-down
list. This machine is the printer used for
report forms.

3. Now select the default Labels Printer


from the drop-down list. This machine
is the printer used for labels.

4. When you finish, click Save on the


Standard toolbar.

This company record is now set up with a


default printer. If a workstation does not
have a default printer selected, these default
company printers are used instead.
2
3

Work Station Maintenance

You can also define a default printer at the workstation level. When a user logs into this workstation, this default printer is
automatically used for auto-printing. You do this through Work Station Maintenance.

Main Menu Path: Material Management > Shipping / Receiving > Setup > Work Station

Here’s how you define a default printer for a workstation:

1. Click the Station ID button. Find


and select the workstation that
you want to update.
2
2. Click the Down Arrow next to
the New button; select New
Device.

EPICOR SOFTWARE CORPORATION | 427


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

3. The Devices sheet displays.

4. Select the device Type from


the drop-down list. To indicate
this device is a printer, select 9 3
the Printer option.
4
5. Enter a Description
for the printer. 5
6
6. Select the Default Device
check box. This indicates the
printer is the default for
this workstation.

You can add as many printers


to the workstation as you
need. Only one printer,
however, can be selected as
7
the default printer device.
8
7. Select a Printer ID from the
drop-down list. This list
displays all the printer records
you created through Printer Maintenance. For more information about this program, review the previous Printer
Maintenance section.

8. Now select a Printer Usage option. This defines how this default printer is
Do not select the Reports option; currently this
used. Select either Forms or Labels from the drop-down list.
workstation option is not supported by the
Auto-Print functionality.
9. Click Save on the Standard toolbar.

This workstation is now set up with a default printer. If a report does not have a rule that defines a network printer path, this default
workstation printer is used instead.

Auto-Print Rules
Use Report Data Maintenance to create and edit data definitions for both custom
Report data definitions set up the information
reports and existing reports. When you create a new report, you define its main
that displays on each report. Report styles define
attributes and then select the tables and fields that appear on the report. You
the modified reports available at each company.
also create report rules and conditions that define when this report auto-prints.
To learn more about report data definitions and
Use this functionality to limit the conditions through which this report definition
report styles, review the Report Data
is automatically sent to the printer.
Maintenance and Report Style Maintenance
sections within Chapter 3: Reporting Tools.
In this example, you set up auto-printing for the new version of the Job Traveler
report you created in Chapter 3: Reporting Tools. Because this is a Crystal report,
you must create rules and specify values for both the printer and report
templates (You follow similar steps to create auto-print rules for BarTender labels). These rules define when the custom Job Traveler
should automatically print. When a BAM event triggers an auto-print action, the process first checks the rules defined for the report
data definition to locate the printer used for the report.

You can have an unlimited number of rules for auto-printing each report. These rules can monitor nearly any condition within the
data. If you want a report to always print, you must create at least one rule that does not have any conditions. Even if the rest of the
auto-print functionality is set up correctly, a data definition that does not have any rules does not auto-print.

To do this, launch Report Data Definition Maintenance.

Main Menu Path: System Management > Company Maintenance > Report Data Definition

428 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Auto-Print Rules – Create Rules

Here is how you create rules for your Job Traveler data definition:

1. Click the Code…


button to find and
select your report data
definition. In this example,
you select the Traveler
report data definition. 2

2. Click the Down Arrow


1
next to the New button;
select New Report Rule.

3. Enter a Rule ID. This


defines the identifier for 9
the auto-print rule. In this
example, you enter Rule 1.

4. The Report field displays the 3


original report used on this
data definition. In this 4 5 8
example, JobTrav displays. 6
5. The Style field displays the 7
report style used for this rule.
Select the report style you
want. In this example, you
select the report style that you
created within Report Style
Maintenance – Job Traveler
Auto Print. To learn how to
create report styles, read
Chapter 3: Reporting Tools.

6. From the Auto Printer


drop-down list, select the printer that automatically prints this report.

You can leave this field blank. If you do, the automatic printing is run from the default printer defined at the Work Station level.
If a printer is not defined at this location level, however, the process uses the Auto Printer selected within Company
Configuration Maintenance. This functionality was described in the previous Work Station Maintenance and Company
Configuration – Forms and Label Printers sections.

7. If you want to see a preview of your Crystal Report, click the Print These options only apply to Crystal reports. For
Action drop-down list and select the AutoPreview option. This causes BarTender labels, the data file automatically outputs
the Crystal Reports preview to display before the report prints. You can
to the BarTender Commander™ for review. For more
also the select AutoPrint option; this causes the Crystal Report to be
information, review the Business Activity Manager -
immediately sent to the printer without a preview.
BarTender Setup topic within application help.

EPICOR SOFTWARE CORPORATION | 429


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

8. For the Print Quantity section, you can either define a Constant value, or a Dynamic value. To use a dynamic value, select the
By Field radio button. The drop-down lists activate; select a Table and its accompanying Field. This value determines how many
copies of the report auto-print, so only numeric fields can be selected from the Field drop-down list.

9. Click Save on the Standard toolbar.

This defines the data definition and report style you use with your Business Activity Manager (BAM) event.

Auto-Print Rules – Create Conditions

You can further indicate when the report auto-prints through the Condition List grid. Use this grid to create expressions, or conditions,
which must be met before the report automatically prints.

For this example, you only want this Job Traveler to print when a job’s Requested Due Date is equal to or greater than tomorrow
(the next day after the current date). Here’s what you do:

1. Click the Down Arrow next to the


New button; select New Rule
Condition.

2. A new row activates on the 1


Condition List grid. Notice that
these fields are similar to the fields
available on the Business Activity
Manager > Rules sheet. For a
complete description of each field,
read the previous Business Activity
Manager – Rules section. 2
3. You need to first define the Field
Name monitored by the rule condition.
For this example, you select the 3 4 5
ReqDueDate field.

4. Now select the Operator that 6


evaluates the condition. For this
example, you select greater than
or equal to (>=)

5. The condition evaluates a constant value (the current date plus one day). Because of this, you select the Constant check box.

6. Now click and drag the bottom scroll bar to view the rest of the row.

7
7. Select the From Today check box. This
indicates the condition is based on a
number of days either now or in the
future from the current date.

8. Enter how many Days From Today


you want before the condition activates
the rule. In this example, you enter 1.
This indicates if a job’s Requested
Due Date is equal to or greater than
the current date plus one day
(tomorrow), the traveler
automatically prints.

7 8

430 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

9. You now must validate that


this expression is set up 11
correctly. To do this, click
the Test button.
10
10. If the condition works, the
green Conditions Validated
icon displays.

11. To save your rule condition,


click Save on the 9
Standard toolbar.

Auto-Print Action
You have finished setting up the print options and you have defined the report definition and style you need for auto-printing.
You can now define the auto-print action. To do this, you return to the Business Activity Manager.

Auto-Print Action – What to Do

You use the Action sheet to activate auto-printing. Here’s how:

1. Verify the Requested Due


Date BAM displays within
the Business Activity
Manager > Event sheet.
1

EPICOR SOFTWARE CORPORATION | 431


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

2. Click the Detail >


Action sheet.

3. Select the Auto-Print


check box. 7 2 3

4. Notice this activates the


fields within the Auto-Print
group box.

5. From the Report ID drop-


down list, select Job Traveler.

6. From the Data Definition ID


drop-down list, select Traveler.

7. Click Save on the


Standard toolbar.

5
4

Test Auto-Print Action

You are now ready to test this auto-printing action. During this example, changing the Requested By Date on a job record to a future
date causes the Job Traveler to appear within the Print Preview window.

Here’s how you test this action:

1. Navigate to Job 1
Entry: Production
Management > Job
Management > General
Operations > Job Entry
2
2. Click the Job… button
to find and select an open job.
3
3. Clear the Engineered and
Released check boxes.
4
4. Change the Req By date
to a future date.

432 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

5. Select the Engineered and


Released check boxes again. 6

6. Click Save on the Standard toolbar.

7. You are asked if you want to


reschedule this job. Click Yes.
5

8. The Schedule Job 8


window displays.

9. Click Ok.

10. The application processes the 10


job change. This triggers the event,
and soon your modified Job Traveler
(Traveler) displays within the Print
Preview window.

If you set up this report data definition to


print, a hard copy would print instead.

EPICOR SOFTWARE CORPORATION | 433


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

Report Rule Evaluation


This section describes how the Auto Print functionality evaluates report rules. Report rules are created within Report Data
Maintenance; this functionality was described previously in this chapter.

All conditions that integrate a single report rule are evaluated in descending order based on the number of conditions contained
within a rule. When a rule evaluates to TRUE, any remaining rules that have the same number of conditions are evaluated. Any rules
that have less conditions are not evaluated.

For example, the following table displays a series of report rules displayed in descending order by their number of conditions. Notice
RuleB has four conditions. When this rule runs and evaluates as TRUE, only rules with four conditions are evaluated. Because of this,
RuleE is evaluated while RuleA and RuleC are not.

Rule ID Conditions Evaluation Tested?


RuleD 5 FALSE Yes
RuleB 4 TRUE Yes
RuleE 4 FALSE No
RuleA 2 TRUE No
RuleC 1 TRUE No

Also note that report rules evaluate differently between Crystal and BarTender reports. Because report rules can have conditions that
make up criteria, these conditions are then logically grouped together by table inside a rule. These reports behave differently, based on
the criteria results:

• Crystal Reports – A report rule evaluates to TRUE only if the criteria for all its tables evaluate to TRUE. In this case, the .xml data
populates the Crystal Reports template defined by the Report Style selected on the rule. The .xml file then contains all of the
data that is expected on the report.

• BarTender Reports – The data that populates the file is filtered by the criteria defined on the rule. In this case, the criteria filter
out data instead of determining whether the data should print. If no data populates into the file because the criteria completely
removes the data, the rule evaluates to FALSE. If any data displays, however, it evaluates to TRUE.

BAM Rules
The Business Activity Manager contains a Rules sheet you can use to restrict when an action triggers. You create conditions on this
sheet that must be met before a change log, global alert, or auto-print report is run.

To do this, you first indicate what action is linked to the specific rule. You can
If an action does not have any rules associated with
then assign rules to one, two, or all actions associated with the event. The
it, the action runs every time the event is triggered
actions you link to rules are only launched when the rule’s condition criteria
by a data change.
are met.

BAM Rules – What to Do

To create BAM rules, you return to the Business Activity Manager. For this example, you use the Requested Due Date BAM event
again. Three actions are launched when this event triggers.

To reduce how often these actions occur, you decide you need a BAM rule that causes these actions to run only when the selected
Requested Due Date is a future date. This value is identical to the rule condition you created previously for the Traveler report
definition. In this case, however, you apply this rule to all the actions set up on this BAM event.

434 | EPICOR SOFTWARE CORPORATION


BUSINESS ACTIVITY MANAGER | CHAPTER 10

Here is how you create this BAM rule:

1. Click the Down Arrow 1


next to the New button;
Select New BAM Rule.

2. The Detail > Rules


sheet displays. 2
9
3. Select the For Log check box.
This indicates that this rule
affects the Change Log action
on this event.

4. Select the For Alert check 3 4 5 6 7 8


box. This indicates that this
rule affects the Global Alert
action on this event.

5. Select the For Print check


box. This indicates that this rule affects the Auto-Print action on this event.

6. Define the Field Name (Evaluate) this rule uses for its condition. This defines the field evaluated by the rule. In this
example, you select the ReqDueDate field.

7. The Operator value defines how this condition evaluates. For this example, it compares the evaluated field to a constant Date,
so you select the >= (greater than or equal to) operator.

8. Select the Constant check box. This indicates the evaluated field is compared against a constant value or a date. It causes
either the Value field or the Date field to become available. In this example, a date field can only be compared to another date
field, so the Date field becomes active.

9. Notice the red Rules Not Validated icon displays. This indicates the rule needs to be tested to see if it can be run
successfully against the BAM event. You do this step when you finish creating the rule.

10. Now click and drag the


bottom scroll bar to view the
rest of the row.

11. Select the From Today check


box. This indicates that the 13 14
BAM rule is based on a
number of days either now
or in the future from the
current date.

12. Enter how many Days From


Today you want before the 11 12
rule activates. In this example,
you enter 1. This indicates 10
that if a job’s Requested Due
Date is equal to or greater
than the current date plus
one day (tomorrow), the selected actions on the BAM event activate.

13. You now must validate the rule. Click the Test button.

14. If the rule is valid, the green Rules Validated icon displays.

Now all the actions on this BAM event only launch when this rule is met. If a user changes the Requested Due Date on a job record
to a future date, all the actions defined through this event automatically run.

EPICOR SOFTWARE CORPORATION | 435


CHAPTER 10 | BUSINESS ACTIVITY MANAGER

436 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Chapter 11
Business Process
Management

The Business Process Management (BPM) module is a set of tools you use to modify and extend application functionality
without touching the source code. At the core of BPM is the directive. A directive is a set of conditions and actions that can
be applied to a transaction. Three types of directives are available:

• Method Directives - applied to business object methods.

• Data Directives - applied to database table transactions.

• Updatable BAQ Directives - applied to business activity query methods that can update the database.

Use the BPM tools to add or change application processes when a business object method executes, when a transaction is
applied to a table, or when information is retrieved or posted by a business activity query. You do this by creating directives
that first evaluate the data being processed and then, if the directives’ conditions are met, perform one or more actions
based on this data.

This chapter first explores the base elements of BPM and then explains how you set up the BPM module. The chapter next
describes all the tools in detail – including the conditions and actions available for directives. The chapter concludes with
a series of case studies you can use as a guide for your own BPM directives. Subsequent chapters explain custom BPM
processing and BPM utilities.

EPICOR SOFTWARE CORPORATION | 437


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

BPM Base Elements


Business Process Management uses the following base elements:

• Method Directives - Method directives initiate BPM actions based on specified application method calls within a business
object. A business object contains the code that runs a business process. BPM actions may be conditionally triggered before,
after, or, in place of a regular method that runs within a business object.

• Data Directives - Data directives initiate BPM actions based on updates to a specified table. A data directive can be run during
the data transaction, which can affect the information entered within the database, or it can be run after the data transaction is
placed within the table.

• Updatable BAQ Directives - Updatable BAQ directives initiate BPM actions based on method calls launched from an updatable
BAQ. An updatable BAQ is a customized query tool that displays on smart client dashboards and mobile device dashboards
through which users can update and add data; like a business object, BAQ methods are required so the database can be
updated. An updatable BAQ directive can be run before, after, or in place of the BAQ method call.

• Holds - Use BPM holds to define an external hold event linked to a business object which in turn may be set through a BPM
action. BPM directives may then be created on other business objects and methods to evaluate whether a hold exists and then
modify the business process as you need. BPM holds extend the regular status holds built into the application. You can then
define and evaluate your own hold conditions based on your business workflows.

• Data Form Designer - Use the BPM Data Form Designer to create forms launched by BPM method directives. BPM data forms
capture data or present button actions that you can use to control the BPM processing flow. This feature can be used to launch
a form - for example, only for a specific customer - to capture the specific data required for a transaction.

BPM Setup
This section explains what you need to install and set up so that you can run BPM.

BPM Server Installation


The BPM Server is an optional component used to support .NET Actions (C# or other coding) and advanced debugging and logging.
Though it is not necessary to install BPM Server to use the primary features of the BPM functionality, you need this component to
access the entire BPM toolset.

BPM Server is compatible with Windows Server 2008™ and Windows Server 2008 R2™.

Microsoft Message Queuing


The Microsoft Server machine must have Microsoft Message Queuing To learn how to install the BPM Server and Microsoft
(MSMQ) installed. It is required so that BPM messages can be queued and Message Queuing, review the Epicor Installation
then distributed to the application. Guide.

User Maintenance
Two levels of BPM functionality are available – a base level and an advanced level. All users who have menu access to BPM can use
the base level of BPM functionality to create holds and directives containing pre-built actions. Users with access to the advanced BPM
functions can create custom actions. These users can also create method directives that run in place of the base methods; however
users should work with Epicor or a partner organization before replacing a base method.

You give specific user rights to the advanced BPM features through User Maintenance. These rights are assigned on the Security sheet.

Main Menu Path: System Management > Company Maintenance > User

438 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

To give a specific user advanced BPM user rights:

1. Select a specific user


on the Detail sheet. 4

2. Click the Security tab.


1
3. In the Tools Options 2
section, select the BPM
Advanced User check box.

4. Click Save on
the Standard toolbar.
3
This user can now use the advanced
BPM functions.

Holds
A Hold is a flag you place on a record; it indicates the record should not be processed until it is reviewed and approved. A hold by
itself does not perform any actions. You define the actions by creating directives which define how the application handles a record
that has a hold placed on it. A hold can be attached to a record in two ways:

• Manually – You can manually attach a hold onto a field by using the BPM Holds program. You do this by launching the BPM
Holds program from the field’s context menu. This adds the hold to the record. To use this functionality, holds must be first
defined within Hold Type Maintenance; this program is explored in the next section.

• Programmatically – A hold can also be applied to a record using a directive action. This hold can then activate before, during,
or after the business process is run. Typically you use holds to interrupt the processing of the business object. This hold can then
cause custom actions you define for the directive to run. You use Method Directive Maintenance or Data Directive Maintenance
to create these directives. These programs are explained later in this chapter.

Hold Type Maintenance


Use Hold Type Maintenance to create, maintain, and delete hold types. Use this A hold type is basically a status you assign to a
program to define all the holds you may use within the application. After you record; it does not prevent a record from being
have set up the holds you need in this program, you can then activate them processed. For hold types to actually prevent
either through the BPM Holds program or through directive actions. specific records from being processed, you need to
create a method directive for it. The Case Studies
You can also use this program to review where the holds are currently used, as section at the end of this chapter explains how to
well as the history of each hold type. leverage this functionality.

Hold Type Maintenance – How to Use

Main Menu Path: System Management > Business Process Management > Setup > Hold Type

EPICOR SOFTWARE CORPORATION | 439


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

To create a new hold type:

1. Click the New button on


the Standard toolbar.
6
2. Enter the Hold Type for 1
the hold. This value is a 7 8
short name that, along with
the business object, identifies
the hold type. In this example, 2
Sales Order is entered as the
Hold Type name. 3

3. Click the Business object 4


button to find and select the
5
business object on which you
want to attach the hold. In
this example, you select the
SalesOrder business object.

4. Enter a Description for the


hold that further identifies its
purpose. An optional value,
use this field to add more
details to help identify
the hold.

5. The History Length field


defines how many records
appear on the Hold Usage
History sheet. When the records reach this number, the oldest records are automatically deleted.

6. Click Save. This hold type is now available for use.

7. The Hold Usage sheet displays where the current hold has been selected on specific records; use this sheet to manage
the records currently on hold. If you need, you can select an item on this grid and click the Delete button to remove a hold on
a record.

8. The Hold Usage History sheet displays a record for each time the selected hold was used – when it was attached to a record,
who attached the hold, when it was removed, and so on. If you need, you can select a record on this grid and click the Delete
button; this removes the history record. The maximum number of records that can appear on the Hold Usage History sheet is
defined by the hold type’s History Length value.

BPM Holds
Use the BPM Holds program to attach a hold directly to a record. You can also delete a previously attached hold.

440 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

BPM Holds – How to Use

To place a hold on a sales order:

1. Navigate to Sales Order 1


Entry. Main Menu Path:
Order Management > Sales
Management > General
Operations > Sales Order
Entry 2 3

2. Click the Sales Order button


to find and select an order.

3. Select BPM Holds.

Not all context menus


have a BPM Holds
option. The field must be
a primary value for a
business object. In this
example, the Sales Order
field is the main field used
by the SalesOrder business
object, so a hold can be
placed on this field.

4. The BPM Holds


program displays. In
13
the Tree View, select
the hold type you want 5
to use. In this example,
you select the Sales
Order hold. 4
6
5. Click New on
the Standard toolbar. 7

6. The hold is now created for 8


this record; several fields
automatically populate with
information. The Business
Object field displays the
name of the business object 9
used for this hold. In this
example, the SalesOrder 10
business object displays.
11
7. The Hold Type field displays 12
the hold that you created
in Hold Type Maintenance. In
this example, the Sales Order
hold record displays.

EPICOR SOFTWARE CORPORATION | 441


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

8. The Description field displays the optional explanation that may have been entered for the hold type.

9. The Creation date field displays the date on which this BPM hold was attached to the record.

10. The Creation time field displays the time on which this BPM hold was attached to the record.

11. The Created by field displays the identifier of the user who attached the hold.

12. Use the Comment field to enter any additional information you want about the hold. The only field within the BPM Holds
program you can edit, this field contains the reason you placed the hold on the record.

13. When you finish, click Save.

Review BPM Holds

You can review all the records for which this hold is assigned. Placing a hold
To use hold types to actually prevent specific records
on a record does not prevent the record from being processed. Instead, the
from being processed, you need to create a method
hold is really a note you add to the record. You can then track these selected
directive for it. The Case Studies section at the end
records within Hold Type Maintenance. You must then launch the record’s
of this chapter explains how to leverage
entry or maintenance program to make the changes you need.
this functionality.
To review your BPM holds:
1
1. Navigate to Hold
Type Maintenance. Main
Menu Path: System
Management > Business
Process Management > 2
Setup > Hold Type

3 4
2. Use the Detail sheet to find
and select a specific hold type.
In this example, you select
the Sales Order hold type.

3. Click the Hold


Usage tab.

4. The Hold Type Usage grid


displays all the records on
which this hold type is
currently selected.

Use this information to make any


changes that you need to the
selected records. However, you must
do this manually on each record
listed on this grid.

Directives
A directive defines a set of conditions and actions associated with a data transaction. Directives are triggered by a business object
method, a method used by an updatable BAQ, or by changes to data in a database table.

442 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Method Directives
All data transactions in the application are controlled by business objects. A business object represents a type of data managed by the
application, such as a customer, part, or a sales order. The objects contain methods that perform a specific task. For example, the
Customer.Update method validates and posts customer records to the database.

BPM tools can manipulate how these methods perform before, during, or after database transactions. You do this by creating method
directives that first evaluate the data being processed, and then, if the directives’ conditions are met, perform one or more actions
based on this data – like displaying messages, preventing data entry, launching other business processes, and so on.

BPM method directives work by intercepting communications between the Client or Web Services and the application server logic. You
can then validate, manipulate, or create workflows based on the data passed through the application. Because they are server side
customization, you can change business logic without modifying the source code. For this reason, most future upgrades to the source
code will not affect existing BPM directives.

When a business object method is called, all directives associated with the method activate. If the conditions within a directive are
met, the actions it contains are run.

While the method is active, these directives run at three different processing points:

• Pre-Processing – These directives execute before the base method runs. After these actions finish, the business object then runs
the base method.

• Base Processing – These directives run in place of the base method. The base method does not execute.

• Post-Processing – These directives run after the base method Only advanced BPM users can create base processing
finishes its process. directives, so your user account must be defined as
a BPM Advanced User. However, Epicor strongly
For example, you can create a method directive for the Customer.Update recommends you do not create base processing
method that sends an e-mail to a Sales Manager when a customer’s credit directives. If you change a base method incorrectly,
limit is changed. This same directive can also attach a hold to the customer you can harm the normal function of the
record and display a message indicating the customer record has been placed application. Work with a Epicor consultant before
on hold. Both of these actions are run during post-processing, after you create a base processing method directive.
the base method finishes its process.

This graphic shows how method directives work within the application.

1. A user performs an action


in a program. 1

2. The program calls a business 6


object method to carry
out the action.

3. Before the business object


executes its ABL program
2
code, a Pre-Processing
directive can run.
3 5
4. After the Pre-Processing
directive, the ABL program
code performs its function. If
a Base Processing directive is
in effect, the Base Processing 4
directive will run instead of
the ABL program code.

EPICOR SOFTWARE CORPORATION | 443


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

5. After the ABL Program code is run, a Post-Processing directive can run.

6. Data is returned to the program according to the actions run by the directives and ABL program.

You create method directives within Method Directives Maintenance.

Main Menu Path: System Management > Business Process Management > Setup > Method Directives

Data Directives
A data directive is similar to a method directive, but instead of launched by a business object method, a data directive is linked to
a database table and is triggered by a database event, such as add, delete, or update. By applying the directive to a specific table, data
directives are used to control data that may be affected by several business objects.

You can apply most of the conditions and actions for method directives to data directives as well, except in cases where the condition
or action depends on information available in the business object that is not available in the data itself. Two types of data directives are
available:

• In-Transaction - Affects data while it is saved to the database. This directive type can only process one row at a time; it cannot
process multiple dirty rows - rows that contain data not yet saved to the database. Multiple dirty rows are explained later in
this chapter.

• Standard - Does not affect data in the database. A Standard directive executes after a data transaction is saved to the database.
This directive type processes multiple dirty rows modified in the database. It runs after base methods and method directives.

You create data directives within Data Directives Maintenance.

Main Menu Path: System Management > Business Process Management > Setup > Data Directives

Updatable BAQ Method Directives


Updatable BAQ method directives are similar to the method directives described earlier, except they apply to methods used specifically
by updatable BAQs, custom queries you can create for data entry. Each updatable BAQ has the following methods:

• GetList – Retrieves the data specified by the query.

• GetNew – Creates an empty row where a new record can be entered and submitted to the database.

• RunCustomAction – Runs a custom BPM action you define through both the BAQ and BPM functionality. You first define the ID
of the custom action in the Business Activity Query Designer program and then define the action using one or more directives
within the Updatable BAQ Directives program.

• Update – Performs database updates, refreshing the data to include changed and added rows.

When you create an updatable BAQ, the application writes a base processing
The same security settings for method directives
directive for the update method. The directive uses ABL code to update the
apply to updatable BAQ directives. You must be
database according to the settings defined in the Business Activity Query Designer.
a BPM Advanced User to create or modify base
You can edit this code to customize the update process, or you can add
processing directives.
pre-processing, base processing, and post-processing directives to the methods
associated with the BAQ. For more information, review the Create an Updatable
Business Activity Query section within Chapter 4: Business Activity Queries.

You launch the Updatable BAQ Method Directives program in two ways - click the Define Custom Actions button on the Update >
General Properties sheet within the Business Activity Query Designer program, or select it from the Main Menu.

Main Menu Path: System Management > Business Process Management > Setup > Updatable BAQ Directives

444 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Custom Actions

You may create custom actions for updatable BAQs in the Business Activity Designer program by defining the action ID and label.
The custom actions can then be added to the Actions menu of a dashboard that uses the query.

In the Updatable BAQ Method Directives program, you create a pre-processing, base processing, or post-processing directive for
the RunCustomAction method. Use the “the specified argument is equal to the specified expression” condition statement to identify
which action to run. The first “specified” variable can be set to “actionID.” The second “specified” variable can be set to the ID of
the action called by the user as it was specified in the BAQ. Then create directive actions to perform custom operations. You will find
more information about conditions and actions later in this chapter.

Create a New Directive


This example shows how to create a method directive, but the process is the same for all directive types. For examples of how to
create each type of directive, see the Case Studies section later in this chapter.

Locate the Object of the Directive

Since directives are created for business object methods, tables, or updatable BAQ methods, the first step is to locate the object on
which the directive will act. To locate the object:

1. Navigate to the Method


1
Directives program.
Main Menu Path: System
Management > Business
Process Management >
Setup > Method Directives
2

2. Click the Method Code


button. To create a data
directive, click the Table
button or enter the
table name. To create an
updatable BAQ method
directive, click the BAQ ID
button or enter the BAQ ID.

EPICOR SOFTWARE CORPORATION | 445


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

3. The Method Search program displays.


Use this program to locate a specific
method within a business object. For
example, you want to create a method
directive for the CurrExRate.Update
method. To do this, in the Starting At 9
field, enter "U".
3
4. Select the Search by Business Object
option. This indicates that you want 4
the search to look specifically for 5
business objects.
6
5. Now select the Business Object for 7
which you want to search. In this
example, you select the CurrExRate 8
business object.

6. Notice you can also select Search


10
by Directives. This option is
used to find and select existing
method directives.

7. When you select the Search by


Directives option, the Directive Group
drop-down list becomes active. You can
assign directives to groups and
then search for a specific group 11
here. To learn how to assign
directives to groups, read the
Pre-Processing Directives section
later in this chapter.

8. You can also Search outdated Directives. Select the Search outdated Directives option to locate any method directives that
have become incompatible with the current application version. To learn more about this, review the Directive Compatibility
section later in this chapter.

9. Click Search.

10. The Search Results grid displays all the methods for the CurrExRate business object that start with “U”. In this example, you
highlight the Update option.

11. Click OK.

12. The Detail sheet now displays


the primary information on 18
the selected method.
12
13. The Method Code field displays the
business object method that you 13
selected. You add and edit directives to
14
this method. In this example,
you selected the 15 17
CurrExRate.Update method.
16
14. If you need, enter a
Method Description.

446 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

15. The Transaction Scope list defines how the application handles errors. Available options:

• Business Method and Directives – The application reverses, or rolls back, all changes made by actions run before the error
exception occurred.

• Business Method – The application does not roll back any changes made by the directive’s actions.

16. The Supports multiple dirty rows check box indicates whether the selected method sends multiple updated rows to the
database for processing. When a method can gather data from multiple rows at the same time before they are saved to the
database, the method is referred as being able to support multiple “dirty” rows. You then can perform additional actions against
the selected method. These additional actions are described in the Support for Multiple Dirty Rows section later in this chapter.

17. Click the Advanced button to create custom actions for this method
To use this functionality, your user account must be
directive; this launches the Method Advanced Options program. This
defined as a BPM Advanced User. Read the previous
program displays the signature for the current method, so you can
BPM Setup section to learn how to give users these
create the custom action. You can also create a .NET assembly, Epicor
advanced rights.
Service Connect Workflow, or a Progress procedure with this
functionality. To learn how to use these tools, read the Custom Actions
section later in this chapter.

18. When you finish defining the primary items on the method directive, click Save on the Standard toolbar.

Create the Directive

You are now ready to add directives to this object. You can create as many directives as you need for each method, table, or updatable
BAQ method.

This example shows you how to create a directive that runs before the CurrExRate.Update method processes; this type is called
a Pre-Processing Directive. To create the directive:

1. Click the Down Arrow


next to the New button; 14
select New Pre-
Processing. 1

2. The Pre-Processing > 2


Detail sheet becomes active.
3 9
3. Enter the Directive Name 4 7
10
you use to identify the
pre-processing directive. You 5 8
can enter a descriptive name 7 11
that has special characters
and spaces. 12

4. If you need, select the Group


inside which the current
directive belongs. You can 13
select an existing group or
enter a new group. An
optional value, groups help you organize directives for both search and
You can export directives for use on other systems.
export functionality.
You can do this only if the directives belong to a
group. To learn how to export directives, read the
5. The Order field indicates the sequence in which this method’s directives
Export Directives section in Chapter 13: Business
activate. The program automatically enters a value in this field in
Process Management Utilities.
increments of 10. Because of this, the first directive you add is 10, the
second 20, and so on. If you need, however, you can edit this value.

6. The Owner Company field displays the company for which this directive is created.

7. The Enabled check box indicates this directive is active and the application automatically compiles the code to run the directive.
You must select this check box to use the current directive.

EPICOR SOFTWARE CORPORATION | 447


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

8. The Company Independent check box indicates this directive is active for all companies within your application. However, if this
check box is clear, it only runs against records within the current company.

9. The Compatible check box indicates whether this directive works with the current version of the business method. If the
application validates the method and discovers this directive is no longer compatible with the business method, this check box is
clear. To learn more about how the application checks your method directives for compatibility, read the Directive Compatibility
section later in this chapter.

10. When you select the Prevent Endless Loops check box, you restrict how many concurrent directive instances run, protecting
the directives from getting caught in repeated, or endless, loops. Typically you select this check box.

11. The Reenter Max field activates if you select the Prevent Endless Loops check box. Use this field to define the maximum number
of loops the application runs before an exception error message displays.

For example, you could create a directive that calls an Epicor Service Connect workflow, which in turn, activates the directive.
This introduces an endless loop into the system. As these directives run, however, the application checks these loops against
the Reenter Max value. When the loops total this value, an exception error message displays and the directive stops.

12. Click the Conditions button to find and select a condition used for this method directive. This launches the Conditions window,
which you use to select the condition you use with the directive. When the parameters defined on the condition are matched, its
related actions run. To learn more about conditions, read the Conditions section later in this chapter.

13. Click the Actions button to find and select the actions that run when the condition activates. This launches the Actions window,
which you use to select the action or actions to run with the current condition. To learn more about actions, read the Actions
section later in this chapter.

14. When you finish creating your pre-processing directive, click Save on the Standard toolbar.

Conditions
Conditions are statements which define the specific parameters that must be met to activate a directive. If a data change matches
the condition statement, the actions linked to these conditions run. Each directive can have as many conditions as you need.

If you enter multiple conditions, you use a logical Operator (and, or) to define the relationship between the current statement and
the previous statement. You can also use parentheses to group condition statements logically.

The application evaluates the condition statements in the order they appear and according to how they are grouped. For this example,
you want the condition to activate when the user leaves the Phone Number field blank on a new customer record.

Main Menu Path: System Management > Business Process Management > Setup > Data Directives

To create and define condition statements:

1. After you create a new directive record,


click the Conditions button.

448 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

2. The Conditions 2
window displays. 3

3. Click the New button on the toolbar.

4. Select the User Text you want for


5 4
your condition statement. In this
example, the text “the specified field of
the changed row is equal to the
specified expression” is selected.

5. Notice some words in the user text are hyperlinks. You click these links to define the specific values used for the condition
statement. For this example, you click the first “specified” condition link.

6. Depending on the condition 6


link, a different window displays. In
this example, the Select Table Field(s)
7
window displays. You use this table to
define the specific field the condition
statement monitors.

All the condition values, like


Specified, Select a Row Set, Select
Group, and so on, are described in
the next section Conditions and
Actions – The Complete List. Each
condition also has its own topic
within application help.

7. Select the Table that contains the field


you need. For a method directive, all
the tables updated by the current 8
method appear on this list. For a data
directive, you can select only
the table associated with 9
the directive. In this example, you
select the ttCustomer table.

The “tt” prefix indicates this table is a temporary


table - an intermediate table used to validate data
before it is saved to your physical database. To learn
more about temporary tables, read the Conditions
and Actions – The Complete List section later in
this chapter.

8. The Fields grid displays the fields contained within this table. In this
example, you want the condition statement to monitor the PhoneNum
field; you select the check box next to this field.

9. Click OK.

10. You return to the Conditions window.


Notice the text for the specified field
has changed. It now displays the
specific field you selected. In this
example, this field is the
Customer.PhoneNum field.
10 11
11. Now click the last “specified” link.

EPICOR SOFTWARE CORPORATION | 449


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

12. The Specify an expression 12


window displays.

13. In the Editor field, enter an expression


that will evaluate the monitored data.
In this example, you want the condition
to activate when the user leaves the
Phone Number field blank. To do this,
you enter the two quotes (“”) to
indicate the condition activates when
a blank value is in this field.

The Specify an expression


window can be used to construct
a more complex expression that 13
includes data from the current
transaction combined with logical
operators and conversion functions.
You can validate the expression
using the Check Syntax button.

14. Click OK.

14

21 20
15. You return again to the Conditions
window. Notice the User Text now
displays: The
Customer.PhoneNum field of the
changed row is equal to the “”
expression. This means that when 16 17 18 15 22 19
users attempt to save a customer
record without entering a phone
number within this field, the
condition activates.

16. The other fields on this window can further help you manage condition statements. The Error Text field validates the statement.
If this field is blank, the statement is correct. Otherwise, a message displays in the field to indicate what is wrong with the
condition statement.

17. If you have two or more condition statements, use the Operator list to select the logical operator that is used between
the current statement and the previous statement. Available options:

• And – The conditions on both the current statement and the previous statement must be met before the directive activates.

• Or – The directive activates when a condition is met on either statement.

18. If you need to group together condition statements, use the Prefix field to enter the opening parentheses required for
your grouping.

450 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

19. The Postfix field is also used to define the parentheses pairings; this field
You can enter more than one parenthesis in the
defines the ending parentheses required for your condition statement
Prefix and Postfix fields. You can then create nested
grouping. To group two statements, enter an open parenthesis in the
condition statements.
Prefix field before the first statement, and a closing parenthesis in the
Postfix field.

20. To change the order in which your condition statements run, select the condition and click the Up button or the Down button.
The top condition statement runs first, followed by the second, and so on.

21. If you want to remove a condition statement, highlight it on the list and click the Delete button.

22. Click the Advanced button to view the source code for the BPM Progress procedure; this item is the code that runs the current
condition statement. If you have BPM Advanced User rights, you can use this function to manually extend or even replace
this code.

23. The Source Code 23


window displays.

24. Edit the condition code as you need


within the Code field.

25. When you finish, click OK.

24

25

26. You return to the Conditions window.


When you finish defining your
condition statements, click OK.

26

27. When you return to the Data


Directives window, the condition
statement displays within
the Conditions field.

27

EPICOR SOFTWARE CORPORATION | 451


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Actions
Actions are operations run by the directive when its condition statements are met by a change within your data. You create and define
action statements in a similar way as condition statements - you select and define the User Text that runs when the action executes.

For this example, you want the action to display an error message when the user leaves the Phone Number field blank on a customer
record. To create and define actions:

1. Click the Actions button.

2. The Actions 2
window displays. 3

3. Click the New button


on the toolbar.

4. Select the User Text that you 5 4


want for your action
statement. In this example,
you select the “raise
exception based on the
designed template” action. All the action link values are described in the next
section Conditions and Actions – The Complete List.
Each action also has its own topic within
application help.

5. Notice some words in the user text are hyperlinks. You click these
links to define the specific values that are used for the action statement.
For this example, you click the “designed” action link.

452 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

6. The Design Exception 6


Template window displays. 7

7. Enter a Name for the template.


In this example, you enter
RequiredPhoneNum.

8. Now enter the Text that displays when


this action executes. For this
example, you enter “Before this
customer record can be saved, you
must enter a phone number”.
8
9. Click OK.

14 12
10. You return to the Actions window.
Notice the User Text displays: raise
exception based on the
RequiredPhoneNum template.
This means when the directive's
condition statement activates, this
11 10 13 15
action displays the error message
you entered within the
RequiredPhoneNum template.

11. The other fields on this window can further help you manage your actions. The Error Text field validates the statement. If this
field is blank, the statement is correct. Otherwise, a message displays in the field to indicate what is wrong with the action.

12. To change the order in which your actions are run, select an action and click the Up button or the Down button. The top action
in the list is run first, followed by the second, and so on.

13. The Terminate On Error field indicates whether the method directive quits if the action statement results in an error.
The method stops processing. To activate this function, click this field and select the (exit on error) option.

14. If you want to remove an action, highlight it on the list and click the Delete button.

15. Click the Advanced button to view the source code for the BPM Progress procedure; this item is the procedure that runs the
selected action statement. If you have BPM Advanced User rights, you can use this feature to manually edit the code.

EPICOR SOFTWARE CORPORATION | 453


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

16. The Source Code 16


window displays.

17. Edit the action code as you need within


the Code field.

18. When you finish, click OK.

17

18

19. You return to the Actions window.


When you finish defining your actions,
click OK.

19

20. You return to the Data Directives


window. Your new action displays
within the Actions field.

20

454 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Conditions and Actions – The Complete List


This section explores all the pre-built conditions and actions available within the BPM functionality. Use this section to create
the directives you need.

As you create BPM conditions and actions, you will notice that most tables begin with a “tt” prefix in their names. The “tt” prefix is
an abbreviation for Temporary Tables; this value is used within ABL code. When you see a “tt” table name, you are working with
temporary tables that relate to the .NET dataset being passed between the server and the client - instead of the same physical table
within the database.

When you modify a column in a “tt” table through a pre-process or in-transaction directive, you modify the data before it is
committed to the database tables.

When you modify a column in a “tt” table through a post-process or standard data directive, you modify the data returned from the
server to the client. You must be careful that integrity is maintained between the database tables and client dataset. Changing data
only in the client dataset that is subsequently written back to the database can cause a ‘Record has been modified by Another User’
error. This happens because the original client dataset record may not match the database tables.

Conditions

This section contains the list of pre-built condition statements you can select. Note that some condition statements are available only
for certain types of directives. For example, the condition statement “the Specified field has been changed from Any to Any” is not
available for a post-process method directive because BPM needs both the original record and the changed record to be available
before this comparison can execute. Available condition statements:

• The specified argument is equal to the specified expression - Use this condition to evaluate a BPM parameter, temp-table,
or call content. For an updatable BAQ method directive, the condition can test which BAQ custom action is being run so that
BPM directive actions can execute.

Directive Types
Method Data Updatable BAQ
None None All

Variables
Click this link to launch the Select an Argument program. Use this program to choose
specified (argument) which parameter you would like to evaluate against the other variables in the
condition statement.
Click this link to launch the Select a Comparison program. Use this program to select a
is equal to comparison option that evaluates the value of the selected argument against the expression.
If this comparison evaluates to TRUE, the directive’s actions are run.
Click this link to launch the Specify an Expression program. Use this program to compose
an expression that evaluates against the comparison. The expression can contain literal
values, data from the current transaction, and functions that can perform calculations and
specified (expression)
data type conversions. If you are evaluating whether a certain BAQ custom action was run,
enter the action ID in double quotes. Click the Check Syntax button to verify the syntax of
your expression.

EPICOR SOFTWARE CORPORATION | 455


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Number of rows in the designed query is not less than 1 - Use this
The query statement must be a complete string, so
condition to create a query that activates when the data meets a specific
do not add any hard or soft returns between the
comparison (is more than, not less than, and so on) option. If this
various parts of the phrase. Also, do not place a
comparison evaluates to TRUE, the directive’s actions are run.
period at the end of the statement.
Directive Types
Method Data Updatable BAQ
All All All

Variables
Click this link to launch the Compose Query program. Use this program to write an ABL and
Business Activity Query (BAQ) compliant query. This query evaluates the number of rows returned
designed by the query against the comparison value you select later in this statement. In addition to
standard tables, the query phrases can run against temporary tables (tt tables) to analyze values
passed between datasets.
Click this link to launch the Select a Comparison program. Use this program to select a
is not less than comparison option used against the number of rows returned by the selected query. If this
comparison evaluates to TRUE, the directive’s actions are run.
Click this link to launch the Specify a Value program. Use this program to enter a numeric value
1
that evaluates against the number of rows returned by the query.

• The specified field has been changed from any to any - Use this
All tables contain a column called RowMod at the
condition to monitor a specific field contained within the current
bottom of the record. The application sets the
transaction. If the field’s value changes to another value that you define,
RowMod value to Add (A), Update (U), or Delete (D)
the condition activates the directive’s actions.
to define the action performed against the row.
Typically the RowMod value is set for Update (U)
For this condition statement, you specify two field values. The first field
methods. If you see a Changed reference, this refers
value is compared against the second field value. If the comparison
to a RowMod value set to either A or U. Some
returns TRUE, the application executes the directive’s actions.
methods do not set a RowMod value, so conditions
that require the RowMod contain a value that
cannot be used. For some conditions, however, the
designator Some or All rows is allowed so you can
possibly leave the RowMod value empty.

Directive Types
Method Data Updatable BAQ
Pre-Processing Pre-Processing
All
Base Processing Base Processing

Variables

Click this link to launch the Select Table Field(s) program. Use this program to specify a field that
is part of the BPM condition statement. You can choose a standard or user-defined field from any
specified
temporary table (tt table) included in the current method parameters. The application compares
the field value to a value (any to any) you specify.
Click this link to launch the Specify a Value program. Use this program to enter a value that
any
is evaluated.
Click this link to launch the Specify a Value program. Use this program to enter a value that
any
is evaluated.

456 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• The method is called by specified user - Use this condition to determine whether a specific user did or did not launch the
current transaction. Depending on what you define for this condition (Yes or No), the directive’s actions are run. This condition
statement can be useful for testing directives so that they are activated only by a specific user account.

Directive Types
Method Data Updatable BAQ
All All All

Variables
Click this link to launch the Select Option program. This program displays the is called or is not
is called called options. Select the option you need; these options determine whether the user did or did not
initiate the data transaction.
Click this link to launch the Select User program. All the user records in the current database
specified user
display. Use this program to select a user that is used for this condition statement.

• The user called the method belongs to specified group - Use this condition to determine if the current user is or is not a
member of a specific security group. The application compares the user who initiated the transaction with the security group you
specify in the condition. The directive’s actions run depending on how you set up this condition (Yes or No).

Directive Types

Method Data Updatable BAQ


All All All

Variables

Click this link to launch the Select Option program. This program displays the belongs or does
belongs not belong options. Select the option you need; these options determine whether the user is or is
not a member of the security group you specify later in this condition statement.
Click this link to launch the Select Group program. Use this program to specify a security group
specified group
evaluated against the selected user.

• The hold of the specified type is attached to the business object - Use this condition to indicate the system should verify
whether a hold type is attached to the current or related business object. If the hold type is present on the selected business
object when the method runs, the application executes the directive’s actions.

Directive Types

Method Data Updatable BAQ


All None None

Variables

specified type is Click this link to launch the Select Business Object program. You can browse all the business
attached to the objects related to the current method using a Tree View. This interface displays all the objects that
business object link to, or are linked from, the current object.

You also specify the hold type this condition needs to verify with this business object. Hold Types must be created specifically for
the selected business object before you can select one through this program. For more information, read the Hold Types section
earlier in this chapter.

EPICOR SOFTWARE CORPORATION | 457


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Time is in the specified time frame - Use this condition to indicate a specific time frame is monitored by this condition.
If the data transaction is executed during this time frame, the application executes the directive’s actions.

Directive Types
Method Data Updatable BAQ
All All All

Variables

Click this link to launch the Specify a Time Frame program. Use this program to define
a time frame that is part of this condition statement. You can specify these time
frame options:

specified • A start and end date

• An occurrence interval

• A range of hours during the day

• The specified field of the changed row is equal to the specified expression - This condition statement monitors a specific
field within the data transaction. BPM then compares this field value to the comparison option and a final value that you specify.
If the comparison returns TRUE, the application executes the directive’s actions.

Directive Types

Method Data Updatable BAQ


Pre-Processing Pre-Processing
All
Base Processing Base Processing

Variables

Click this link to launch the Select Table program. Use this program to specify a standard or
user-defined field that is part of the statement. For method directives, you can then select a
specified (field) field from any temporary table (tt table) included in the current method’s parameters. For
data directives, you can select a standard or user-defined field from the temporary table
associated with the directive.

Click this link to launch the Select a Row Set program. Use this program to specify which
the changed row row set is affected when this rule activates - like the added row, the deleted row, the
updated row, and so on.

Click this link to launch the Select a Comparison program. Use this program to select a
is equal to comparison option used to compare the selected field against the value defined later in this
condition statement.

Click this link to launch the Specify an Expression program. Use this program to compose
an expression that evaluates against the comparison. The expression can contain literal
specified (expression)
values, data from the current transaction, and functions that can perform calculations and
data type conversions. Click the Check Syntax button to verify the syntax of your expression.

458 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• There is at least one updated row in the specified table - This condition compares the value of a field included in the row
set to a table you specify. If the comparison returns TRUE, the application executes the directive’s actions.

Directive Types
Method Data Updatable BAQ
Pre-Processing Pre-Processing
All
Base Processing Base Processing

Variables
Click this link to launch the Select a Row Set program. Use this program to specify which row
updated set is affected when this rule activates - like the added row, the deleted row, the updated row,
and so on.
Click this link to launch the Select Table program. Use this program to specify a table you will
specified monitor through this condition statement. Use this program to choose any table linked to the
current data transaction.

• Value of the specific field of the designed query changed from any to another - Use this condition to query a specific
field that is outside of the current transaction. If the field’s value changes to another value that you define, the condition
activates the directive’s actions.

Directive Types
Method Data Updatable BAQ
None All None

Variables

Click this link to launch the Select Table program. Use this program to specify a standard or user-
specific
defined field that is part of the statement.
Click this link to launch the Compose Query program. Use this program to write an ABL and
Business Activity Query (BAQ) compliant query used as part of a BPM condition statement or
designed
action. In addition to standard tables, the query phrases can be run against temporary tables to
analyze values passed between datasets.
Click these links to launch the Specify a Value program. Use this program to enter values to
evaluate. For this condition statement, you specify two field values. The first field value is
any and another
compared against the second field value. If the comparison returns TRUE, the application executes
the directive’s actions.

EPICOR SOFTWARE CORPORATION | 459


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• The specified call context field is equal to the specified expression - Use this condition to monitor the value of a context
variable in the current data transaction, such as the CurrentCompany or CurrentUserId. The application compares this argument
against an expression that you specify. If the comparison returns TRUE, the application executes the directive’s actions.

Directive Types
Method Data Updatable BAQ
All All All

Variables
Click this link to launch the Select Table Field(s) program. Use this program to specify a call
context field from one of two available Call Context tables. These tables are available for each
specified call context business method, and you leverage them for custom data storage on both the client and server.
The application compares the field value to a value that you specify. For more information, review
the Call Context topics within application help.
Click this link to launch the Select a Comparison program. Use this program to select a
is equal to comparison option that is used against the number of rows returned by the selected query. If this
comparison evaluates to TRUE, the directive’s actions are run.
Click this link to launch the Specify an Expression program. Use this program to compose
an expression that evaluates against the comparison. The expression can contain literal values,
specified
data from the current transaction, and functions that can perform calculations and data type
conversions. Click the Check Syntax button to verify the syntax of your expression.

• Method changed the specific field of the designed query from any to another value - When this condition is used,
the application verifies whether the field in the query result set has been changed from one value to another value. If the
condition statement evaluates to TRUE, the application executes the directive’s actions.

Directive Types
Method Data Updatable BAQ
Post-Processing None None

Variables
Click this link to launch the Select Table program. Use this program to specify a standard or user-
specific defined field that is part of the condition statement. Use this program to choose a field from any
temporary table (tt table) included in the current method’s parameters.
Click this link to launch the Compose Query program. Use this program to write an ABL and
Business Activity Query (BAQ) compliant query run with this condition statement. In addition to
designed
standard tables, the query phrases can run against temporary tables (tt tables) to analyze values
passed between datasets.
Click these links to launch the Specify a Value program. Use this program to enter values to
evaluate. For this condition statement, you specify two field values. The first field value is
any and another
compared against the second field value. If the comparison returns TRUE, the application executes
the directive’s actions.

460 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• This directive has been enabled from the specified directive - Use this condition to select a pre-processing or
base processing directive that must execute successfully for the current post-processing directive to run.

Directive Types
Method Data Updatable BAQ
Post-Processing None Post-Processing

Variables

Click this link to launch the Select a Primary Directive to Depend Upon program. Use this
specified program to select a pre-processing directive or a post-processing directive that is used for
this condition.

• The specified public data tag exists on the changed row of the specified table - Use this condition to identify when a
data tag has been placed on a record. You can apply data tags to records throughout the application. A common use of data
tags may be to group related records for searches or so that BPM directives can run when the records are modified. Review
the Searches chapter for more information about data tags.

Directive Types

Method Data Updatable BAQ


All All None

Variables

Click this link to launch the Specify a Value program. Use this program to enter a free-form text
The specified (data tag)
value that matches the data tag for which you want to run the directive.

Click this link to toggle between three values: public, current user and public or current user.
Select public to limit the directive to records that have a public data tag of the specified name.
Select current user to limit the directive to records where the user trying to modify the record has
public
added a private data tag. Use the public or current user option if you want a directive to run for
a given data tag regardless of whether it is public or private, instead of limiting the directive to
one or the other.

Click this link to toggle between two values: exists and doesn’t exist. Select exists to limit
exists the directive to records that have the specified data tag. Select doesn’t exist to limit the directive
to records that do not have the specified data tag.

Click this link to launch the Select a Row Set program. Use this program to specify which row
the changed row set is affected when the rule activates - like the added row, the deleted row, the updated row,
and so on.

Click this link to launch the Select Table program. Use this program to specify a table that is part
of the condition statement. For a method directive, use this program to choose a standard or user-
specified (table) defined field from any temporary table (tt table) included in the current method’s parameters. For
a data directive, be sure you select the current table; this table contains the data you want to
monitor.

EPICOR SOFTWARE CORPORATION | 461


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Actions

This section contains the list of pre-built actions; you can use these actions by themselves or together to create complex action
statements that cause specific things to occur within the application. Available actions:

• Send email asynchronously based on the designed template with rule - Use this action to automatically send an email you
create to selected recipients.

Directive Types
Method Data Updatable BAQ
All Standard All

Variables

Click this link to set this variable to send an email either synchronously or asynchronously. This
indicates how the application handles email generated by this action. Available options:

• Synchronously - The email is sent when the action executes.


asynchronously
• Asynchronously - The email is queued and executed according to the schedule defined
through the BPM Action Process program. To learn about this program, read the BPM
Action Process section later in this chapter.
Click this link to launch the Design Email Template program. Use this program to build an email
message that generates when BPM executes this action.

designed You can also insert field and table variables into these email messages. You do this by designing
a Simple Query that pulls in these values from fields. You use the Design Simple Query program
to leverage this functionality. Launch this program by right-clicking the Text field and selecting
either the Field Query or the Table Query options.
Click this link to launch the Execution Rule program. If the data transaction supports multiple
dirty rows (rows that contain unsaved data), you can use this program to select how the action
with rule performs. Read the Support for Multiple Dirty Rows section in this chapter for details about each
option in this program. This variable is not visible if the method data transaction does not support
multiple dirty row updates.

462 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• Call the specified Epicor Service Connect Workflow asynchronously with rule - Use this action to send a call to Epicor
Service Connect. The information in this call is then distributed through a Service Connect workflow that you select.

Directive Types
Method Data Updatable BAQ
All Standard All

Variables

Click this link to launch the Logon to Service Connect program. Use this program to enter the login
credentials for the server where Epicor Service Connect is installed.

After you successfully enter the login credentials, the Select Workflow program displays. Use this
program to select an Epicor Service Connect workflow used for this action.
specified
While you are in the Select Workflow program, you can click the Advanced button to launch the
Workflow Context Parameters program. Use this program to specify a server, user account, and
password required to run the current Epicor Service Connect workflow.

To learn more about Epicor Service Connect, review the Epicor Service Connect documentation and
the Epicor Service Connect User Guide.
Click this link to toggle between asynchronous and synchronous execution.

• Synchronously - The call is made immediately when the action executes.


asynchronously
• Asynchronously - The call is queued and executed according to the schedule defined in the BPM
Action Process program. To learn about this program, read the BPM Action Process section later in
this chapter.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

EPICOR SOFTWARE CORPORATION | 463


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Create specific task with rule - Use this action to automatically generate a task for selected users.

Directive Types

Method Data Updatable BAQ


All Standard All

Variables

Click this link to launch the Create Task Template program. Use this program to define a task that is created
when the application executes this action.

You can also insert arguments into the current task template. The application sets the value of the task template
to a value supplied by the business object method or table linked to the directive. To use this functionality, click
the Comments tab within the Create Task Template program. Then right-click within the Comments field and
highlight the Parameters sub-menu. Select the argument you need. The argument type must be appropriate for
specific
the field where the argument is used; if it is not, the application generates an error.

You can also insert variables into a task template. You do this by designing a Simple Query that pulls in these
values from a field you define. You use the Design Simple Query program to leverage this functionality. Launch
this program by first clicking the Comments tab within the Create Task Template program. Then right-click within
the Comments field and select the Field Query option. For more information about tasks, see the Task
Maintenance and Task List topics within application help.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows (rows
that contain unsaved data), you can use this program to select how the action performs. Read the Support for
with rule
Multiple Dirty Rows section in this chapter for details about each option in this program. This variable is not
visible if the method data transaction does not support multiple dirty row updates.

464 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• Synchronously invoke .NET method don’t queue record nothing with rule - Use this action to cause a selected .NET
method to run.

Directive Types

Method Data Updatable BAQ


All Standard All

Variables

Click this link to toggle between asynchronous and synchronous execution.

• Synchronously - The call is made immediately when the action executes.


Synchronously
• Asynchronously - The call is queued and executed according to the schedule defined in the BPM
Action Process program. To learn about this program, read the BPM Action Process section later in
this chapter.
Click this link to launch the .NET Action Proxy Builder program. Use this program to attach a call to
a .NET method and then specify how it will run. The .NET method is a programming action that extends
the functionality of your application.
method
You can also select a .NET method used with the current action; these methods extend the functionality of
the application. To use this tool, click the Browse button in the .NET Action Proxy Builder program. The
Select a .NET Method program displays. Use this program to find and select a .NET method that is
deployed to the BPMServer. The method launches when the current action is run.
For asynchronous actions, you can set where the action will queue. Read the Asynchronous Action
Overview topic in application help for a detailed explanation about where to queue BPM actions based on
your application setup. Click this link to toggle between the following:

• Don’t queue – Automatically set when the action is called synchronously.


don’t queue
• Queue at BPM server – Available for asynchronous execution.

• Queue at Progress – Available for asynchronous execution.

• Queue at both BPM server and Progress – Available for asynchronous execution.
Indicates whether to record the action call to the custom code. See the Recording and Playing Calls topic in
application help for information about how to play back the recorded call. Click this link to toggle between
the following:

• Record nothing – Does not record the action call.


record nothing
• Record call – Record only the action call.

• Record return – Record only the action return.

• Record call, return – Record both the call and return.


Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

EPICOR SOFTWARE CORPORATION | 465


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Synchronously execute ABL code… record nothing with rule - Use this action to attach an ABL procedure (.p or .r) program
to the method. When this action executes, the procedure program is run.

Directive Types
Method Data Updatable BAQ
All All All

Variables

Click this link to toggle between asynchronous and synchronous execution.

• Synchronously - The call is made immediately when the action executes.


Synchronously
• Asynchronously - The call is queued and executed according to the schedule defined in the BPM
Action Process program. To learn about this program, read the BPM Action Process section later in
this chapter.
Click this link to launch the ABL Action program. Use this program to attach an ABL procedure to a
code… method directive. You can attach the procedure in two ways: write the procedure code into the program
or forward a call to a procedure file that has been deployed to the application server.
Indicates whether to record the action call to the custom code. See the Recording and Playing Calls topic in
application help for information about how to play back the recorded call. Click this link to toggle between
the following:

• Record nothing – Does not record the action call.


record nothing
• Record call – Record only the action call.

• Record return – Record only the action return.

• Record call, return – Record both the call and return.


Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
with rule
variable is not visible if the method data transaction does not support multiple dirty row updates.

This variable is not available for in-transaction data directives.

• Show informational message based on the designed template with rule - Use this action to display an informational
message that you create. After users read the message and click OK, the method continues processing. BPM informational
messages are transmitted to alternate clients - Epicor Mobile Access, Epicor Web Access, Web Services and Service Connect.

Directive Types

Method Data Updatable BAQ


Pre-Processing Pre-Processing
None
Post-Processing Post-Processing

Variables
Click this link to launch the Design Informational Message Template program. Use this program to
enter a message that contains information you want users to see. Based on the condition(s) you define for
designed the current directive, the information message displays. You can select one of the following Severity
modes when setting up an informational message: Information, Warning, Error and Update Conflict. You
can also select if the BPM message displays as an individual message or as a grid item.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

466 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• Raise exception based on the designed template with rule - Use this action to display an exception message when this
directive’s condition(s) is met. When this action activates, it stops all processing until the user reviews and clicks OK on the
exception message window. BPM exception messages are transmitted to alternate clients - Epicor Mobile Access, Epicor
Web Access, Web Services and Service Connect.

Directive Types

Method Data Updatable BAQ


Pre-Processing Pre-Processing
In-Transaction
Post-Processing Post-Processing

Variables

Click this link to launch the Design Exception Template program. Use this program to build an exception
message generated when the application executes the directive action.

Within the message, you can include values queried from related tables and fields. You do this by
designed
designing a Simple Query that pulls in these values from fields. You use the Design Simple Query
program to define these variables; launch this program by right-clicking in the Text field and selecting either
the Field Query or the Table Query option from the context menu. You can select one of the following
Severity modes when setting up a message: Information, Warning, Error and Update Conflict.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

• Attach hold of the specified type with rule - Use this action to place a BPM hold on a specific record.

Directive Types

Method Data Updatable BAQ


All Standard None

Variables

Click this link to launch the Hold Attachment program. Use this program to specify which hold should be
attached to a record when the application executes this action. You can select from any of the hold types
defined for the business object. You can also add an optional comment.

specified After a hold has been placed on a record, any subsequent directives can check for the presence of this hold
and perform various actions when a user attempts to execute a method that affects the record.

Hold types are created and maintained in Hold Type Maintenance. To learn about this program, read
the previous Hold Type Maintenance section.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

EPICOR SOFTWARE CORPORATION | 467


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Remove holds of the specified type with rule - Use this action to remove a hold from a specific record.

Directive Types
Method Data Updatable BAQ
All Standard None

Variables

Click this link to launch the Hold Removal program. Use this program to specify a hold type that is
removed from a record when the application launches this action.
specified
You can select from any of the hold types defined for the business object. Hold types are created and
maintained in Hold Type Maintenance. To learn about this program, read the previous Hold Type
Maintenance section.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

• Set the specified field of the changed row to the specific expression with rule - Use this action to change a selected field
to a different value, using a row set action that you define.

Directive Types

Method Data Updatable BAQ


All None All

Variables

Click this link to launch the Select Table Field(s) program. Use this program to specify a standard or user-
specified defined field that is changed through this action. Use this program to select a field from any temporary
table (tt table) included in the current method’s parameters.
the changed Click this link to launch the Select a Row Set program. Use this program to specify which row set is
row affected when this rule activates – like the added row, the deleted row, the updated row, and so on.
Click this link to launch the Specify an Expression program. Use this program to compose an expression
that is evaluated against the comparison. The expression can contain literal values, data from the current
specific
transaction, and functions that can perform calculations and data type conversions. Click the Check
Syntax button to verify the syntax of your expression.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows
(rows that contain unsaved data), you can use this program to select how the action performs. Read the
with rule
Support for Multiple Dirty Rows section in this chapter for details about each option in this program. This
variable is not visible if the method data transaction does not support multiple dirty row updates.

468 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• Set the specified field of all rows identified by the designed query to the specific expression with rule - Run this
action to use a query to change the value of a selected field.

Directive Types
Method Data Updatable BAQ
All In-Transaction All

Variables

Click this link to launch the Select Table Field(s) program. Use this program to specify a standard or user-defined
specified field that is changed through this action. Use this program to choose a field from any temporarytable (tt table)
included in the current method’s parameters.

Click this link to launch the Compose Query program. Use this program to write an ABL and Business Activity
designed Query (BAQ) compliant query used with this action. In addition to standard tables, the query phrases can be run
against temporary tables to analyze values passed between datasets.
Click this link to launch the Specify an Expression program. Use this program to compose an expression that is
evaluated against the comparison. The expression can contain literal values, data from the current transaction, and
specific
functions that can perform calculations and data type conversions. Click the Check Syntax button to verify the
syntax of your expression.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty rows (rows
that contain unsaved data), you can use this program to select how the action performs. Read the Support for
with rule
Multiple Dirty Rows section in this chapter for details about each option in this program. This variable is not visible
if the method data transaction does not support multiple dirty row updates.

• Enable dependent post-process directives - Use this action to launch any post-processing directives linked to this directive.
Use this action when you want an action to perform after the record is successfully validated and updated from the “tt”
(temporary) tables to the actual, or physical, tables.

You do not select any variables for this action. Instead, you link a post-processing directive to this pre- or base processing
directive by using the “this directive has been enabled from the specified directive” condition statement. You select the directive
that contains this action statement through the specified variable.

Use this action to test for conditions in a pre-processing or base processing directive and then launch a post-processing directive
based on these conditions. For more information, review the previous Conditions section. For more information on dependent
directives, read the Dependent Directives section later in this chapter.

Directive Types

Method Data Updatable BAQ


Pre-Processing Pre-Processing
None
Base Processing Base Processing

EPICOR SOFTWARE CORPORATION | 469


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

• Call the named BPM Data Form using no customization always - Use this action to launch a custom program created to
collect data specifically for use during the BPM directive action. You create the program using the BPM Data Form Designer.
Review the BPM Data Form Designer section later in this chapter for more information about BPM data forms.

Directive Types

Method Data Updatable BAQ


All None All

Variables

Click this link to open the Select BPM Data Form program. Use this program to specify which BPM
named
data form should launch when this action executes.

Click this link to open the Select BPM Data Form Customization program. Use this program to
no customization
select a customization to apply to the BPM data form when it is called.

Click this link to toggle between the following:

• Always – The BPM data form is called each time the action executes.
always
• Only when mandatory data missing – The BPM data form is called to acquire data
required to complete the data transaction, but was missing from the data set.

• Set the specified field of BPM Data to the specified expression - Use this action to set the value of a field in a BPM data
table. This table is used with the custom data storage functionality available through CallContext tables. You can check the field
value in a condition of a further directive or pass this value on to the client application. For more information, review the Call
Context topics within application help.

Directive Types

Method Data Updatable BAQ


All All All

Variables

Click this link to launch the Select Table Field(s) program. Use this program to specify a call context
specified (call context)
field that is part of the BPM action.
Click this link to launch the Specify an Expression program. Use this program to compose an
expression used as the call context variable value. The expression can contain literal values, data from
specified
the current transaction, and functions that can perform calculations and data type conversions. Click
the Check Syntax button to verify the syntax of your expression.

470 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

• Attach the specified public data tag to the changed row of the specified table with rule - Use this action to attach a
data tag to a record. You can apply data tags to records throughout the application. A common use of data tags may be to
group related records for searches or so that BPM directives can run when the records are modified. Review the Searches chapter
for more information about data tags.

Directive Types
Method Data Updatable BAQ
All All None

Variables

Click this link to launch the Specify a Value program. Use this program to enter a free-form text value
specified (data tag) that matches the data tag you want to apply to the current record. If the data tag has not been
previously defined, it will be created.
Click this link to toggle between two values: public and current user. Select public to attach a public
public data tag to the current record. Select current user to attach a private data tag for the current user to
the current record.
Click this link to launch the Select a Row Set program. Use this program to specify which row is
the changed row
affected when this rule activates - like the added row, the deleted row, the updated row, and so on.
Click this link to launch the Select Table program. Use this program to specify the table that is changed
specified (table)
through this action.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty
rows (rows that contain unsaved data), you can use this program to select how the action performs.
with rule
Read the Support for Multiple Dirty Rows section in this chapter for details about each option in this
program. This variable is not visible if the transaction does not support multiple dirty row updates.

• Remove the specified public data tag from the changed row of the specified table with rule - Use this action to remove
a data tag from a record. You can apply data tags to records throughout the application. A common use of data tags may be
to group related records for searches or so that BPM directives can run when the records are modified. Review the Searches
chapter for more information about data tags.

Directive Types

Method Data Updatable BAQ


All All None

Variables

Click this link to launch the Specify a Value program. Use this program to enter a free-form text value
specified (data tag)
that matches the data tag you want to remove from the record.
Click this link to toggle between two values: public and current user. Select public to remove a public
public data tag from the current record. Select current user to remove a private data tag from the current
record for the user that initiated the transaction.
Click this link to launch the Select a Row Set program. Use this program to specify which row is
the changed row
affected when this rule activates – like the added row, the deleted row, the updated row, and so on.
Click this link to launch the Select Table program. Use this program to specify the table that is changed
specified (table)
through this action.
Click this link to launch the Execution Rule program. If the data transaction supports multiple dirty
rows (rows that contain unsaved data), you can use this program to select how the action performs.
with rule
Read the Support for Multiple Dirty Rows section in this chapter for details about each option in this
program. This variable is not visible if the transaction does not support multiple dirty row updates.

EPICOR SOFTWARE CORPORATION | 471


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Support for Multiple Dirty Rows


A dirty row is a row of data that is modified but not yet saved to the database. For example, when the user modifies a row, like a
currency exchange rate, then moves to another row (another exchange rate), modifies it, and then saves the two rows together, these
two rows are called multiple “dirty” rows.

Some methods only allow changed rows to process one at a time, and so do not support multiple dirty rows. However, some methods
can send multiple dirty rows together as a set to the server for update.

When multiple rows are sent to the server at the same time, you can specify a directive to take action on the batch of rows in
a specific way. These actions are available for both method and data directives:

• Once passing all matching rows - The action executes once as it moves through the data within the set of dirty rows, but it
only gets the rows that match the selection criteria.

• Once passing all existing rows - The action executes one time as it moves through the data within the set of dirty rows, and it
checks all rows within the dirty row set.

• For each matching - The action executes for as many times as the number of rows that match the selection criteria in the dirty
row set. Each row processes individually.

• For each existing - The action executes for as many times as the number of rows within the dirty row set (the overall number
of dirty rows). Each row processes individually.

Directive Compatibility
Each directive must be compatible with the current version of the application.
To learn about the specific rules the BPM module
When a new version is installed, the BPM module runs routines to make sure
uses to test compatibility, read the Directive
the directive still works as expected.
Compatibility topic within application help.
A directive must be checked for compatibility through three situations:

• Importing Directives – If the directive is imported into your application, the import process validates the directive for
compatibility. If the directive is not compatible, an error message displays. For more information about this process, read
the Import Directives section in Chapter 13: Business Process Management Utilities.

• Service Packs – Each time a service pack is installed, use the Administration Tools program to run the “Validate BPM
customizations of business methods” conversion program. You do this by clicking the Run Conversion Program button and then
selecting this program from the Dialog Conversions window. This program analyzes each method signature to verify it works
with current method directives, data directives, and database tables. If it discovers an issue, the Compatible check box is cleared
on the specific directive’s Detail sheet.

• Patches – Each time a patch is installed on your application, you need to manually verify that all directives are compatible.
You do this by running the Validate Method option from the Actions menu.

Validate Method Program – How to Use

Main Menu Path: System Management > Business Process Management > Setup > Method Directives

To run the Validate Method program:

1. From the Actions menu, select 1


Validate Method.

If a directive is no longer compatible, the


word Outdated displays on the directive’s
Details sheet. This value is a status assigned
to the directive.

472 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

To correct incompatible directives, you need to load it into the Method Directives or the Updatable BAQ Directives program and
change it to match the revised method signature or table structure.

To help you locate these directives, the Method Search and Table Search programs are set up to only search for outdated directives.

Dependent Directives
You can establish relationships between directives created for the same business object method. These relationships are dependent;
if one directive executes successfully, the application runs the other directive. This first directive is called the Primary Directive, and it
becomes the condition for the second, or Dependent, directive. Dependent directive processing applies only to method directives, and
not to data directives.

Using dependent directives helps prevent errors. Leverage this function when you do not want to update a record or send a
confirmation email until you are sure the transaction completed successfully. If an action is run before the transaction, there may be an
error in the data – but the action runs anyway. For example, a confirmation email may be sent indicating the transaction was
successful, when actually it was not. If the condition for the email, however, is on a dependent directive, you know for certain the
transaction was successful before the email was sent.

To do this, you first create the primary directive and then the dependent directive. Both directives are created for the same method.

Primary Directive

The primary directive must either be a pre-processing or a base processing directive. After you define the condition for the directive, do
the following in the Actions window:

1. Click the New button on 1


the toolbar.

2. Click the User Text drop-


down list to select the
“enable dependent post
2
process directives” action
statement.

This action indicates that the result


of the primary directive – success or
failure – is passed to another
directive belonging to the same method.

Dependent Directive

This directive must be a post-processing directive. To create the dependent directive, launch the Conditions window and do
the following:

1. Click the New button 1


on the toolbar.

2. Click the User Text drop-


down list to select the “this
directive has been
enabled from the 3 2
specified directive”
condition statement.

3. Click the “specified” link to select the pre-processing or base processing method. In this example, the Condition Test to
Remove Hold directive is selected.

This condition statement indicates the application runs the dependent directive’s actions when both the primary directive executes
successfully and the other conditions in the dependent directive are met.

EPICOR SOFTWARE CORPORATION | 473


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Case Studies
This section of the chapter explores some step-by-step case studies. Each case study explores a different aspect of the functionality you
can leverage within the BPM module.

Make a Required Field


You can cause a specific field to become mandatory, or required, through a data directive. Using a directive makes the field required
on the server, so the entire application automatically updates with this change.

In this example, you make the Phone Number field required on all customer records.

Create the Data Directive

Menu Path: System Management > Business Process Management > Setup > Data Directives

To create the data directive:

1. Click the Table button.

2. The Table Search 2


window displays.

3. In the Starting At field, enter


Customer.

4. Select the Search by 5


Table option.
3
5. Click Search.
4
6. In the Search Results grid,
select Customer.

7. Click OK.

474 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

8. The Customer table displays


within the Table field.

9. Click Save on
the Standard toolbar. 9

Create the In-Transaction Directive and Condition

To create a pre-processing directive that checks the phone number field:

1. Click the Down Arrow next to the New button; select New In-Transaction
Directive. The directive must be “in-transaction” so that the transaction can
stop before the updated record without a phone number is committed to the
database.

2. The In-Transaction > Detail


sheet displays.

3. Enter the Directive Name.


For this example, you enter
2
Check Required
Phone Number. 3

4. Click the Conditions button.

5. The Conditions 5
window displays. 6

6. Click the New button 8


on the toolbar.

9 7

EPICOR SOFTWARE CORPORATION | 475


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

7. From the User Text list, select “the specified field of the changed row is equal to the specified expression”.

8. Notice the text in the Error Text field. This indicates the condition is not set up correctly. If you hold your mouse pointer over
this field, the complete explanation for the error displays.

9. Within the condition statement, click the first “specified” link.

10. The Select Table Field(s) 10


window displays.
11
11. From the Table list, select the
ttCustomer (temporary table) option.

12. Select the check box next


to the PhoneNum field.

13. Click OK.

12

13

14. You return to the Conditions window.


The specified value displays
“Customer.PhoneNum”.

15. Click the second “specified” link.


14 15

476 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

16. The Specify an expression 16


window displays.

17. Enter two quotes (“”) in the Editor


field; this represents a blank value.

18. Click OK.

17

18

19. You return to the Conditions window.


Notice the condition statement now
displays “the Customer.PhoneNum
field of the changed row is equal to
the“ expression”.
21 20 19
20. Also notice the Error Text field is
blank; this means the condition is set
up correctly.

21. Click OK.

EPICOR SOFTWARE CORPORATION | 477


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Create the Action

To define the action that causes the Phone Number field to be required:

1. Click the Actions button.

2. The Actions window displays. 2


3
3. Click the New button
on the toolbar.

4. Click the User Text drop-down list to


5 4
select “raise exception based on the
designed template”.

5. Within the action statement, click


the “designed” link.

6. The Design Exception 6


Template window displays.
7
7. Enter a Name for the exception
message. In this example, you
enter RequiredPhoneNum. 8

8. Enter the Text that displays when


the condition activates this action. In
this example, you enter “Before you
can save this customer record, you
must enter a phone number.”

9. Click OK.

478 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

10. You return to the Actions window.


Notice the action now displays “raise
exception based on the
RequiredPhoneNum template”. This
indicates the action that runs when
the condition activates.
11 10
11. Click OK.

Save the Directive

To complete the method directive:

1. Verify the Conditions and the Actions


fields display the correct text that you
want. In this example, the action
happens when the user leaves the
Phone Number field blank on a 3
customer record. When the user
attempts to save, which causes the
2
application to run the Customer.Update
method, the exception message
launches instead.

2. Select the Enabled check box. This


activates the method directive.

3. Click Save on the Standard toolbar. 1

Test the Directive

The method directive is enabled, so it is active. To test the directive:

Main Menu Path: Sales Management > Order Management > Setup > Customer

1. Create a new customer. Click New


on the Standard toolbar; in the 4
Customer field, enter a Customer
ID. In this example, enter DALCO.

2. Enter the Name of the customer and 1


select a Type.
2
3. Leave the Phone field blank.

4. Click Save.

EPICOR SOFTWARE CORPORATION | 479


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

5. The error message you


created displays.

6. Click OK.

The error message is working


correctly. Now users cannot save
a customer record until they have
entered a value within
the Phone field.

Validate a Field Against Another Table


You can create a method directive that validates a field contained in a different table from the one referenced within the business
method. During this example, you create a method directive that causes supplier records to save only if a State value is linked to
a company field; this value is selected within a user-defined table.

Customize User-Defined Table

To follow this example, you must first add and customize a user-defined table that contains State codes linked to a current company
within your application. To create a user-defined table similar to this program:

1. The Supplier State field is


linked to UD01.Key1
(DataSource.Datafield).

2. The Description field is linked


to UD01.Key2
(DataSource.Datafield).
1
3. The Company field is linked 2
to UD01.Company
(DataSource.Datafield). 3

To learn how to customize


and implement user-
defined tables, review the
User-Defined Tables
chapter in the Epicor ICE
User Experience and
Customization Guide.

480 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Retrieve the Business Object Method

When you have customized a user-defined table and entered all the state records, you are ready to create the method directive that
references this data. To create a directive for the Vendor.Update method:

Main Menu Path: System Management > Business Process Management > Setup > Method Directives

1. Click the Method Code button.

2. In the Starting At field, enter “u”.

3. Click the Business Object drop-down


list and select Vendor.

4. Click Search. 4

5. From the Search Results list, select


2
the Update option.

6. Click OK. 3

EPICOR SOFTWARE CORPORATION | 481


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Create the Directive and Define a Condition

1. Click the Down Arrow next to the New button; select New Pre-Processing.

2. Enter a Directive Name for


this directive. In this example,
you enter Validate
Supplier State.

3. Click the Conditions button.


2

4. The Conditions 4
window displays. 5

5. Click the New button


on the toolbar.

6. From the User Text list,


7 6
select “number of rows in
the designed query is not
less than 1”.

7. Click the “designed” link.

482 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

8. The Compose Query window displays. 8

9. Enter the Query Name for this custom query. In 9


this example, you enter ValidateState.

10. Now enter the following query:

for each ttVendor where(ttVendor.RowMod


= ‘U’ or ttVendor.RowMod = ‘A’),each
UD01 whereUD01.Company =ttVendor.
Company and UD01.key1 = 10
ttVendor.State no-lock

The query statement must be a complete


string, so do not add any hard or soft returns
between the various parts of the phrase. Also, 12 11
do not place a period at the end of
the statement.

11. To validate your syntax, click the Check query


button.

12. When you finish entering the custom query, click OK. This query is written in valid ABL syntax. To support optimistic
record locking, the application framework maintains a copy of
the original record and the updated record. It then sends both
of these rows to the server when the Update method is
launched. To identify the Updated or Added row rather than
any original row, it is necessary for the query statement to
specifically target that row through the RowMod column.
The valid entries for a changed row are A=Add, U=Update,
and D=Delete.

13. The Conditions window now displays


“number of rows in the
ValidateState query is
not less than 1”.

14. Next, click the “is not less than” link.


13 14

15. The Select a Comparison window displays. 15


16
16. Select the is less than option.

17. Click OK.

18

EPICOR SOFTWARE CORPORATION | 483


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

18. The condition statement now


displays “the number of
rows in the ValidateState
query is less than 1”.

19. Click OK.


19 18

Create the Action

To create the action that occurs when the condition activates:

1. Click the Actions button.

2. The Actions 2
window displays. 3
3. Click the New button to
create a new action.

4. From the User Text list, select 5 4


“raise exception based on
the designed template”.

5. Click the “designed” link.

484 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

6. The Design Exception 6


Template window displays.
7
7. Enter the Name for this exception
message. In this example, you
enter ValidateState.

8. Now enter the Message you want


to display. In this example, you enter
“Before you can save this supplier
record, complete the address
by entering a valid State
or Province”. 8

9. Click OK.

10. You return to the Actions window.


The action statement now displays
“raise the exception based on the
ValidateState template”.

11. Click OK.


11 10

Save the Directive

To complete the method directive:

1. Verify the Conditions and the Actions


fields display the correct text that
you want.
3
2. Select the Enabled check box.

3. Click Save on the Standard toolbar.


2

EPICOR SOFTWARE CORPORATION | 485


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Test the Directive

The method directive is enabled, so it is active. To test the method directive:

Main Menu Path: Material Management > Purchase Management > Setup > Supplier

1. Click the History drop-down


list to select a supplier.
1
2. Navigate to the Supplier > 4 2
Address sheet.

3. In the State/Prov field,


enter an invalid state. In this
example, you enter MH.
3
4. Click Save.

5. The exception error message


you created displays.

To correct this error, the user needs


to enter a State or Province found
within your custom Supplier State
Maintenance user-defined table.
5

486 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Create and Use a Hold Type


You can create a method directive that attaches holds to records that meet the specifications defined within its conditions statement.
Then you create another method directive that checks for this hold. If a hold is present, the method directive performs actions
you specify.

Typically you use this functionality to intercept a method before it is processed (through a pre-processing directive) to prevent this
method from running its normal routine. This type of method directive is called an inhibitor.

In this example, you create a Shop Employee hold. This hold is used with a custom check box within the Employee Maintenance form.
If the check box is selected, the shop employee is not able to start an activity without supervisor approval.

Create the Hold Type

To create your new hold type:


1
1. Navigate to Hold Type
Maintenance. Main Menu Path: 5
System Management >
Business Process Management >
Setup > Hold Type

2. Enter a Hold Type. In this example, 2


you enter Supervisor Hold.
3
3. Click the Business object button to
4
find and select the EmpBasic
business object.

4. Enter a Description. In this example,


you enter Supervisor Hold.

5. Click Save on the Standard toolbar.

Create the Hold Method Directive

To create a method directive that calls this new hold type:


1
1. Launch the Method Directives
program. Main Menu Path: 3
System Management > Business
Process Management > Setup >
Method Directives
2
2. Click the Method Code button
to find and select the
EmpBasic.Update method.

3. Click Save on the Standard toolbar.

EPICOR SOFTWARE CORPORATION | 487


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Pre-Processing Directive – Create Hold Condition

To create the pre-processing directive that calls the hold type:

1. Click the Down Arrow next to


the New button; select
New Pre-Processing. 1

2. Enter the Directive Name. In this


example, you enter Test to set
Supervisor Hold. 2

3. Click the Conditions button.

4. The Conditions 4
window displays. 5

5. Click the New button on the toolbar.

6. Click the User Text drop-down list to


select “the specified field has been 7 6
changed from any to any”.

7. Click the “specified” link.

8
8. The Select Table Field(s)
window displays.
9
9. Click the Table drop-down list to
select ttEmpBasic.

Notice you are selecting a table


with the tt prefix. This indicates
the table is a temporary table. This
table stores the data before it is
written directly to the actual, or
physical, table. This makes sure 10
the data is valid before it is saved to
the database.

10. Select the check box next to the


CheckBox01 option. This check box is
the field used as the Supervisor
Hold check box within
Employee Maintenance. 11

11. Click OK.

488 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

12. You return to the Conditions window.


Notice the condition statement now
displays “the ttEmpBasic.CheckBox01
field has been changed from any to
any”.

13. Click the second “any” link. 12 13

14. The Specify a Value 14


window displays.

15. Enter a Value. In this example, you 15


enter True.

16. Click OK.


16

17. You return to the Conditions 17


window.

18. Notice the condition statement now


displays “the ttEmpBasic.CheckBox01
field has been changed from any to
True”. 18
19
19. Click OK.

Pre-Processing Directive – Create Hold Action

To add an action that launches a post-processing directive:

1. Click the Actions button.

EPICOR SOFTWARE CORPORATION | 489


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

2. The Actions window displays. 2


3
3. Click the New button
on the toolbar.

4. Click the User Text drop-down list to


select “enable dependent post 4
process directives”. 5

5. Click OK.
6
6. You return to the Method
Directives window. 8

7. Select the Enabled check box.

8. Click Save on the Standard toolbar.

Post-Processing Directive – Set Supervisor Hold

To create the action that is activated by this condition:

1. Click the Down Arrow next


to the New button; select New
Post-Processing. 1

2. Enter a Directive Name. For this


example, enter Place Shop Employee 2
on Supervisor Hold.

3. Click the Conditions button.

490 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

4. The Conditions 4
window displays. 5

5. Click the New button on the toolbar.

6. Click the User Text drop-down list


to select “this directive has 7 6
been enabled from the
specified directive”.

7. Click the “specified” link.

8. The Select a primary directive to 8


depend on window displays.

9. Select the Pre: radio button. 9

10. Click the Directive drop-down list to select


the Test to set Supervisor Hold option. 10

11. Click OK.


11

12. You return to the 12


Conditions window.

13. The condition statement now displays


“this directive has been enabled
from the Test to set Supervisor
Hold directive”. 13

14
14. Click OK.

Post-Processing Directive – Supervisor Hold Action

To create an action for the new hold type you created – Supervisor Hold:

1. Click the Actions button.

EPICOR SOFTWARE CORPORATION | 491


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

2. The Actions 2
window displays. 3

3. Click the New button


on the toolbar.

4. Click the User Text drop- 5 4


down list to select “attach
hold of the specified type”.

5. Click the “specified” link.

6. The Hold Attachment 6


window displays.
7
7. Click the Hold Type drop-
down list to select
Supervisor Hold.
8
8. Click OK.

9. You return to 9
the Actions window.

10. Notice the action now displays


“attach hold of the
Supervisor Hold type”.
11 10
11. Click OK.

12
12. You return to
the Method 14
Directives window.

13. Select the Enabled check box.

14. Click Save on


the Standard toolbar.
13

492 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Block Employee Activity Directive

To create a method that blocks the Start Activity for an employee on Supervisor Hold:

1. Click the Clear button on the


Standard toolbar.
3
2. Click the Method Code
button to find and select the 1
Labor.StartActivity method.
2
3. Click Save.

Block Employee Activity Directive – Add Condition

To create a pre-processing directive that checks for the state of the Supervisor Hold directive:

1. Click the Down Arrow


next to the New button;
select New 1
Pre-Processing.

2. Enter the Directive Name.


For this example, you enter 2
Block Start Activity of
Held Employee.

3. Click the Conditions button.

EPICOR SOFTWARE CORPORATION | 493


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

4. The Conditions 4
window displays. 5

5. Click the New button


on the toolbar.

6. Click the User Text drop- 7 6


down list to select “the hold
of the specified type is
attached to the
business object”.

7. Click the “specified type


is attached to the business
object” link.

8. The Select Business 8


Object window displays.

9. In the Tree View, expand the


Labor > Objects, linked with
the object "Labor" > via
LaborHed nodes and select 9
EmpBasic.

10. Click the Hold Type drop-


down list, select the hold you
created. In this example, you
select Supervisor Hold.

11. Click OK.

10

11

12. You return to the 12


Conditions window.

13. Notice the User Text now


displays “The hold of the
“Supervisor Hold” type is
attached to the EmpBasic”. 13
14. Click OK. 14

494 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Block Employee Activity Directive – Add Action

To complete this method directive, you need to add an action that alerts the shop employee that, because of the hold, the activity
cannot start.

1. Click the Actions button.

2. Click the New button 2


on the toolbar.

3. Click the User Text drop-down list to


select “raise exception based on
the designed template”.
4 3
4. Click the “designed” link.

5. The Design Exception 5


Template window displays.
6
6. Enter the Name for this exception
message. For this example, you
7
enter Block Start Activity.

7. Now enter the exception message. For


this example, you enter “Please see
your supervisor to start
this activity”.

8. Click OK.

EPICOR SOFTWARE CORPORATION | 495


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

9. You return to 9
the Actions window.

10. Notice the action now displays “raise


exception based on the Block Start
Activity template”.
10
11. Click OK.
11

12
12. You return to the Method
Directives window. 14

13. Select the Enabled check box.

14. Click Save on the Standard toolbar.

13

Check Hold Directive

To create a directive that checks to see if the supervisor hold on the shop employee can be removed:

1. Click the Method Code button


to find and select the
EmpBasic.Update method. 2

2. Click the Down Arrow next to the 1


New button; select New Pre-
Processing.

496 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

3. Enter a Directive Name. For this


example, you enter Condition Test to
Remove Supervisor Hold.

4. Click the Conditions button.

5. Click the New button


on the toolbar. 5

6. Click the User Text drop-down list


to select “the specified field of
the changed row is equal to the
specified expression”. 7 6

7. Click the first “specified” link.

8. The Select Table Field(s) 8


window displays.
9
9. From the Table drop-down list,
select the ttEmpBasic option.

10. Click the check box next to


the CheckBox01 field.

11. Click OK. 10

11

EPICOR SOFTWARE CORPORATION | 497


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

12. You return to the 12


Conditions window.

13. Click the second “specified” link.

13

14. The Specify an expression 14


window displays.

15. Enter an expression. In this example,


you enter False.

16. Click OK.

15

16

17
17. You return to the
Conditions window.

18. Notice the User Text now states


“the EmpBasic.CheckBox01 field of
the changed row is equal to the
False expression”. 18

19. Click OK. 19

498 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Check Hold Directive - Action

To finish this pre-processing directive, you need to create an action that enables post-processing.

1. Click the Actions button.

2. The Actions window displays. 2


3
3. Click the New button
on the toolbar.

4. Click the User Text drop-down list


4
to select “enable dependent
post process directives”. 5

5. Click OK.
6
6. You return to the Method
Directives window. 8

7. Select the Enabled check box.

8. Click Save on the Standard toolbar.

EPICOR SOFTWARE CORPORATION | 499


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

Remove Supervisor Hold Directive

To complete the directives, you create a post-processing directive that removes the supervisor hold. The shop employee can then run
a selected MES activity.

1. Click the Down Arrow


next to the New button;
select New Post-
Processing. 1

2. Enter the Directive


Name. For this example, you 2
enter Remove Supervisor Hold.

3. Click the Conditions button.

4. The Conditions 4
window displays. 5

5. Click the New button


on the toolbar.

6. Click the User Text drop- 7 6


down list to select “this
directive has been
enabled from the
specified directive”.

7. Click the “specified” link.

8. The Select a primary directive to depend on 8


window displays.

9. Select the Pre: radio button.


9
10. Click the Directive drop-down list to select the
Condition Test to Remove Supervisor Hold option. 10
This option is the pre-processing directive you just
created.
11
11. Click OK.

500 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

12. You return to the 12


Conditions window.

13. The User Text now states


“this directive has been
enabled from the
Condition Test to 13
14
Remove Supervisor
Hold directive”.

14. Click OK.

Remove Supervisor Hold Directive – Add Action

You complete this directive by adding an action that removes the supervisor hold.

1. Click the Actions button.

2. The Actions 2
window displays.
3
3. Click the New button
on the toolbar.

4. Click the User Text drop- 5 4


down list to select “remove
holds of the specified
type”.

5. Click the “specified”link.

6. The Hold Removal 6


window displays.
7
7. Click the Hold Type
drop-down list to select 8
the Supervisor Hold option.

8. Click OK.

EPICOR SOFTWARE CORPORATION | 501


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

9. You return to the 9


Actions window.

10. Notice the User Text now displays


“remove holds of the Supervisor
Hold type”.
10
11. Click OK. 11

12
12. You return to the Method
14
Directives window.

13. Select the Enabled check box.

14. Click Save on the Standard toolbar.

13

Test the Directives

Verify your new BPM hold and directives work as expected.

However, before you can test the directives, you need to customize Employee Maintenance. You must add the Supervisor Hold
check box.
1
1. Activate Developer Mode and
launch Employee Maintenance. 6
Main Menu Path: Production
Management > Job Management >
Setup > Employee
2
2. Click Tools > Customization to launch
the Customization Tools Dialog.

3. Add a new check box on the Employee


Maintenance form. 4

4. Use the EpiBinding property to link it


to the EmpBasic.CheckBox01 field.

5. Add a Label that displays this text: 3


Supervisor Hold.
5
6. Save the customization and exit
Employee Maintenance.

To learn how to customize forms, review the Epicor ICE User


Experience and Customization Guide. For information about
how you add a field to to a custom form, review the Basic
Customization chapter. To learn how to add a custom form to
the Main Menu, review the Customization Utilities chapter.

502 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

7
7. Now launch Employee
Maintenance in run 10
mode.

8. Click the ID button to find


and select an employee. In 8
this example, you select
Lisa V. Ford.

9. Select the Supervisor Hold


check box. This check box is
the custom field you created.

10. To record your change,


click Save on the
Standard toolbar.

11. Now open the MES 11


Menu.
13
12. Log in as the shop employee
that you modified. In this
example, you log in as
employee 104, Lisa V. Ford.

13. Click the Start Production


Activity button.
12

EPICOR SOFTWARE CORPORATION | 503


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

14. The exception message displays.

This user cannot log into any activity until


the Supervisor Hold check box is clear (not
selected) on the Employee record.

14

Default Data to Updatable BAQ Records


The following tasks build on an updatable BAQ and dashboard examples detailed earlier in this guide. The BAQ is
EPIC03-UpdateCustContacts and the dashboard is Customer Contact Update. You can review the previous examples that used this
updatable BAQ within Chapter 4: Business Activity Queries and Chapter 7: Dashboards. If you have not already done so, you must
recreate the updatable BAQ and dashboard described in these chapters to complete the steps in this section.

Publish Dashboard Data

In this example, you want the directive to populate the contact’s address information with the customer’s address information when
the user creates a new contact within the Customer Contact Update dashboard. The first part of the process publishes the customer
address information from the Customer Contact Update dashboard.

With the dashboard in Developer mode, follow these steps to publish data so it can be used in a BPM directive:

1. In the Dashboard Tree View, select


the zCustomer01:Customer Tracker 2
Query query.

2. From the Edit menu, select Properties.

504 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

3. The Dashboard Query 3


Properties program displays.

4. Select the Publish sheet. 4

5. In the Publish Columns list, select


the check boxes next to the following
column names:

• Customer.Address1
5
• Customer.City

• Customer.State 6

• Customer.Country
7 8
• Customer.Zip
9
6. In the Call Context Subscriber grid,
click New.
10
7. From the Publish Column,
select Customer.Address1.

8. In the BPMDataColumn, select Character01.

9. Add the remaining address columns to the Call Context Subscriber grid using the following information:

• Customer.City = Character02

• Customer.State = Character03

• Customer.Country = Character04

• Customer.Zip = Character05

10. Click OK and Save.

Get the Updatable BAQ Methods

To locate the methods used by the updatable BAQ:

1. Launch the Updatable BAQ 1


Method Directives program. Main
Menu Path: System Management >
Business Process Management >
Setup > Updatable BAQ Method
Directives 2

2. Click the BAQ ID button to find and


select a BAQ ID. You can also enter the
BAQ ID directly.

EPICOR SOFTWARE CORPORATION | 505


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

3. If you click the BAQ ID


button, the Updatable
BAQ Search program
displays. Use this program to
locate the BAQ where you
want to apply a directive. In 4
this example, to create
a directive for the
EPIC03-UpdateCustContacts 3
BAQ, enter “EPIC03-U” in
the Starting At field to
narrow the search results.

4. Click Search.

5. The Search Results grid


displays all the tables that
match the search criteria. In
this example, you highlight 5
the four options for
EPIC03-UpdateCustContacts.

6. Click OK.

7. The Tree View displays the


four updatable BAQ methods.

8. The Detail sheet now displays


the primary information on
the selected BAQ method. 8

You can review the ABL code used


by the BAQ to update the database
7
by selecting the Update method in
the Tree View, navigating to the
Base Processing tab, and reviewing
the “execute ABL /* Update
Procedure*/” action.

506 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

New Post-Processing Directive

You are now ready to add a directive to the updatable BAQ. In this example, the directive will default a new contact’s address
information when the user creates a new contact using the Update Customer Contact dashboard. The directive uses the information
published from the dashboard to set the values in newly added contact records.

To create a new directive:

1. In the Tree View of the


Updatable BAQ Method
Directives program, select
EPIC03-UpdateCust 2
Contacts.GetNew.

2. Click the Down Arrow next 1


to the New button; select
New Post-Processing.
3
3. Enter the Directive Name
that you use to identify the
directive. In this example,
enter “Auto Populate
Contact Address”.

4. Click the Actions button.


4

5. The Actions window 5


displays. Because we 6
want it to run each time
the GetNew method is called,
this directive will not use any
condition statements.
8 7
6. Click New in the toolbar.

7. Click the User Text drop-


down list to select “set the
specified field of the
changed row to the
specific expression
with rule”.

8. Click the “specified” link.

EPICOR SOFTWARE CORPORATION | 507


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

9. The Select Table Field(s) 9


window displays.
10
10. Click the Table drop-down list to select
ttResults.

11. In the Fields grid, select the check box


next to CustCnt_Address1.

12. Click OK. 11

12

13
13. You return to the
Actions window.

14. The User Text now states “set the


Results.CustCnt_Address1 field of
the changed row to the specific
expression with rule”. 15 14

15. Click the “the changed row” link.

16. The Select a Row Set 16


window displays. 17

17. Select the added row.

18. Click OK.

18

508 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

19. You return to 19


the Actions window.

20. The User Text now


states “set the
Results.CustCnt_Address1
field of the added row to 20 21
the specific expression
with rule”.

21. Click the “specific” link.

22. The Specify an 22


expression dialog
box displays.

23. In the Available variables


Tree View, expand the
ttCallContextBpmData
node.
23
24. Double-click
Character01. The
Editor field displays
ttCallContext
BpmData.Character01.
24
25. Click OK.

25

EPICOR SOFTWARE CORPORATION | 509


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

26. You return to 26


the Actions window.

27. The User Text now states


“set the
Results.CustCnt_Address1
field of the added 27
row to the
ttCallContextBpmData…
expression with rule”. Now
the action will set the Address
field of a new row to the
value published from the
dashboard to the Character01
field, which is the customer’s
street address.

28. Continue to add new User


Texts to populate the
remaining fields published
from the dashboard.

29. Click OK. 28

29

30. You return to 30


the Updatable 33
BAQ Method
Directives window.

31. The actions you created


display in the Actions field.

32. Select the Enabled check box.


32
33. Click Save on
the Standard toolbar.

31

510 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT | CHAPTER 11

Test the Directive

To test the directive:

1. Launch Customer Contact 1


Update in the Dashboard 2
program. Main Menu Path: Executive
Analysis > Business Activity
Management > General
Operations > Dashboard

2. From the Tools menu, select


Deploy Dashboard. The ID of
the Customer Contact Update
dashboard is CustContactUpdate.

3. The Deploy Dashboard 3


window displays.
4
4. Click the Test
Application button.

EPICOR SOFTWARE CORPORATION | 511


CHAPTER 11 | BUSINESS PROCESS MANAGEMENT

5. The dashboard 5
displays. 6
6. Click the Refresh 9
button on the
Standard toolbar
to retrieve the 7
customer data.

7. In the Customer Tracker


Query grid, select a customer
record.

8. In the Customer Contacts


grid, click a row. The New
button on the Standard
toolbar becomes available.

9. Click New.
8
10. A new row is added to the
Customer Contacts grid.
The address information 10
from the customer record is
added to the contact’s address
fields.

512 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

Chapter 12
Custom Business
Process Management

The previous chapter explained how you can leverage the set of default actions released with the Business Process
Management (BPM) module. You can extend this functionality, however, by programming custom actions.
This functionality is only available if your user account has BPM Advanced User permissions.

Custom program actions can be defined in the C#, Visual Basic .NET, or ABL programming languages. At their base level,
custom actions are essentially event handlers that extend or replace the functionality of server-side application business logic.

Be aware that code written using Progress can only update tables within the current transaction. If you need to update tables
outside of the transaction, you need to purchase a provision for this additional functionality. You may also be able to create a
special routine that can handle this function; contact your Epicor consultant for more information.

You begin the custom action programs within the BPM module by creating an action template. You then open this template
within a .NET or ABL environment where you program the action. Lastly, you deploy the custom action to either the
application server or the BPM server. You can then use this custom action within your method directives.
BUSINESS PROCESS MANAGEMENT | CHAPTER 8
This section describes how you use the BPM tools to create and enter your custom code. Specific details about code
languages, however, are beyond the scope of this user guide. If you have any questions about your custom code, refer to the
various reference guides and training manuals available for the programming language.

EPICOR SOFTWARE CORPORATION | 513


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

Method Advanced Options


The Method Advanced Options program displays the arguments contained in the current method; use this program to review what
you need to know before you build your custom action. You also use this program to launch the Create Programming Interface wizard
which walks you through creating an actions template.

You launch the Method Advanced Options program from within the Method Directives program. Here’s how:

1. Click the Method Code


button to find and select the 2 3
method that you need.

2. Click the Actions menu.

3. Select Advanced. 1

4. The Method 4
Advanced Options
program displays. 6 7 5 8 9

5. The signature of the current


method displays within the
Method Arguments grid.
Use this grid to examine the
building blocks for the current
method; this information is
useful as you program your
action. Notice you cannot edit
any of these fields.
11 10
6. The Order field displays
the sequence through which
each argument is run
by the method.
CHAPTER 8 | BUSINESS PROCESS MANAGEMENT
7. The Direction field indicates how the data flows through the argument. In this example, the direction is either INPUT
or OUTPUT.

8. The Name field displays the name of the argument.

9. The Type field displays the classification for each argument. This example displays the CHARACTER, TABLE, INTEGER,
and LOGICAL types.

514 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

10. Click the Create Programming Interface button to launch the Create Programming Interface Wizard. You use this wizard
to create a template for a custom action. Read the next section for details on how to use this functionality.

11. To close this program, click OK.

The Create Programming Interface Wizard


Use the Create Programming Interface Wizard to guide you through creating a programming interface that extends BPM functionality.
After you define a method directive, you can use this wizard to extend the method’s functionality with the following component types:

• An action template for a .NET assembly – The wizard launches the Action Template Generator, which you use to create a
.NET action template. You then write custom code within the template, deploy the action to the server, and then attach it to a
method directive.

• An action template for an ABL procedure – The wizard launches the Action Template Generator so you can create an ABL
action template. You then write custom code within the template, deploy the action to the server, and then attach it to a
method directive.

• Connect to an Epicor Service Connect workflow – The wizard launches the Programming Interface Generation program.
Use this program to create the schemas required for the workflow.

Create a Service Connect Workflow


When you use the wizard to create a Service Connect workflow, you generate the workflow schemas that comply with the current
method. Here’s how:

1. You launch this wizard from


within the Method
Advanced Options program.
To do this, click the
Create Programming
Interface button.

2. The Programming Interface Generation


window displays. Select the Epicor Service
Connect Workflow radio button.

3. Click Next.

EPICOR SOFTWARE CORPORATION | 515


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

4. The wizard now asks you where you would like


to generate and save the .xsd schemas. Enter the
Location you want, or click the Browse
button to find and select the output folder.

If you are on the same machine as Epicor


4
Service Connect, save the schemas to the
SCS\Schemas\UserSchemas folder where
Service Connect is installed. Saving the 5
schemas to that location makes them
available for use in Service Connect 6
workflows. The In Schema is named
MD_<BOName>_<MethodName>_Request.xsd
and the Out Schema is named 7
MD_<BOName>_<MethodName>_Response.xsd.

5. The In Schema field displays the path and


filename used to generate the In Schemas for
the workflow.

6. The Out Schema field displays the path and filename used to generate the Out Schemas for the workflow.

7. Click Finish.

The schemas are now saved within this location. Review your Epicor Service Connect documentation and the Epicor Service Connect
User Guide to learn how to design your workflow.

Create Action Templates


The process to create action templates is
similar for .NET assemblies and ABL
procedures. Here’s how you use the Create
Programming Interface Wizard to build an
action template:

1. You launch this wizard from within the


Method Advanced Options program.
To do this, click the Create
Programming Interface button.

2. The Programming Interface Generation 2


window displays.

3. Select the Component Type you want


to create. In this example, you select
the .NET assembly option.

4. Click Next. 3

516 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

5. The Action template 5


generator window displays.
6
6. The Language field displays the
programming language used to create
10
the action. In this example, C#
automatically displays in this field.
7 8
7. Notice the Name of the
method displays.
9
8. Select the point in the method
processing when this custom action
runs. Available options:

• Before – Select this check box to


create a method or procedure
template that runs as a pre-
processing action before
the method.
15 11
• Base – Select this check box to
create a method or procedure that
runs instead of the current method.

• After – Select this check box to create a method or procedure template that runs as a post-processing action after
the method.

In this example, you select both the Before and After check boxes.

9. The Code Area field displays the default .NET method template or ABL procedure template required to execute this custom
action with the current method. In this example, two action templates are created – one that runs before the GetRows method,
and one that runs after the GetRows method.

10. If the code does not automatically appear, click the Generate button to create the code template as expected.

11. The action template is complete. Click Save.


BUSINESS PROCESS MANAGEMENT | CHAPTER 8
12. The Save As window displays. 12

13. Enter the File name of the action


template file. Be sure this name uses
the correct file extension. For example,
if you are creating a .NET action
template, you would save this file as
AbcCodeAction.cs. If you are creating
an ABL action template, you would
save this file as AbcCodeAction.p.

14. Click Save.

15. To exit the Action Template Generator,


click OK.

13 14

EPICOR SOFTWARE CORPORATION | 517


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

Most transactions start with a GetNew or GetByID method to either populate When you write ABL or .NET code, be sure you are
default values into the dataset or to retrieve existing data from the database. identifying the correct row within the dataset. You
The client keeps a copy of the original row and sends this back through an must do this because the Update method creates
Update method along with the updated row. The server then compares the two copies of the row within the inbound dataset. If
original copy of the row to the current row on the actual, or physical, the copy of the returned row to the client does not
database to make sure it did not change from another source before it match the actual database, you receive an error and
updates the row. In these cases, only the changed row has an A (Add), future updates also fail. This feature is part of the
U (Update), or D (Delete) value in the table’s RowMod column. Optimistic Record Locking Mechanism; it applies to
both conditions and actions.

Define Custom Action Logic


You can now open the action template within your programming environment to create your custom action. You do this differently,
depending on whether you are developing a .NET or an ABL action.

.NET Process
To enter the programming logic for a .NET action:

1. Launch your .NET programming environment.

2. Create an empty Class Library C# project.

3. Add your .cs file to the project. For example, AbcCodeAction.cs.

4. If you need, enter a Reference to the BpmCallContext.dll assembly. Add this reference if you want to view information about
how the action was called by the BPM functionality. This assembly is found within the BPMServer folder.
CHAPTER 8 | BUSINESS PROCESS MANAGEMENT
5. Write the custom business logic in the body of each method. For example, if you are creating a custom action for entering ABC
Code records, you could enter code similar to the following:

public class AbcCode {


public void OnBeforeGetRows(ref String whereClauseAbcCode,
System.Data.DataSet AbcCodeDS,
Ref Int32 pageSize,
Ref Int32 absolutePage,
Ref Boolean morePages) {

Trace.WriteLine(“Before a call to
AbcCode.GetRows()”);}

public void OnAfterGetRows(ref String


whereClauseAbcCode,
System.Data.DataSet AbcCodeDS,
ref Int32 pageSize,
ref Int32 absolutePage,
ref Boolean morePages) {

Trace.WriteLine(“After a call to
AbcCode.GetRows()”);} }

6. Build the project.

518 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

ABL Process
To enter the programming logic for an ABL action:

1. Open your .p file within an OpenEdge (Progress) procedure. An example of a Progress procedure is the AbcCodeAction.p file.

2. Write custom business logic to the internal procedures. For example, if you created an action template that checked data before
and after an ABC record was entered, you would enter code similar to the following:

PROCEDURE GetRowsBefore:
DEF INPUT-OUTPUT PARAM whereClauseAbcCode AS CHARACTER.
DEF INPUT-OUTPUT PARAM DATASET FOR AbcCodeDataSet.
DEF INPUT-OUTPUT PARAM pageSize AS INTEGER.
DEF INPUT-OUTPUT PARAM absolutePage AS INTEGER.
DEF INPUT-OUTPUT PARAM morePages AS LOGICAL.
{&TRY_PRIVATE}

OUTPUT TO “c:\BpmActionText.txt”.
EXPORT STRING(NOW)+ “Before AbcCode.GetRows()”.
OUTPUT CLOSE.

{&CATCH_PRIVATE}
END.

PROCEDURE GetRowsAfter:
DEF INPUT-OUTPUT PARAM whereClauseAbcCode AS CHARACTER.
DEF INPUT-OUTPUT PARAM DATASET FOR AbcCodeDataSet.
DEF INPUT-OUTPUT PARAM pageSize AS INTEGER.
DEF INPUT-OUTPUT PARAM absolutePage AS INTEGER.
DEF INPUT-OUTPUT PARAM morePages AS LOGICAL.
{&TRY_PRIVATE}

OUTPUT TO “c:\BpmActionText.txt”.
EXPORT STRING(NOW)+ “After AbcCode.GetRows()”.
OUTPUT CLOSE.
{&CATCH_PRIVATE}
END.
BUSINESS PROCESS MANAGEMENT | CHAPTER 8
3. Verify your ABL syntax is correct.

4. If you need, compile the ABL procedure.

Programming Action Signatures


A custom action must have a signature which matches the signature of the business object method to which it is attached. If it
does not, the action cannot execute.

Actions always take parameters by reference – including actions that run before (pre-processing) the method. Even if a parameter is
defined as OUTPUT for the business object method, the action might be executed before another action. Because of this, it should
inspect the current parameter value.

This section displays examples of how a Method Signature needs to be mapped to a C# Action Signature and an ABL
Action Signature.

EPICOR SOFTWARE CORPORATION | 519


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

This table displays an example of a C# Action Signature:

Method Signature C# Action Signature


DEF INPUT PARAM whereClauseAbcCode AS CHARACTER. ref string whereClause
DEF OUTPUT PARAM TABLE FOR ttAbcCode. DataTable ttAbcCodeList
DEF INPUT PARAM pageSize AS INTEGER. ref Int32 pageSize
DEF INPUT PARAM absolutePage AS INTEGER. ref Int32 absolutePage
DEF OUTPUT PARAM morePages AS LOGICAL. ref boolean morePages

Using this example, the blank C# action for this example appears like this:

public class AbcCodeAction{

public void OnGetRows( ref String whereClauseAbcCode,


System.Data.DataSet AbcCodeDataSet,
Ref Int32 pageSize,
Ref Int32 absolutePage,
Ref Boolean morePages) {
}
}

If the action is developed in ABL, the signature maps to the same signature as the source method – except for the data direction,
which must be INPUT-OUTPUT for all parameters.

Method Signature 4GL Action Signature


DEF INPUT-OUTPUT PARAM whereClauseAbcCode
DEF INPUT PARAM whereClauseAbcCode AS CHARACTER.
AS CHARACTER.
DEF OUTPUT PARAM TABLE FOR ttAbcCode. DEF INPUT-OUTPUT PARAM TABLE FOR ttAbcCode.
DEF INPUT PARAM pageSize AS INTEGER. DEF INPUT-OUTPUT PARAM pageSize AS INTEGER.
DEF INPUT PARAM absolutePage AS INTEGER. DEF INPUT-OUTPUT PARAM absolutePage AS INTEGER.
DEF OUTPUT PARAM morePages AS LOGICAL. DEF INPUT-OUTPUT PARAM morePages AS LOGICAL.

Database Efficiency - Inner Joins


This section describes how to join results from multiple tables into a single query. Using the Inner Join technique can dramatically
improve the performance and scalability of your custom ABL queries. Most performance problems are caused when too many
database queries are sent by the Epicor application. For example, a simple GetList() request can create hundreds of database queries,
but it only returns 30 small records in its results.

Poor performance makes for even poorer scalability. Your Epicor application should support 25-35 concurrent users per AppServer and
have less than 50,000 SQL Server requests per second. Even taking five seconds to run a method can reduce efficiency. During that
time, at least one CPU core is fully consumed, which impacts response times for other users. Minor performance and SQL Server
efficiency improvements provide significant scalability benefits — improving use of the application across your entire organization.

Most of the excessive SQL query traffic comes from requesting individual
rows and then evaluating a lot of data as the query moves through the While Progress does have other table join patterns,
database tier. Usually this happens when using FIND FIRST, CAN FIND, only the inner join pattern is efficient on SQL Server.
and FindTbl.i statements within FOR EACH code blocks. Those nested
statements must be consolidated with the outer FOR EACH statement.
JOINING tables can radically reduce the number of SQL Server requests. You
do this by using the FOR-EACH…,EACH…, EACH… pattern in 4GL (ABL);
these statements execute an inner table join.

520 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

Include Field Lists

You should also include field lists with your inner joins. Using field lists is a good practice that can increase database efficiency.
Many tables have several columns that can be included in queries, but usually most queries only need one or two values. Including all
of these columns in a query creates additional, unnecessary disk and network I/O traffic, and this extra traffic combines with other
overhead all the way through the database. This slows down the entire database.

A good example is the use of text columns. Text columns are stored off-page in SQL Server, meaning they require extra disk I/O
to read. But text columns are rarely needed in the application logic, so pulling them into every query is an inefficient use of
server resources.

Field lists are also critical for effectively using inner table joins. Without them, every row returned will have every column from every
table in the aggregate statement. For example, joining OrderHed and OrderDtl without a field list will return rows with 680 columns.

Consolidate Queries with Table Joins

One major cause of poor performance are nested queries; this occurs when a FindTbl.i statement is run within the FOR EACH loop.
If a record does not exist, the query then skips through the code. The following code is an example of a nested query:

FOR EACH partwhse NO-LOCK


WHERE PartWhse.Company = Part.Company AND
PartWhse.PartNum = part.PartNum :

/* Make sure the warehouse is in the current plant */


{lib/findtbl.i &amp;QFind = first
&amp;QLock = no-lock
&amp;QTableName = Warehse
&amp;QWhere = “Warehse.company = PartWhse.Company AND
Warehse.Warehousecode = PartWhse.WarehouseCode AND
Warehse.Plant = cur-plant” }

IF NOT AVAIL Warehse THEN NEXT partwhse-loop.

This code is inefficient because each run through the code generates a new database query. If 2000 PartWhse records are in the
database, this code will send 2001 queries to the database. Instead, you should join the PartWhse and Warehse tables. You can then
run the same code using just one database query — a major improvement over 2001 queries. The following code is an example of
a more efficient query:

partwhse-loop:
FOR EACH partwhse
fields(Company WarehouseCode partnum)
WHERE PartWhse.Company = Part.Company AND
PartWhse.PartNum = part.PartNum NO-LOCK,
EACH Warehse
fields()
where Warehse.Company = partwhse.Company
and Warehse.WarehouseCode = partwhse.WarehouseCode
and Warehse.Plant = cur-plant
BY PartWhse.Company PartWhse.PartNum PartWhse.WarehouseCode
no-lock:

This code pattern is an inner table JOIN, indicated by the nested EACH statement. The database will evaluate the PartWhse and
Warehse rows together and return only records that contain both warehouse and part warehouse data.

Collect the Right Rows

You can also use inner joins to gather the right rows instead of querying multiple rows and then eliminating the rows you do not
want. This creates a targeted, efficient query. The following code example is a search routine that could be drastically improved by
collecting the right rows. This code example creates search results by looking for qualifying order releases, jobs, and other related
database items.

EPICOR SOFTWARE CORPORATION | 521


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

for each OrderRel no-lock where […]


if lookup(“Reserved”:U,ipDemandType,LIST-DELIM) &gt; 0 then do:
if not can-find (first PartAlloc where […])
then next.
end.
buffer-copy OrderRel to ttOrderAllocList.
end.

While this code executes a nested query that could be consolidated with the outer query, the code is still inefficient. If the nested
query is not successful, you move onto the next row. Because of this, the code is pulling in all of the records and then eliminating any
rows that do not match the query parameters. You should instead consolidate these queries using a JOIN, as the code will then
automatically filter out rows based on the WHERE clause.

for each OrderRel no-lock where […],


each PartAlloc (SysRowId) no-lock where […]
buffer-copy OrderRel to ttOrderAllocList.
end.

Match Joined Rows

Progress only supports inner joins for SQL Server. Because of this, Progress only returns rows that have a matching joined row.
This feature is useful for filtering out rows in queries, but it also means you cannot use a join to get optionally related tables.
For example, Customer records can optionally have a GroupCode value, which is the key used to access the CustGrup table.

In the example query below, only rows with a GroupCode value are returned. Customer rows that have a blank (or NULL) value are
not returned. Make sure you want this behavior in your query.

FOR EACH Customer FIELDS(Company CustID GroupCode),


EACH CustGrup FIELDS(GroupDesc) WHERE
CustGrup.Company = Customer.Company AND
CustGrup.GroupCode = Customer.GroupCode
BY Customer.Company Customer.CustNum:
DISPLAY Customer.Company Customer.CustID Customer.GroupCode CustGrup.GroupDesc.
END.

Always Use FIELD Lists

Always use FIELD lists for joined tables. If you do not use FIELD lists, the results will contain all columns from all tables. Pulling in
excessive data through inner joins reduces performance by almost as much as not leveraging inner joins. If you do not need any
columns from a joined table (this happens frequently), specify an empty field list: FIELDS()

You can also use EXCEPT to filter out unwanted columns - like the UD columns.

Select One Row

Only use a table JOIN if the joined columns will select one row (or zero if you are filtering data). If you JOIN to a table that uses
a column list which does not represent a unique row, the database produces all of the joined rows together using a copy of the
main table.

This situation, called a Cartesian product, is inefficient and can cause issues. The following code is an example of an inefficient query:

for each OrderHed where OrderHed.Company = CUR-COMP no-lock,


each OrderDtl no-lock:
end.

Several things are wrong with this example (no field list, no sort, and so on). But the main problem is that without the selection
criteria, this routine will return all order headers multiplied by all order detail records. As a general rule, you should match a table’s
foreign key to the joined table’s primary key.

522 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

The following example illustrates how you match the foreign key to the primary key (to clearly illustrate this concept, this code does
not contain the FIELDS lists):

for each OrderDtl where OrderDtl.Company = CUR-COMP no-lock,


each OrderHed where OrderDtl.Company = OrderHed.Company
and OrderDtl.OrderNum = OrderHed.OrderNum
no-lock:
end.

Join Multiple Tables

You can join as many tables and include non-key columns to filter the data as you need. For example, the Fulfillment Workbench
search selects order releases (OrderRel records) that also have complex related-data requirements. The requirements:

1. The matching PartDtl record must have the RequirementFlag value = “Y”.

2. The OrderDtl record must not have a Kitting value of “P”.

3. The output temp table needs the CustID and name of the order’s customer.

All of these requirements can be consolidated into a single query using a JOIN operation:

for each OrderRel FIELDS(Company OrderNum OrderLine OrderRelNum ReqDate PartNum


WarehouseCode SelectForPicking ShipToNum SysRowID )
NO-LOCK where
OrderRel.Company = CUR-COMP and . . .[omitted the rest of the where clause],
EACH PartDtl FIELDS() NO-LOCK WHERE
PartDtl.Company = OrderRel.Company and
PartDtl.OrderNum = OrderRel.OrderNum and
PartDtl.OrderLine = OrderRel.OrderLine and
PartDtl.OrderRelNum = OrderRel.OrderRelNum and
PartDtl.RequirementFlag = YES,

EACH OrderDtl FIELDS() NO-LOCK WHERE


OrderDtl.Company = orderrel.Company and
OrderDtl.OrderNum = orderrel.OrderNum AND
OrderDtl.OrderLine = orderrel.OrderLine AND
OrderDtl.KitFlag &lt;&gt; “P”:U,

EACH OrderHed FIELDS() NO-LOCK WHERE


OrderHed.Company = orderrel.Company and
OrderHed.OrderNum = orderrel.OrderNum,

EACH Customer FIELDS(CustID Name) NO-LOCK WHERE


Customer.Company = OrderHed.Company and
Customer.CustNum = OrderHed.CustNum

ORDER BY OrderRel.Company BY OrderRel.OrderNum


BY OrderRel.OrderLine BY OrderRel.OrderRelNum:

When this query was first created for the Epicor application, it sent thousands of queries to the database server. However, now
through leveraging these inner joins, this code has drastically reduced that count to just one query. This technique is much more
efficient than nesting the PartDtl, OrderDtl, OrderHed, and Customer queries within the FOR EACH as separate queries.

Also note the use of the empty field list option (“FIELDS()”) on the PartDtl, OrderDtl, and OrderHed tables. This tells the database not
to bother returning any columns except those required to complete the join operation.

EPICOR SOFTWARE CORPORATION | 523


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

Consider a Sort Order

Consider including a sort order in the query. When tables are joined, SQL Server will collect rows in the most efficient way - leveraging
all the indexes together. In this situation, the code will not determine the sort order. If the order of the returned rows matters, like in
cases where a temp table is produced that returns to the client, make sure to specify a sort order.

Generally, you can do this by just using the columns and other items from the primary index of the outer-most table (the one in the
FOR EACH statement).

Use the EACH Statement

Joining tables is only more efficient when secondary tables are joined using the EACH statement. Progress allows joins using a FIRST
statement, but this will not run efficiently on SQL. So be aware of this situation if you use a FIRST statement in a join.

Use Correct Locking

Remember to use the correct locking hints throughout the query code. If you want a NO-LOCK query, you need to specify NO-LOCK
on each table in the query.

Deploy the Custom Action


When you have finished developing your custom action, you need to deploy it to the server. This section describes how you deploy
both a .NET Assembly and an ABL procedure.

.NET Assembly Deployment


Your .NET actions are within a compiled .dll assembly, for example AbcCodeAction.dll. To deploy this assembly, copy the .dll file from
the project output folder to the Actions subfolder within the BPMServer folder.

You can deploy .NET actions without restarting the BPMServer. The new version activates as soon as it overwrites the original
action assembly.

ABL Action Deployment


The ABL actions are in the procedure (.p or .r) file – for example AbcCodeAction.p or AbcCodeAction.r. To deploy the procedure, copy
the file to any subfolder within the BPM root folder on your Progress server. By default, the BPM folder is specified within the
PROPATH variable on the Progress server.

You can now use your custom action within your method directives.

Attach the Custom Action


Lastly, to use your custom action within a method directive, you must create an action that references it. You do this differently
depending on whether this action is a .NET or an ABL action.

Attach a .NET Action


First create a method directive as described in the Method Directives section within Chapter 11: Business Process Management. After
you have created the processes and the conditions you need, you must reference your .NET custom action by creating another action.

524 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

To attach a .NET action:

1. Click the Actions button.

2. The Actions 2
window displays. 3

3. Click the New button.

4. In the User Text field, select


Synchronously invoke .NET 5 4
method don’t queue
record nothing.

5. Click the method link.

6. The .NET Action 6


proxy builder
window displays. 7
8 9
10
7. Enter the .NET Method. 12
11
This method is the URL that 13
defines the server, assembly, 14
class, and method for the
action logic. To do this, use
the following syntax:

{tcp | http}://{BPMServer’s host name}:{port}/{assembly file name including


extension}/{namespace}.{class}[.{method}()]

The following is an example of this URL:

tcp://bpmserver:2010/AbcCodeAction.dll/Bpm.Custom.AbcCode.OnAfterGetRows()

8. If you do not know the location of the method, click the Browse button to find and select it.

9. The Validate button indicates whether the URL is in the correct syntax.

EPICOR SOFTWARE CORPORATION | 525


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

10. If you need, select the Asynchronous check box. This indicates this When an action runs asynchronously, BPM saves all
action can run asynchronously from the condition statement call which the information that defines the action – like the URL
initiated the action. This can occur when the condition statement call and the parameter values – within a queue. The
does not modify any of its parameters or when it does not require that application then executes the method without
the transaction be suspended while it runs. waiting for the action to begin and complete. .NET
actions can be queued both on the Progress server
11. The Queuing Mode indicates how the application queues calls to this using the BPM Async Processor, and the .NET server
action. Available options: by the BPMServer. For more information, read the
Asynchronous Action Overview and the Monitoring
• .NET Asynchronous Actions topics within application help.

• Progress

• Both

12. If you need, select the Call check box within the Record section.
For more details about using the Bpm/playCall.p
This indicates you will record all the calls to this action. This recording
procedure and troubleshooting custom .NET actions,
can be replayed using the Bpm/playCall.p procedure. Use this
read the .NET Action Implementation Details,
procedure to review and correct any issues that occur with your custom
Troubleshooting .NET Actions, and Recording and
.NET action.
Playing Calls topics within application help.
13. If you need, select the Return check box within the Record section.
This indicates you will also trace all return values generated by this
action to the Bpm/playCall.p procedure.

14. Click OK. This both validates the URL and exits the program.

Attach an ABL Action


First create a method directive as described in the Method Directives section within Chapter 11: Business Process Management. After
you have created the processes and the conditions you need, you must reference your ABL custom action by creating another action.

To attach an ABL action:

1. Click the Actions button.

526 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

2
2. The Actions
window displays. 3

3. Click the New button.

4. In the User Text field, select:


Synchronously execute ABL 5 4
code… record nothing.

5. Click the code link.

6. The ABL Action 6


window displays.

7. The top section of this 7


window displays the
ABL procedure.

8. If you want to enter the ABL


code manually, select the
Execute code below
radio button. 8 10 11

12 13
15 14

9. The Code field below activates (this activation is not displayed in this
If you use the Execute code below option, do not
example; see the ABL case study later to review this functionality).
put in procedure declarations or try/catch macros in
Use this text box to enter your ABL statements in the text box.
your code. These declarations are automatically
added to the action by the BPM functionality. For
10. If you want to link this action to the code you created in the ABL
more information on manually entering ABL
programming environment, select the Forward to procedure
statements, read the Attaching the Action to
radio button.
a Method topic within application help.
4

EPICOR SOFTWARE CORPORATION | 527


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

11. Enter the URL path to this procedure in the accompanying field. Use the The action file you select must contain the following
following syntax: files: {manager/Exception.i &TO_LOG} and
[subfolder of BPM/]{action procedure
{bo/BOName_ds.i} The BOName value is the name of
file}.p\{internal procedure name which
the business object to which this custom action is
corresponds to the action}
attached. For more information on selecting an ABL
procedure, read the Attaching the Action to a
Method topic within application help.
In this example, you enter the following URL path:

MyActions/AbcCodeAction.p/GetRowsAfter

12. If you need, select the Call check box in the Record section. This causes
Use the Bpm/playCall.p procedure to troubleshoot
the BPM functionality to trace all calls to this procedure. This recording
and correct ABL actions at a more convenient time –
can be replayed using the Bpm/playCall.p procedure.
like after business hours. For more details on how to
review the calls and returns generated through these
13. If you need, select the Return check box in the Record section. This
check box options, read the Recording and Playing
indicates you will also trace all return values generated by this action to
Calls topic within application help.
the Bpm/playCall.p procedure.

14. Click the Validate button to verify the ABL procedure works properly.

15. When you finish, click OK.

The custom ABL procedure is now attached to your action.

BPM Data Form Designer


Use the BPM Data Form Designer program to create custom forms you can then launch through BPM method directives. You launch
these custom forms by leveraging the “Call the named BPM Data Form using no customization always” action within a directive.

You can create everything from simple forms which contain text and two buttons (for example, Abort and Continue) to complex forms
which include entry fields that update your database. BPM data forms capture data or button actions in order to control a specific
BPM processing directive. Use this functionality to either conditionally display a form or capture the data required against a
specific transaction.

When a custom BPM Data form displays, the directive pauses until the user enters the required data or clicks the appropriate button.
Note, however, the method call is still active on the server. When the user completes the requirements on the BPM custom form, the
call is sent to the server again, but this time it skips all the actions it previously ran.

Create a BPM Data Form


Main Menu Path: System Management > Business Process Management > Setup > BPM Data Form Designer

To create a new BPM data form:


1
1. Click the New button on the
Standard toolbar.
6
2. Enter a unique ID for the form.

3. To view or edit an existing form, click 3 2


the Form ID button. 4
4. Add a Form Title; this text becomes 5
the title which displays on the BPM
form. You can add links to field
content within CallContext tables.
Before the BPM custom form displays,
this data is pulled from the field
content and is shown as text within the BPM form.

528 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

5. Optionally add Form Text that details the purpose of the form and any instructions required to use it. You can add links to
content of fields in CallContext tables. Before the BPM custom form displays, this data is pulled from the field content and is
shown as text within the BPM form.

6. Click Save.

Add Controls to the Form


Use the Fields and Buttons sheets to add controls to the form.

To add fields and buttons:

1. Click the Fields tab.


2
2. Click the Down Arrow
next to the New button.
3 1
3. Select which type of field to
create. In this example,
choose New Field. A new
row is created on the Fields
sheet; use this row to enter
details about the new field.

4. Select which BPM data table


Field is used to store
information entered into the
form. Each field can use one
of the twenty user-
definable fields. These fields 5 6 7 8 9
are available for the following
data types: character, number,
date, check box,
and shortchar. 4

5. The Field Label is the text


that displays before the field.

6. The Field Format controls the


number and format of the
characters entered into the
field. You can edit this value
for character, number, and 10
shortchar fields.

7. Optionally, select the


Mandatory check box to
require users to complete the
field before they can exit the
BPM data custom form.

EPICOR SOFTWARE CORPORATION | 529


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

8. Use the Default field to specify a value that displays in the field automatically when the form launches. If needed, the user can
change this value.

9. The Order field indicates where the field displays on the form. Higher numbered fields appear after lower numbered fields.
The application automatically increments this field by 10 for each field you add in the order that you add them.

10. Different field types, such as radio buttons, require you define which Field Values options are available. Enter these options in
the Field Values grid.

11. Leverage the New Password


field to control user access to
the custom form. Before the
directive can continue, users
must enter the password
value on the custom form.
This password can be a
phrase or a user logon. This
password value is stored 11
within the action.

12. Every form automatically


includes an OK button by
default. You can remove this
button or add additional
buttons to meet your 13 14
requirements. The form must
have at least one button.

13. Click Save on the


Standard toolbar.

14. To test how your BPM data 12


form displays in run mode,
click the Actions menu
and select Test BPM Data
Form. The custom BPM If different directives launch from different buttons
form displays. on the BPM custom form, test the ButtonValue field
within the BPMData table. This value matches the
Button sequence ID value from the Buttons tab.
A “-1” value indicates that the BPM custom form
was closed either by pressing the <Alt>+<F4> keys
or by clicking the Windows Close button (usually
found in the upper right on most windows).

530 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

Use the Data Form in a BPM Directive


Once the form is complete, you can call it from a method directive using the “Call the named BPM Data Form using no customization
always” action. The form data is available for use within other directive actions or custom code from the ttCallContextBpmData
temporary table.

To use the form in a directive:

1. In the Method Directives program,


create a method directive. In this
example, the method is
Customer.Update and the directive
type is post-processing. 1

2. Enter a Directive Name.


2
3. Optionally click the Conditions
button to set any conditions.

4. Click the Actions button.


3

CHAPTER 8 | BUSINESS PROCESS


MANAGEMENT
5. The Actions window displays. 5
6
6. Click the New button
on the toolbar.

7. In the User Text field, select Call the


named BPM Data Form using no 8 7
customization always.

8. Click the named link.

9. The Select BPM Data Form 9


program displays.
10
10. Select the BPM data form that
you want to use.
11
11. Click OK.

12. The name of the selected data form


displays in the action.

By configuring this action, you specify the


data form you created displays when the
specified conditions are met. You can now
use the data from the BPM data form in 12
other actions within the same directive.

EPICOR SOFTWARE CORPORATION | 531


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

To use data from the data form in the same directive:

1. Click the New button on the 1


toolbar to add another action.

2. In the User Text field, select send


e-mail asynchronously based on the
designed template.
3 4 2
3. Optionally click the asynchronously
link to change the setting
to synchronously.

4. Click the designed link.


5
5. The Design E-mail Template
program displays.
6
6. In the Name field, enter an appropriate
name for the e-mail template.
7
7. In the From field, enter
an e-mail address.

8. In the To field, right-click and select


Field Query.
8

9. The Select Table Field(s) program


displays. In the Name field, enter a
name for the temporary table query. 9

10. In the Table field, select


ttCallContextBPMData. This is the 10
temporary table that holds the data
entered in the BPM data
form at runtime. 11

11. Select the Added records and


Updated records check boxes to
indicate you want to use data when
the RowMod field in the temporary
table is set to either ‘A’ or ‘U’.
12
12. In the Fields grid, select the field used
on the BPM data form to hold the data
you want to query. In this example, the
e-mail address field is assigned 13
to Character01.

13. Click OK.

532 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

14. Enter text and use additional field


queries to complete the Subject and
body of the e-mail.

15. Click OK.

14

15

16. The name of the e-mail


template displays in the
second action.

16

17. When the directive executes,


the first action displays the
BPM data form, which the
user leverages to enter
additional information
required by the directive.

17

EPICOR SOFTWARE CORPORATION | 533


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

18. After a user enters data in the BPM


form, the next action runs. In this
18
example, an e-mail notification
is sent to the specified manager.

Case Study
This section of the chapter explores a step-by-step case study of a custom BPM directive. Use this as an example for your own custom
BPM directives.

Conditional Data Modification in ABL Code


BPM can conditionally modify data as it passes in and out of the server code. You can do this by creating a custom program within
ABL Code.

For this case study, you modify the Sales Order Line Entry method to verify the On-Hand Quantity for each inventory part – and check
for substitutes if the On-Hand Quantity in the primary warehouse is less than or equal to zero. If a default substitute part is available,
it is selected in place of the entered part. If there is no default, the first available substitute part is used.

Create the Method Directive

To create the method directive that launches the ABL code:

1. Launch the Method 1


Directives program. 3 2

2. For the new method, click the 6


Search button to find and select 4
the SalesOrder.ChangePartNum
business method. 5

3. Click the Down Arrow next to the


New button.

4. Select New Pre-Processing.

5. Enter the Directive Name for the


pre-processing directive. In this
example, you enter Check
for Substitute Part.

6. Click Save on the Standard toolbar.


CHAPTER

534 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

No Condition Needed

You do not need to create a condition statement for this directive. When you do not define a condition, the directive just executes
each time its method is called – in this case, the SalesOrder.ChangePartNum method. This causes the custom ABL code to run
automatically with the method.

Define the Method Action

You now must define the ABL action that runs each time this directive activates. Here’s how you create this action:

1. Click the Actions button.

2. Click the New button 9


on the toolbar. 2

3. In the User Text field, select


synchronously execute ABL code
record nothing. 11 10 4 3

4. Click the code link.


BUSINESS PROCESS MANAGEMENT |
CHAPTER 83
5. The ABL Action window displays. 5

6. Select the Execute code


below radio button.

EPICOR SOFTWARE CORPORATION | 535


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

7. The large text box becomes active. Enter the following code:

find first ttorderdtl where ttorderdtl.RowMod = ‘A’ or ttorderdtl.RowMod = ‘U’ no-error.


if available ttorderdtl then do:
find first part where part.Company = ttorderdtl.Company and part.PartNum =
ttorderdtl.PartNum no-lock no-error.
if not available Part then return.
/* We have an inventory part */
/* Next find the Primary warehouse for the current plant and get on-hand Quantity */
find partplant where PartPlant.Company = ttOrderDtl.Company and PartPlant.Plant = CUR-PLANT
and PartPlant.PartNum = ttorderdtl.PartNum no-lock no-error.
if available PartPlant then do:
find PartWhse
where PartWhse.Company = Part.Company
and PartWhse.PartNum = Part.PartNum
and PartWhse.WarehouseCode = PartPlant.PrimWhse no-lock no-error.
if available PartWhse then do:
assign ttOrderDtl.OnHandQuantity = PartWhse.OnHandQty.
end.
end.
/* Now replace with Substitutes if no On-Hand for entered part */
if ttorderdtl.OnHandQuantity <= 0 then do:
if available part then do:
if part.SubPart NE “” then do:
ttorderdtl.PartNum = part.SubPart.
end.
if part.SubPart = “” then do:
find first partsubs where partsubs.Company = ttorderdtl.Company and partsubs.PartNum =
ttorderdtl.PartNum no-lock no-error.
if available partsubs then do:
ttorderdtl.PartNum = partsubs.SubPart.
end.
end.
end.
end.
end.

8. Click OK.
CHAPTER 8 | BUSINESS PROCESS MANAGEMENT
9. You return to the Actions window.

10. This action has to be synchronous in order to run. Before you exit the Actions window, make sure that it is set up to
synchronously execute ABL code.

11. Click OK to exit this window.

Enable the Directive

You now must enable and save the directive. Here’s how:
1
1. You return to the Method
Directives window.

2. Select the Enabled check box. 3


3. Click Save on the Standard toolbar.
BUSINESS PROCESS M 2

536 | EPICOR SOFTWARE CORPORATION


CUSTOM BUSINESS PROCESS MANAGEMENT | CHAPTER 12

Test the Directive

You can now test the directive by creating a sales order line for a part that does not have any stock. In this example, part BPM1000 is
used because it does not have a stock quantity value. This part record also has a substitute part, 1032FW, that is used instead.

To test the directive:

1. Launch Sales Order


2
Entry to create a new
sales order. Follow this
menu path: Order
3
Management > General
Operations > Order Entry.
1
2. Click the Down Arrow
next to the New button.

3. Select New Line.

4. Navigate to the Lines >


Detail sheet.

5. Click the Part/Rev… button.


4

EPICOR SOFTWARE CORPORATION | 537


CHAPTER 12 | CUSTOM BUSINESS PROCESS MANAGEMENT

6. The Part Search 6


window displays.

7. Enter a Starting At value.


For this example, you
enter BPM. 8

8. Click Search.
7
9. Select the BPM 1000 part.

10. Click OK.

10

11. You return to the Lines >


Detail sheet.

12. Notice the substitute part,


1032FW, automatically 11
displays instead.
BUSINESS PROCESS 12
MANAGEMENT | CHAPTER

538 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT UTILITIES | CHAPTER 13

Chapter 13
Business Process
Management Utilities

Various utilities are available in the Business Process Management (BPM) module to help you:

• Set up a schedule to run directives.

• Export directives so they can be used in another Epicor installation.

• Import directives from another Epicor installation.

• Update a group of directives to apply new settings or to keep directives up-to-date when a new version of Epicor
is installed.

This chapter explains how to use the Action Process program to set up a schedule for BPM processes and how to
troubleshoot issues that may occur. It also explains how to use the Directive Import and Export programs, which are useful for
moving groups of directives between Epicor installations. Lastly, it shows how to use the Directive Update program to apply
settings to a group of directives or to ensure directives remain compatible with new versions of the Epicor application.

EPICOR SOFTWARE CORPORATION | 539


CHAPTER 13 | BUSINESS PROCESS MANAGEMENT UTILITIES

Action Processing
When you have defined the method directives your application will run, you are ready to set up the action process schedule.
This regular schedule causes the BPM functionality to run periodically, updating the BPM task queue and processing asynchronous
method directives.

You do this by setting up the BPM Process task to run on a recurring schedule. To do this, you first create the schedule you want.
You then set up the process to run using this schedule.

System Agent
You create recurring schedules through System Agent Maintenance. Use this
To learn about creating new schedules within
program to create the different schedules you need for running your method
the System Agent, review Chapter 1:
directives. When you have created the schedules you need, you are ready to
Automatic Data Processing.
launch the BPM Action Process program; the next section explains how to run
this program.

BPM Action Process


Use the BPM Action Process to set up a task that updates all the BPM calls, and processes asynchronous method directives within
the application.

You can set up this task to run on a recurring schedule. This automatically To learn more about how the BPM functionality
processes all calls made by your method directives. processes asynchronous actions, read the BPM Async
Processor topic within application help.

Main Menu Path: System Management > Business Process Management > General Operations > Action Process
CHAPTER 8 | BUSINESS PROCESS MANAGEMENT
You can define how often you want this process to run. Here’s how:

1. If you want this process to


constantly run, select the
Continuous Processing
check box. This causes this
task to be automatically 6
added to the Startup Task
Schedule, and it activates
each time the 1
application launches.
2
2. To complete setting up 3 5
continuous processing, you
next must enter the 4
Continuous Processing
Delay value. The BPM Process
runs following the time value
you enter. For example, you
can enter a delay of two
minutes – which means this
process runs continuously every two minutes.

3. The Log Filename displays the directory path and log file that records the asynchronous processing actions. You can enter this
path directly or click the Log Filename button to find and select it.

4. However, if you want this process to run following a schedule, select a Schedule option from the list. Epicor recommends that
you select an Interval schedule type, as this schedule then runs every few minutes. To learn how to create schedules, review
Chapter 1: Automatic Data Processing.

540 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT UTILITIES | CHAPTER 13

5. Select the Recurring check box to indicate this process runs on a regular basis. The BPM process launches each time the system
clock passes the interval defined within the selected schedule.

6. Click the Submit button.

Your BPM method directives are now regularly processed by the application.

Troubleshooting Actions
Tools are available to help you further troubleshoot your actions – the BPM
More information about these tools is available
Server Action Log, the BPM Async Processor Log, and the BP Monitor. This
within application help. To learn about using the
section describes how these tools can help you correct issues with
BPM Server Action Log and the BP Monitor, review
your actions.
the Troubleshooting .NET Actions topic. To learn
about using the BPM Async Processor Log, review
the BPM Async Processor topic.

BPM Server Action Log

A good place to start troubleshooting .NET actions, including asynchronous actions, is through the BPMServer Action Log. Exceptions
caused by .NET actions are recorded in this file. Typically this action log is found in the Epicor > BPMServer > Logs directory.

BPM Async Processor Log

If you are running any asynchronous actions, you can use the BPM Async Processor Log to review each asynchronous action. This log is
also typically found in the Epicor > BPMServer > Logs directory. It lists the following information about each action:

• Async action type (.NetActionType, ABLActionType, or other)

• Startup timestamp

• Error message (if an issue occurs)

• Completion timestamp
BUSINESS PROCESS MANAGEMENT | CHAPTER 8
BP Monitor

If you cannot find the reason for the issue after you review the logs, check to see if the action is called by the application. To do this,
use the BP Monitor tool. This tool is found on the BPM Server machine by using the Start button. It is found under the Programs and
BPM menus.

Use the BP Monitor to attach the action to a business method. You can then view calls either placed or not placed by the action. You
now have the details you need about any issues with the action's calls.

Directive Management
To complete the BPM functionality, the module comes with programs that help manage your directives. You can export your directives
out to another Epicor installation, where they can then be imported. You can also update the directives to make them compatible with
the current version of the application.

Groups
This functionality requires you use Groups. Each group contains related directives. By placing related directives together, you can easily
export, import, and update the directives as you need.

You create and select groups within the Method Directives, Data Directives, or Updatable BAQ Method Directives programs. The
Pre-Processing > Detail, Base Processing > Detail, and Post-Processing > Detail sheets all have a Group field. Use this field to create
new groups or to select existing groups. In either case, you define the group which the directive is placed inside for use in later
processes. For more information, read the Method Directives section in Chapter 11: Business Process Management.

EPICOR SOFTWARE CORPORATION | 541


CHAPTER 13 | BUSINESS PROCESS MANAGEMENT UTILITIES

Directive Export
Use the Directive Export program to export all the directives that belong to a selected group. These directives are then exported
to a single file at a location you define, so you can move your method directives to another installation of the application.

Main Menu Path: System Management > Business Process Management > General Operations > Directive Export

Here’s how you use this program to export a group of method directives:

1. Select the Group of directives to export. All the current


groups display within this list. You create groups
and assign methods to them within the
Method Directives program.

2. Enter the File Name for the exported file. This filename is
the source path for the exported directive. You can enter
the directory path and filename directly in this field, or 1
click the File Name button to find and select it.
2
The default filename is Export.bpm, but you can change
this name if you need. Do not, however, change the .bpm 3
file extension name. This file extension name is required
by the application.

3. Now click the Export button. Select the directory path


where you want to place the exported file.

Directive Import
Use the Directive Import program to import a group of exported method directives into your application.

Main Menu Path: System Management > Business Process Management > General Operations > Directive Import

Here’s how you use this program to import a group of method directives:

1. Click the File Name button to find and select the


.bpm file you want to import.

2. Optionally, select the Group inside which you want to


add the directives. You can select an existing group or
enter a new name to create a new group.

3. Select the Replace Existing Group check box if you 1


want the import program to delete the directives in the 2
existing group and replace them with the imported
directives. If this check box is clear, the program 3
4
leaves the existing directives alone and then adds the
imported directives into the group.

Each Directive Name is used as a description value and


not as an identifier. If you clear the Replace Existing
Group check box during the import process, you may
have multiple directives with the same Directive Name.

4. Click the Import button to import the method directives into your application.

542 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT UTILITIES | CHAPTER 13

Import Compatibility

The import program also checks the compatibility of each imported directive. The following describes how this program checks the
compatibility of each directive:

• If the directives have the same version number as the current application, the directives are successfully imported.

• If the directives are from a previous version of the application, the import process validates all methods for compatibility. If any
incompatible directives are found, an error message displays. The incompatible directives are still imported; however, their status
is set to Out of Date.

• If the directives are from a newer version of the application, the imported directives are rejected and the application displays
an error message.

Directive Update
Use the Directive Update program to update the properties and recompile the directives within a selected group. You can run this
program to apply some primary options to all the group directives; for example, you can use this program to enable all the directives
in the group. You can also recompile the group directives to make them compatible with the current version of the application.

Main Menu Path: System Management > Business Process Management > General Operations > Directive Update
32
Update a Directive Group

Here is how you update a directive group:

1. Select the Group of directives you wish to update.

2. Select or enter the New Group inside which the updated


directives are placed. You can select an existing group from the
list – including the original group. You can also enter a new
group name in this field.

3. Select the Enabled check box to activate all the directives


within the group.
1
4. To make these directives available for all companies within the
application, select the Company Independent check box. 2
3
5. If you want to limit the instances of concurrent directives
4 7
and stop endless loops from occurring for all directives,
select the Prevent Endless Loops check box. This causes the
application to restrict the number of times these directives
can run. 5
6
6. Use the Reenter Max field to indicate how many times the
directives can run before the application stops them.

7. Either click the Update button, or click the Actions menu


and select Start Update. Your options are applied to all the
directives within the selected group.

EPICOR SOFTWARE CORPORATION | 543


CHAPTER 13 | BUSINESS PROCESS MANAGEMENT UTILITIES

Recompile a Directive Group

If you upgrade your Epicor application, method directives created within the previous version most likely become incompatible. If you
upgrade from 9.00 to 9.05, for example, your 9.00 directives are out-dated and cannot run within the 9.05 version.

Although you can fix each directive individually within the Method Directives program, you can instead recompile and fix most of the
directives within the selected group using the Directive Update program. If this functionality is unable to recompile a method directive,
however, it also displays a results log which indicates what is causing the recompile error.

To fix directives within the current group:

1. Click the Directive Recompile Setup tab.


2
2. Indicate which directives you want to recompile.
Available options:
1
• Outdated directives only – Runs the compile
against group directives created
within previous versions.

• Up-to-date directives only – Runs the compile


against group directives created 2
during the current version.

• Both outdated and up-to-date directives –


Runs the compile against all the directives
within the current group.

3. Either click the Start Recompile button, or click the


Actions menu and select Start Recompile. The
recompile process runs against the selected directives
within the group.
3

4
4. The Directives
recompile results
window displays. 5

5. If any directives could not


recompile, each recompile
error displays on a separate
row within the grid, detailing
the compile error. Notice in
this example, however, that all
the directives compiled
6
successfully and are now
compatible within the current
version of the application.

6. To exit the results window,


click Close.

544 | EPICOR SOFTWARE CORPORATION


BUSINESS PROCESS MANAGEMENT UTILITIES | CHAPTER 13

Tracing Log
Use the Tracing Log tool to set up a tracing log that captures all the calls the user interface makes to the server. When you activate
this log, any business logic (BL) calls sent to the server are automatically recorded within this log.

Run this log to fine-tune your BPM directives. You can use it to find out which business logic method calls are made. You can also find
out the duration of these business calls. Lastly, you can also see the data that is sent to and from the server.

To make this log easier to review, you can organize it by entering Mark Text; all
A pre-built .xml style sheet is included with this
calls that reference this mark text are then grouped together. You have the option
functionality. It is recommended that you use
to display this log either as a text (.txt) file or as an .xml file.
the .xml file format, as it organizes these calls in
1
a readable format.
You launch this program from the Main Menu. To do this:

1. Click the Options menu.

2. Select Tracing Options. 1


2

Tracing Log – How to Use

Here’s how you use the tracing log:

1. Use the Tracing 1


Options Form window to
define how the Tracing
Log captures the 2 3 4
BL calls.
5 7
2. Select the Enable 6
Trace Logging check
box to activate the Tracing
Log. All calls made by the user 8
interface to the server are
automatically recorded within 9
the tracing log.
10

11 12 13

EPICOR SOFTWARE CORPORATION | 545


CHAPTER 13 | BUSINESS PROCESS MANAGEMENT UTILITIES

3. Select the Write Full DataSet check box if you want to record all data within the tracing log. If this option is not selected, only
header information is stored within the log.

4. Select the Track Changes Only check box if you only want changes to the dataset recorded within the tracing log. All changes
to columns in the dataset are then stored within the log.

5. Use the Write Call Context Dataset check box to include Business Process Management (BPM) table values on the trace log.
This information provides the data context for a call each time a call is sent between the client and the server. This information is
useful for developing BPM method directives, as you can intercept these calls to run additional processing to verify data and
other custom functions.

6. The Current Log File displays the directory path and filename of the tracing log.

7. Click the View button to display the log within a .txt format.

8. Enter Mark Text to organize the tracing log so it is easier to review. To use this field, enter the text you need and then click
the Write button. All the calls that reference this mark text are grouped together within the same section of the tracing log, for
example, abccode lookup.

9. The XML File field displays the directory path and filename used for the .xml version of the tracing log. Click the Browse
button to find and select this directory path and filename.

10. Click the Create XML button to save the tracing log in the default .xml format. This file can then be viewed within any web
browser. The Mark Text values you enter for this log also appear as options on the .xml file.

11. To remove all entries from the tracing log, click the Clear Log button.

12. To add all these current settings to the tracing log, click the Apply button.

13. To exit the Tracing Options Form window, click OK.

546 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

Chapter 14
Security

You can first restrict access to various parts of the Main Menu through run time arguments. By adding a Menu ID run time
argument to a desktop icon, the Epicor application will only display the programs available under this specific Menu ID.

You define internal security for your application through two key programs. First, use Security Group Maintenance to create
the security groups you need. Then assign all users within your application to these security groups through User Account
Maintenance.

With security groups and their selected users defined, you can then assign security privileges throughout the application. For
example, you may want to prevent access to Payroll programs for most users. You can use the security privilege tools to only
give members of the Payroll security group access to these programs.

You set up security privileges through three maintenance programs. Menu Maintenance can prevent programs from being
displayed for specific security groups and users. To block access to a program or program function (like updating records)
from wherever it can be launched, use Process Security Maintenance. You can also block or limit access to a specific field by
using Field Security Maintenance.

To review security settings and user activity, run various reports and launch the System Activity Log. The Menu Security report
displays the current access rights specific users and security groups have on the Main Menu. Other reports are available that
display user activity, so run these reports to verify the security settings work as expected. The System Activity Log tracks
database modification activity within the application; use this tracker to review the database activity for a specific user, table,
date, and so on.

EPICOR SOFTWARE CORPORATION | 547


CHAPTER 14 | SECURITY

Run Time Argument Menu Control


Each workstation can have a number of desktop icons available for launching the Epicor application. Each desktop icon can in turn be
set up to launch the Epicor application in a specific mode. These modes, or run time arguments, activate immediately when a user
double-clicks the program icon.

You can use the “/ menuid” run time argument to cause the Main Menu to only display a specific sub-menu or a specific program.
The user who launches the Epicor application using this icon is then limited to the programs accessible within either the menu or the
specific program. This feature is an effective way to quickly set up a level of security on workstations.

You can also use the /TE and /CRM run time arguments to set up unique concurrent user licenses. The /TE argument limits the Main
Menu to display only the Time and Expense functionality, while the /CRM argument limits the Main Menu to display the Customer
Relationship Management functionality. These unique licenses consume a different concurrent user pool. Activate these licenses either
when you want to limit a workstation to display only these specific functions or when you want to set up additional licenses separate
from the general user pool.

To leverage this feature, you display the Properties window for the Epicor icon and then modify the Target field to include a menu ID.
You can find the specific menu identifier you need within Menu Maintenance. This program is described later within this chapter.

For this example, to limit a workstation to only display programs in the CRM module:

1. On the desktop for the workstation, right-click the application’s icon. 1

2. A context menu displays. Select the Properties option.

3. The application’s Properties window appears, displaying the Shortcut tab.


3
4. In the Target field, enter a [Space] after the target directory path.

Now enter the “-config“ run time argument and indicate which configuration
settings file the icon will use.

Next add a right slash (“/”) and enter the identifier for the menu or program
4
that you want to display. To restrict the workstation to display only the CRM
module, enter: C:\_Epicor\905client\MfgSys.exe -config=default.mfgsys
/menuid=CRMN0000

5. Click Apply.

6. Click OK.

6 5

548 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

7. Now when users launch the Epicor application on this workstation,


they will only see the CRM module on their Main Menu tree view.

This method may not limit access to all the programs you intend. Several
programs can still be launched by right-clicking various fields. For
example, users could still launch Part Maintenance from the Part field’s 7
context menu. You will need to use other security methods described
later in this chapter to restrict access to the programs available on context
menus.

Security Group Maintenance


Use Security Group Maintenance to define the security groups for your application. After creating the security groups that best fit your
organization, you can then assign specific users to these groups.

Main Menu Path: System Management > Security Maintenance > Security GroupER 14 | SECURITY

Create a Security Group

To create a new security group:

1. Click New on the Standard toolbar.


1
2. Enter the Group Code for your
new group. This defines the
4
identifier used for the security
group. In this example, you enter
PROD. 2
3. Now enter a Description for this 3
security code. This text displays
within the security programs, so enter a brief, concise If you place an underscore (_) or a period (.) in front of the Description,
explanation for the group in this field. In this example, the security group sorts to the top of the list in the security programs.
you enter _Production Staff. This makes the new security group much easier to find.
4. Click Save.

You have now created the Production Staff security group. Repeat these steps to create all the security groups you need.

EPICOR SOFTWARE CORPORATION | 549


CHAPTER 14 | SECURITY

User Account Maintenance


Launch User Account Maintenance to assign users to both security privileges and security groups. Epicor recommends you assign all
users to security groups. This simplifies your security setup, as you do not need to assign security to individual users. This approach also
ensures you implement security through an organized and clearly defined method.

The security functionality is flexible, as you can assign a single user to multiple security groups. The application handles any conflicts
between security groups through an access hierarchy. If a user is assigned to security group Engineering, which allows access to the
Engineering Workbench, and security group Purchasing, which does not, the user will still be able to launch the Engineering
Workbench. The security group with more access overrides the security group with less access. Likewise, if a user is assigned rights to a
program, but is assigned to a group which is not, the user is still able to launch the program.

User rights have precedence over group rights, and the Allow Access setting has precedence over the Disallow Access setting.

Main Menu Path: System Management > Security Maintenance > User SecurityITY | CHAPTER 14

Assign User Privileges

To assign user privileges on the Group sheet:

1. Click the User ID button to find


and select a specific user. In this
example, Fred Grandy is selected.

2. Optionally, you can limit what this


user sees on the Main Menu by 1
entering a value in the Client
Start Menu ID field. Enter a
menu identifier for either a sub-
menu or a program. When this
user launches the Epicor 2
application, only the contents
under the specific sub-menu
identifier or the specific program
display on the Main Menu. This
feature is similar to the run-time
arguments described in a previous
section. However, this feature
limits a user account to a specific menu. Whenever this
You can find the specific menu identifier you need within Menu
user logs into the application, regardless of the
Maintenance. This program is described later within this chapter.
workstation, this person can only access the menu you
define in this field.

3. Click the Options sheet.

4. If this user manages security, select the Security Be aware that it is a good business practice to not give yourself
Security Manager access on your normal user account. This ensures
Manager check box. Users with this security access can
the menu choices you make on your normal login are appropriate
define and change the profiles of themselves and other
for your typical daily routine. It also ensures that other employees
users. They can also access all security programs. do not grant security access to themselves when you are away from
your computer. Instead, create a separate Security Manager account
5. Use the Tools Options section to assign or prevent this
that you use for security tasks.
user from accessing various tools and functions
throughout the application. A number of check box options are here; select the options you want available to this user. For
example, if you select the Allow Personalization check box, Fred Grandy is able to personalize all programs he uses.

6. Use the Access Options section to allow or prevent this user from viewing information within a web browser, mobile device,
and enterprise-wide searches.

550 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

7. Use the System Options section


to allow or prevent this user 8
from running system-wide 3
capabilities such as company
annotations and adding favorites
icons to the Favorites bar. 4
6
Specific options are discussed in
other chapters throughout the
Epicor ICE Tools User Guide and
5
the Epicor ICE User Experience
and Customization Guide. To 7
learn about all the features
each option gives the current
user, refer to the specific
chapter. For a summarized list
of these options, review the
User Account Maintenance -
Options topic within the
application help.

8. When you finish assigning this


user’s security privileges, click
Save.

Assign User Groups

You assign user groups on the Group sheet:

1. Click the Group sheet.

2. The Available list displays all 1


security groups to which Fred
Grandy can be assigned. He is an
engineer, so you want to add him
to the Production Staff group.
Highlight this group from the list.
3
3. Click the Right Blue Arrow
button. 2

EPICOR SOFTWARE CORPORATION | 551


CHAPTER 14 | SECURITY

4. The Production Staff security


group now moves to the 8
Authorized list. Fred is now an
official member of this group.
4
5. To assign Fred to all the security
groups, click the Double Right
Blue Arrow button.
5
6. Notice you can also remove
security groups from the 6
Authorized list. You do this by
7
highlighting the group from this
list and then clicking the Left Blue
Arrow button.

7. To remove all the security groups


from the Authorized list, click the
Double Left Blue Arrow button.

8. When you finish assigning this user to security groups, click Save.

This user is now a member of one or more security groups. When you use this security group on a menu item, process, method, table,
or field, this user (and other users in the group) either has or does not have access to this item.

SECURITY | CHAPTER 14
Menu Maintenance
You use Menu Maintenance for two security functions. First you use this program to create Security Identifier (ID) records; you then
assign users and security groups to each Security ID record. Now when you select a Security ID record on a menu node or program,
only users/security groups assigned to this Security ID record can access the menu item/program.

Main Menu Path: System Management > Security Maintenance > Menu Maintenance

Create a Security ID

You create security IDs on the Security sheet. To create a new security ID:

1. Click the Down Arrow next to


the New button; select New
Security.
1
2. Enter the Security ID that you
want for this security level. In this 2
9
example, you enter UD78. The UD 3
prefix stands for user-defined. This
4
prefix value indicates this record is
a Security ID you have created. 5
7
6
3. Enter a Description that includes 8
the purpose for this security level.
In this example, you enter 10 11
Production Staff Engineering.

12 13

552 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

4. Select the Security Manager Access Only check box to indicate that only security managers can access programs assigned to
this security level. No other users are able to see these programs.

You should select this option only when you want this ID to override all other security settings. This option is useful when you
are first setting up security, as it blocks all access until you create a security plan. You indicate which users have security manager
rights within User Account Maintenance. Review the previous User Account Maintenance section for more information.

5. Select the Current Company Only check box to apply this security code against the Main Menu structure for the current
company. Only users with access through this security code can display and launch the programs within this company node, but
this security code is not applied against other companies. If the Current Company Only check box is not selected (check box is
clear), this security code is applied against all companies within your Epicor application.

For example, if security code SEC545 is defined for While you assign security, always remember the security hierarchy. If a
Company A and its Current Company Only check box user is assigned to two groups and one group has access to a program
is selected, only users with access can expand this while the other does not, the group with access has precedence and
company node and display its programs. This security the user can launch the program. The same is true when a user has
code does not affect other areas of the Main Menu. If access to a program while a security group does not; the user is still
security code SEC545 does not have its Current able to launch the program. Users are higher in the security hierarchy
Company Only check box selected, however, then this than groups, and groups with access are higher in the hierarchy over
level of security is applied against all companies within groups that do not have access.
the application.

6. The Disconnected check box indicates whether this Security ID is available to use with Mobile Connect; you can then connect
to your database through a mobile device. Only specific security IDs created by Epicor permit this feature, so you are not able to
select this check box on your new security ID.

7. To prevent users within this security group from launching the Epicor application within an internet browser, select the Exclude
Epicor Web Access check box.

8. If you have Localization Developer rights, the Country/group codes are typically implemented by Epicor or Epicor
Country/Group Code drop-down list displays. Use Partners. If you have a Country Specific Functionality license, you can
this list to select a country group code or country code manipulate these codes as well. However Epicor recommends you
for the security group; all codes assigned to the rarely use this functionality. However, any changes you make to an
current company display on this drop-down list. If you existing localization will be overwritten during the next upgrade.
select a code from this list, users assigned to this
security group will see all localized Main Menu programs linked to this country/group code, as well as any Main Menu programs
which do not have a country/group code assigned (null) to them.

For more information on the localization functionality, review the Localization chapter in the Epicor ICE User Experience and
Customization Guide.

9. The Menu Options field displays all the programs that currently use this security level. Because this record is a new security ID,
this field is blank. As you select this security ID for specific programs, this field displays the selected programs that use this
identifier.

10. Select the Allow Access to All Groups/Users check box to give everyone in the company access to programs that use this
security level.

11. To limit this program to specific users and/or groups, you first must clear the Allow Access to All Groups/Users check box. The
Groups/Users and Selected Groups/Users lists become active. However, until you add users and/or groups to the Selected
Groups/Users list, nobody has access through this security level. Be sure you are ready to assign security before you clear this
check box.

12. Highlight the specific group or user for which you want to give security access. In this example, you select the Production Staff
security group.

13. Click the Right Blue Arrow button.

EPICOR SOFTWARE CORPORATION | 553


CHAPTER 14 | SECURITY

14. The user or group displays on the


Selected Groups/Users list.

Any groups or users that


remain in the Groups/Users
list do not have access to the
programs assigned to this
security level.

15. Continue to use the Blue Arrow


Buttons to add and remove
users/groups from this security
level.
14

15

16. To prevent specific users/groups


from accessing this security level,
click the Disallow Access tab.
20
17. Select the Disallow Access to
All Groups/Users check box to
prevent everyone in the company
from accessing programs assigned
to this security level.

18. To disallow security access to


specific users and/or groups, you
first must clear the Disallow Access 16 17 18
to All Groups/Users check box. The
Groups/Users and Selected
Groups/Users lists become active.
Notice, however, that until you
add users and/or groups to the
Selected Groups/Users list,
everyone has access through this
19
security level. Be sure you are
ready to assign security before you
clear this check box.

Any groups or users that


remain in the Groups/Users list
have access to the programs
assigned to this security level.

19. Use the Blue Arrow Buttons to add and remove users/groups from this security level.

20. When you finish, click Save.

You can now select this Security ID on any program you need. You do this on the Menu Maintenance > Detail sheet.

554 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

Assign Menu Security

When you assign a Security ID to a selected program, only those users given access through this security level can launch the program.
If a security group (or user) is not included in the security ID, individuals in this group (or user) cannot launch this program from their
Main Menu.

To assign a Security ID to a specific program:

1. Click the Detail sheet.

2. In the Tree View, select the 1


program you want to secure. In
this example, you select the
Engineering Workbench.
3
If you change the security ID
for a standard menu item, this
ID reverts back to its original 2
security ID when you install the
next service pack. You should
either use this functionality
only for custom programs or be
prepared to reassign the menu
security IDs after a service pack
installation.

3. Click the Security ID button.

4. The Security Search window displays. 4


5. In the Starting At field, enter a value to filter your
search results. In this example, you enter UD. 6

6. Click Search.

7. From the Search Results grid, highlight the security ID 5


you want. In this example, you select UD78.

8. Click OK.

EPICOR SOFTWARE CORPORATION | 555


CHAPTER 14 | SECURITY

9. The Security ID field now displays


the new security level you have
selected.
12
10. Notice that a Country/Group
Code drop-down list displays on
this sheet as well. If this menu
item is restricted to only display for 9 10
security groups assigned to a
specific Country Group / Country
(CGC) code, select the code from
this list. Use this value together
with the security group CGC code
to restrict menu items you only
want to display for specific
localities.

For example, you have a localized


version of the Engineering
Workbench which you want to
11
display only for European Union
users. You first highlight the
Engineering Workbench node and
then click the Country / Group
drop-down list to select the EU
country group code. Now select a
Security Group which grants access to the EU country group code. Only users assigned to this security group code will be able to
view and launch this localized version of the program.

11. Notice the Web Access value indicates this program is Excluded from display within a web browser. Users will not be able to see
this node within the Epicor Web Access version of the application. You indicated this option on the security group by clicking the
Exclude Epicor Web Access check box.

12. Click Save.

This program is assigned to this security level. Continue to assign You can also use Menu Maintenance to add customizations and
security levels to the programs you need on the Main Menu. localizations to the Main Menu. These instructions are available in
the Epicor ICE User Experience and Customization Guide; review
the Customization Utilities and the Localization chapters.

Process Security Maintenance


Use Process Security Maintenance to define user access to both business objects (processes) and the methods within these business
objects. You can then block selected security groups and users from accessing specific functionality within the application.

For example, the Terms business object is located on the Main Menu in several locations; it can also be called from context menus
within various programs. If you want to completely prevent the Production Staff security group from launching this business object,
you can indicate this security group cannot access this program. Likewise, you may only want to prevent this security group from
updating Terms codes. In this situation, you would limit the access this security group has to the update method (BO.Terms.Update).

When a business object is secure, all methods within this business object are also secure. This can lead to unexpected results, as the
methods will not run through Service Connect, embedded processes, and from other menu options. Epicor recommends you assign
security in a test environment first before you deploy security within your live environment.

You define business object (process) security on the Process sheet; you define method security on the Method sheet.

Main Menu Path: System Management > Security Maintenance > Process SecurityTER 14 | SECURITY

556 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

Process (Business Object) Security

You define a business object’s security by first selecting it and then indicating which groups/users can and cannot access it.

To define process security:

1. Click the Down Arrow next to


the New button; select New
Object. 1

2. Now click the Process ID button 3


or the Search button (Binoculars) 2
on the Standard toolbar to find 4
and select the business object you
5
need. In this example, the
bo.AbcCode business object is 6
selected. 7 10
3. Notice that the name of this
8
business object displays in the
Description field.

4. To restrict this business object to 9


security managers, select the
Security Manager Access Only 11
check box. This indicates that only
12
users defined as Security
Managers within User Account
Maintenance are able to access
this business object. To learn how
to do this, review the previous User Account Maintenance section.

5. Select the Current Company Only check box to apply this security setting for the process against the current company.
However, this setting does not apply to this process in other companies. If the Current Company Only check box is not selected
(check box is clear), this security setting is applied to this process across all companies in your database.

6. The Disconnected check box indicates whether this business object is available to use with Mobile Connect. You can then
connect to your database through a mobile device. Only specific business objects permit this feature; if it does, this check box is
available.

7. Select the Allow Access to All Groups/Users check box to give everyone in the company access to this business object.

To only permit access to specific groups and users, however, clear this check box. Notice, however, that until you add users
and/or groups to the Selected Groups/Users list, no one has access to this business object. Be sure you are ready to assign
security before you clear this check box.

8. You can now define the specific groups and users that can use this business object. From the Groups/Users list, select a security
group or user.

9. Click the Right Blue Arrow button.

10. The security group or user now displays within the Selected Any groups or users that remain in the Groups/Users
Groups/Users list. Continue to add the groups and users you need. list do not have access to this business object.

11. To remove a group or user from the Selected Groups/Users list, highlight the group or user and click the Left Blue Arrow
button.

12. To remove all the groups and users, click the Double Left Blue Arrow button.

EPICOR SOFTWARE CORPORATION | 557


CHAPTER 14 | SECURITY

13. You can also prevent specific users


and groups from accessing this
business object. To do this,
20
click the Disallow Access tab.

14. To prevent all groups and users


from accessing this business
object, click the Disallow Access
to All Groups/Users check box.
13 14
However, to only prevent access
for specific groups and users, clear
this check box. Notice that until 15 17
you add users and/or groups to
the Selected Groups/Users list,
everyone has access to this 16
business object. Be sure you are
ready to assign security before you
18
clear this check box.
19
15. You can now define the specific
groups and users that cannot use
this business object. From the
Groups/Users list, select a security
group or user.

16. Click the Right Blue Arrow button.

17. The security group or user now displays within the Any groups or users that remain in the Groups/ Users list have access to
Selected Groups/Users list. Continue to add the this business object.
groups and users you need.

18. To remove a group or user from the Selected Groups/Users list, highlight the group or user and click the Left Blue Arrow
button. In this example, the _Production Staff security group displays in the Groups/Users list, so only this group has access to the
ABC code business object. Notice you can achieve the same result on the Allow Access and Disallow Access tabs; you just use a
different access condition.

19. To remove all the groups and users, click the Double Left Blue Arrow button.

20. When you finish, click Save.

Define Security for a Method

You can also use Process Security Maintenance to define Not all business objects have multiple methods. This sheet is only for
security for methods within a selected business object. A more complex business objects that perform a variety of actions. You
method is an action which can be run within a process can see all the methods contained in a business object by using the
like Update, Get New, Approve, and so on. For example, Adapter tab found within the Custom Object Explorer. For information
you can use this functionality to permit a user to add a on this program, use the Epicor ICE User Experience and Customization
release to an existing purchase order but prevent this Guide; review the Custom Object Explorer section within the Advanced
same user from creating a new purchase order. Customization chapter. For a complete list of business objects and their
methods, use the Business Object Reference Guide. This .pdf guide is
available for download on EPICWeb.

558 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

To define security for a selected method:

1. Click the Down Arrow next to


the New button; select New
Method. 2
1
2. The Method sheet becomes
3
active.

3. Select the Method Name from 4


the drop-down list. In this 5
example, the GetRows in 6 7
bo.AbcCode method is selected.

4. To restrict this method to security 8


managers, select the Security
Manager Access Only check box.
This indicates that only users
defined as Security Managers 9 10
within User Account
Maintenance are able to access 11
this method. To learn how to do
12
this, read the previous User
Account Maintenance section.

5. Select the Current Company


Only check box to apply this
security setting for this method against the current company. However, this setting does not apply to this process in other
companies. If the Current Company Only check box is not selected (check box is clear), this security setting is applied to this
method across all companies in your database.

6. The Disconnected check box indicates whether this method is available to use with Mobile Connect; you can then connect to
your database through a mobile device. Only specific methods permit this feature; if it does, this check box is available.

7. Select the Allow Access to All Groups/Users check box to give everyone in the company access to this method.

However, to only permit access to specific groups and users, clear this check box. Notice that until you add users and/or groups
to the Selected Groups/Users list, nobody has access to this method. Be sure you are ready to assign security before you clear
this check box.

8. You can now define the specific groups and users who can use this method. From the Groups/Users list, select a security group
or user.

9. Click the Right Blue Arrow button.

10. The security group or user now displays within the Selected Groups/Users Any groups or users that remain in the Groups/
list. Continue to add the groups and users you need. Users list do not have access to this method.
11. To remove a group or user from the Selected Groups/Users list, highlight the
group or user and click the Left Blue Arrow button.

12. To remove all the groups and users, click the Double Left Blue Arrow button.

EPICOR SOFTWARE CORPORATION | 559


CHAPTER 14 | SECURITY

13. You can also prevent specific users


and groups from accessing this
method. To do this, click the
Disallow Access tab. 20

14. To prevent all groups and users


from accessing this method, click
the Disallow Access to All
Groups/Users check box.
13
However, to only prevent access
14
for specific groups and users, clear
17
this check box. Notice that until
15
you add users and/or groups to
the Selected Groups/Users list,
everyone has access to this
16
business object. Be sure you are
ready to assign security before you
clear this check box. 18
19
15. You can now define the specific
groups and users that cannot use
this method. From the
Groups/Users list, select a security
group or user.

16. Click the Right Blue Arrow button.

17. The security group or user now displays within the Selected Any groups or users that remain in the Groups/Users
Groups/Users list. Continue to add the groups and users you need. list have access to this method.

18. To remove a group or user from the Selected Groups/Users list, highlight the group or user and click the Left Blue Arrow
button. In this example, the _Production Staff security group displays in the Groups/Users list, so only this group has access to the
GetRows method. Notice you can achieve the same result on the Allow Access and Disallow Access tabs; you just use a different
access condition.

19. To remove all the groups and users, click the Double Left Blue Arrow button.

20. When you finish, click Save.

Field Security Maintenance


Use Field Security Maintenance to define security privileges at the field level. You use this program to first select either a database table
or an extended user defined table and then allow, limit, or prevent access to specific fields within the selected table. Each field can
have a unique security level assigned to it; this level can be globally defined for the whole organization, specifically defined for the
current company, or specifically defined for a selected user or group.

Main Menu Path: System Management > Security Maintenance > Field Security

560 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

Assign Global Field Security

You can assign security to a specific field that then applies to the entire organization or a specific company.

To assign field level security:

1. Click the Table button to find and


select the database table which 9
contains the fields you need to
secure. For this example, the
1
CallType table is selected. 3
2
2. The Description field displays the
purpose of the selected table.

3. In the Tree View, select the 4 5


specific field for which you want
6
to define security. For this
example, the CallTypeDesc field is
7
selected. Notice that this field is
the Description field in Call Type 8
Maintenance.

4. The Field Name displays the


name of the selected field.

5. If the Primary Key check box is


selected, it indicates the current
field is required by the database. You cannot change the security option for a Primary Key field; usually these fields are for
identifiers like the customer ID, part ID, and so on. The CallTypeDesc field is not a primary key, however, so for this example, the
check box is clear.

6. The Description field displays the purpose of the field.

7. Click the Access drop-down list to define the security option for the current field. Available options:

• Full – Users can both view and enter data within this field. This security option is the default.

• Read – This option assigns display-only (read-only) rights to the current field. Users can only view data within this field; users
cannot enter any data within it.

• None – This security option causes the field to be blank. No data displays in this field, and users cannot enter any data in it.
Be aware that the None setting also causes the field’s data to not be included when the dataset is sent to and from its
program. This can have unintended consequences for processes, like BPM directives, which may require this data.

8. If you want this security level to only apply to the company you are Depending on whether you select the Current Company
currently logged into, select the Current Company Only check box. Only check box, the security option you select on the
If you keep this check box clear, the security level you define for this Access drop-down list is either applied against the entire
field is used globally throughout your organization. organization or the current company.
9. When you finish, click Save.

EPICOR SOFTWARE CORPORATION | 561


CHAPTER 14 | SECURITY

Group and User Field Security

You can also assign security to a field that only applies to a specific user or security group. To assign field security for a user/group:

1. Click the Table button to find and


select the database table which
contains the fields you need to
secure.
1
2. Click the Users/Groups tab.
2

3. Select the user or security group


for which you want to define
security. In this example, you select
the user Aaron Christiansen.

4. In the Tree View, select the


specific field for which you want
to define security. For this
example, you select the
ShortChar02 custom field. 3 5
Custom fields are special fields
you can add to a customized
form; users then enter unique
data within these fields. For
more information about custom 4
fields, review the Customization
Utilities chapter within the
Epicor ICE User Experience and
Customization Guide.

5. Click the Access column to display the drop-down list. Once again you have the Full, Read, and None security options. You also
have the Default option; select this option when you want the user or security group to use the global security level assigned for
this field on the Detail sheet. For this example, you select the Full option.

562 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

6. Continue to define security for this


user by selecting other fields from
the Tree View. In this example, you
select the ShortChar03 custom
field.

7. You want to give Aaron read-only


rights to this field. Click the Access
column and select the Read
security option.
7

8. Lastly, you want to prevent Aaron


from seeing any data displayed in
the ShortChar04 field. Select
10
this field on the Tree View.

9. Click the Access column and select


the None security option.

10. When you finish, click Save.

Use Field Security

Now that you have defined field security for Aaron for the CallType table, you can see the security options in action. To do this, you
first navigate to Call Type Maintenance.

Main Menu Path: Sales Management > Customer Relationship Management > Setup > Call Type

EPICOR SOFTWARE CORPORATION | 563


CHAPTER 14 | SECURITY

For this example, Call Type Maintenance was customized to display the ShortChar01, ShortChar02, and ShortChar03 custom fields.
These fields, and their accompanying labels, were added using the customization tools. To learn how to customize a program, review
the Epicor ICE User Experience and Customization Guide.

1. The Call Type Maintenance 1


customization displays. Notice
that for this illustration, the 7
program is launched by a 6
user with full security rights.

2. In this example, the MRKTNG call


type is selected.
2
3. Notice the three custom fields are
available (Full rights) for data entry.
The Full field is the ShortChar01 3
custom field from the CallType 4
table. Enter Primary.
5
4. The Read Only field is the
ShortChar02 custom field from the
CallType table. Enter Primary.

5. The None field is the ShortChar03


custom field from the CallType
table. Enter Primary.

6. To save this call type record, click Save.

7. Close Call Type Maintenance, close the Epicor application, and then log in using the Aaron user account.

8. Use the Main Menu as 8


previously described to
navigate to Call Type
Maintenance.

9. Click the Call Type button to find


and select the MRKTING record.

10. Notice that Aaron can enter and 9


update data within the Full field.

11. The Read Only field displays the 10


data, but Aaron cannot edit this 11
field.
12
12. The None field is empty. Aaron
cannot see or edit data within this
field.

TE

564 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

Review Field Security Settings

You can review the field security settings defined on the current table for a specific user through the User Effective Rights window.
This tool only displays the security rights for a selected user, so you can quickly verify the field security rights assigned for a user on the
current table are correct.

To review field security settings:

1. From the Actions menu, select User Effective Rights.

2. The User Effective Rights 2


window displays.
3
3. Click the User button to find
and select a specific user. In this
example, you select the Aaron
Christiansen user account.

4. The field security rights assigned


to Aaron for the CallType table
display. Scroll through all the
fields; notice that the security
rights you assigned to the
ShortChar01, ShortChar02,
and ShortChar03 fields 4
display on this grid.

5. Repeat these steps to review field


security for other users. When you
finish reviewing the field security
options assigned on the
current table, click Close. 5

Reset Fields

If you want to restore the security rights assigned to a specific field, use the Reset Field feature. This feature causes Field Security
Maintenance to revert all the security options for the selected field back to the default value for all users.

EPICOR SOFTWARE CORPORATION | 565


CHAPTER 14 | SECURITY

To remove security changes for a specific field:

1. In the Tree View, select the field


for which you want to revert back. 2
For this example, you select the
ShortChar02 field.

2. From the Actions menu, select


Reset Field.
3
3. All the security options you change
are removed. Notice that on the
Users/Groups sheet, the Access
column displays the Default value
on all rows for the ShortChar02
field, including the Aaron
Christiansen row. Previously, you
had assigned the Read Only 1
security option to this field for
Aaron.

Reset a Table

You can also restore an entire table back to its default field security options. This feature removes all changes you made for all users
on the selected table.

To reset a table:

1. From the Actions menu, select


Reset Table. 1

2. Notice the icons clear from the 2


fields on the Tree View, displaying
the original icons defined for the
table.

3. To have an additional review of 4


this functionality, you select the
ShortChar03 field.

4. Notice that on the Users/Groups


sheet, the Access column displays
the Default value on all rows for
the ShortChar03 field, including
the Aaron Christiansen row. 3
Previously, you had assigned the
None security option to this field
for Aaron.

CHAPTER 14 | SECURITY

566 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

System Activity Log


To complete the security functionality, the application contains the System Activity Log. Use this dashboard to review all the database
modifications that occurred within the application. This valuable tool can help you determine where and when specific database
changes were carried out and who initiated these changes.

You can quickly locate the database activity you wish to review by filtering the data activity that displays through several advanced
search parameters.

Run the System Activity Log

Main Menu Path: System Management > Security Maintenance > System Activity Log

To filter and run this log:

1. Use the Table Name field to filter


the log to only display database
activity that occurred for a specific
table.

2. Use the ActivityType field to limit


the log to only display a specific 1
database action, like Created or
2
Deleted, in the results. 4
3
3. To filter the log to only display
database changes made by a
specific user, enter the user
identifier you need within the
User ID field.

4. To limit the data activity to only display items that occurred within a date range, select a start date and an end date in the Date
fields.

5. You can use any combination of


these Advanced Search fields
5
to filter the results. When you
are ready to display the database
activity, click the Refresh button.

6. The System Activity grid


populates with the database 6
activity.
7 8 9 10 11 12
7. The ActivitySeq column contains
the identifier assigned by the
system to the database activity.

8. The Company column indicates


the company for which the
database change was made.

9. The Table Name column displays the table which was changed.

10. The ActivityType column defines what database action occurred. Notice in this example, several rows indicate that new business
activity queries (BAQs) were created.

11. The User ID column indicates who made the database change.

12. The Date and TimeChanged columns display the date/time stamp on which the activity occurred.

EPICOR SOFTWARE CORPORATION | 567


CHAPTER 14 | SECURITY

Security Reports
Run the security reports to manage user and security group activity within the Epicor application. Each report displays a specific view of
user activity. Use these reports to evaluate your security settings and practices.

Menu Security Report


Use the Menu Security report to review the current access users and security groups have to items on the Main Menu. Generate this
report to evaluate the security currently defined for your programs.

You can review the security for users, security groups, or both. You can also filter this report to only display access for a specific
program, user, or security group. This key report can give you a complete overview of the security plan currently in place.

Main Menu Path: System Management > Security Maintenance > Reports > Menu Security Report

Use the Menu Security Report

This report has a number of parameters you define. The more information you include, the longer it takes to generate this report.
Epicor recommends you should heavily filter the results the first time you run this report. After you view this sample report, you can
then expand the filters until the report displays the results you want.

To use the Menu Security report:

1. Use the Selection sheet to define what you want


this report to display.

2. Select the New Page Per User/Group check box


1
to cause this report start a new page each time it
encounters a new user or group.

3. Select the Include Allow Information check box to 2 6


display the reason why each user is granted access to 3
the listed programs. When this feature is active, the
4 5
report displays one of the following Allow types:

• Security Manager – The user is a security


7
manager.

• Group – This user can use the program because


this person is a member of a security group with
access to it.

• Directly – This specific user account is granted


access to the program.

• All – This user has access because all user


accounts can launch this program.

4. If you want to display all the security managers who


have complete access to the Main Menu, select the Include Security Managers check box.

5. To display all the users currently assigned to security groups, select the Recap Users on Group check box.

6. Notice the three Filter options. You can limit this report to display only Users or Security Groups. The default value is Both;
this causes the report to display all users and security groups.

7. To filter this report to only display security access for a specific program (Menu Item), click the Menu ID button to find and select
this program.

568 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

8. You can also limit this report to only display access


for selected users or security groups. To do this, click
the Filter sheet.
8
9. To limit the report to display a user or a range of 10
9
users, click the User sheet.
11
10. To limit the report to display a security group or a
range of security groups, click the Security Group
sheet. In this example, you want to limit the security
groups that display, so you click the Security Group
sheet.

11. Next, click the Security Group button to find and


select a single security group or a range of security
groups. In this example, you select the _Production
Staff security group.

12. Now click the Selection sheet.


21 20
13. Notice that in the Filter Summary section, the
Security Groups field displays Some Selected for
12
its value. This indicates that only one or a few
security groups display on the report.

14. Click the Sort By drop-down list to define how to


organize this report. The generated report displays in
the sort order you select. Available options:

• Parent Menu/Menu ID

• Group/User
13
15. Select the Report Style you want this report to use
for its display. If you have different report styles 14
available, you can select them on this drop-down list. 17
15
You create report styles through Report Style 19
16
Maintenance. For more information, review
the Reporting Tools chapter in either the Epicor 18
ERP Implementation Guide or the Epicor ICE
Tools User Guide.
16. Click the Schedule drop-down list, select when you want this report to print. Typically you select Now, which indicates the report
prints immediately. However, if you select a schedule other than Now, the Recurring check box the Recurring check box
becomes available. You can then set up this report to print on the regular schedule you select from this list.

17. Select the Recurring check box to indicate this report is run You create recurring schedules within System Agent
through a regular schedule. When the System Agent launches Maintenance. The System Monitor is a program that
the schedule you select on the Schedule drop-down list, this regulates tasks, like processes and reports, throughout your
report automatically generates. application. For more information, review the Automatic
Data Processing chapter in either the Epicor ERP
18. Click the Archive Period drop-down list to define how long this Implementation Guide or the Epicor ICE Tools User Guide.
report should stay listed within the System Monitor; this report
displays on the History Tasks sheet. If you need, you can then reprint this report from the System Monitor.

19. In the User Description field, enter any brief notes you want to display in the report.

20. To view this report, click the Print Preview button.

21. To print this report, click the Print button. You can now use this report to evaluate how your security plan is currently
implemented on the Main Menu.

EPICOR SOFTWARE CORPORATION | 569


CHAPTER 14 | SECURITY

Change Log Report


The Change Log report displays activity that occurred in the database during a specific period of time. You can limit this report to only
display activity entered in a selected table. Leverage this report to see what changes specific users are making to the database.

Main Menu Path: System Management > Security Maintenance > Reports > Change Log Report

1. Select the Start Date for the report. All database


activity that occurred on or after this date is 7 6
included on the report.

2. Select an End Date for the report. All database 4


activity that occurred on or before this date is
included on the report.
1
3
3. Notice you can also select the Dynamic check box 2
for each date field. This changes the date fields to
display a repeating time frame like Today. Use these
options to run this report through a consistent,
repeating time frame.
5
If you save these settings, the report displays
and uses the Dynamic values each time you
launch the report. You then do not need to
change these values manually every time.

4. Click the Filter tab to find and select a specific database table. The report then only displays activity that occurred in the selected
table.

5. Select the Report Style and the Archive Period for the report.

6. To view this report, click the Print Preview button.

7. To print this report, click the Print button.

User Session Log Report


Run the User Session Log report to review how often all users or a specific user accessed the Epicor application. You enter a date
range and can optionally select either all users or a specific user. The report displays the Log on and Log off date/time for each time
the user accessed the Epicor application.

Main Menu Path: System Management > Security Maintenance > Reports > User Session Log Report

1. Select the Start Date for the report. All user sessions
that occurred on or after this date are included on 6 5
the report.

2. Enter an End Date for the report. All user sessions 3


that occurred on or before this date are included on
the report.
1
3. Click the Filter tab to find and select a specific user. 2
Only user sessions initiated by a specific user display
on the report results.

4. Select the Report Style and the Archive Period for


the report. 4

570 | EPICOR SOFTWARE CORPORATION


SECURITY | CHAPTER 14

5. To view this report, click the Print Preview button.

6. To print this report, click the Print button.

Users/Groups Report
Run the Users/Groups report to review the current list of users assigned to a specific group or groups. Although you can run this
report to display all security groups and users, you can also limit this report to display a specific group or user.

Main Menu Path: System Management > Security Maintenance > Reports > Users/Group Report

1. To display all the users and security groups in the


current company, verify all Groups and Users are 6 5
selected.
2
2. You can also click the Filter tab to find and select
a specific user and/or group. Only information on the
selected users/groups display on the report.
1
3. Click the Sort drop-down list to define how you
want to organize this report.
3
4. Select the Report Style and the Archive Period for
the report. 4

5. To view this report, click the Print Preview button.

6. To print this report, click the Print button.

EPICOR SOFTWARE CORPORATION | 571


CHAPTER 14 | SECURITY

572 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

Chapter 15
Data Replication

The Epicor Replication Server duplicates tables from an Epicor application database to a secondary SQL database. Typically the
replication server is installed on another server instead of the main Epicor application server; the main purpose of the
replication server is to facilitate the offloading of reporting and query functions from the main transactional server.

The Epicor application databases are referred to as the Publishing databases. The replicated SQL databases are referred to as
the Subscribing databases.

You select the database tables to publish from the application database(s) using profiles you first design within the Epicor
application and then apply to specific company records. A single replication, subscribing database can contain data from
multiple companies, even if these companies are on multiple application servers (as long as the Company IDs are unique).
Similarly, multiple replication databases can subscribe to data from a single application publisher.
DATA REPLICATION | CHAPTER 10

EPICOR SOFTWARE CORPORATION | 573


CHAPTER 15 | DATA REPLICATION

Replication Types
Two types of replication subscribing databases are available:

• Ad Hoc - An Ad Hoc subscribing database starts as an empty SQL database; all table schemas and data load in from the
publishing database. Use this kind of replicated database for ad hoc reporting through tools like Crystal Reports®.

• Fully Functional - A Fully Functional subscribing database starts as an empty Epicor SQL database with all tables and stored
procedures and functions pre-delivered. These empty databases are delivered with the Epicor application and may be configured
as the database for a running installation of Epicor 9. However, this database is defined as read-only and so the subscribing
Epicor application programs cannot update the data. The main purpose of this subscribing database type is to offload query
functions - such as dashboards and reports. This database is also useful when you need to support heavy data load generated by
Epicor Portal or another external system which creates offline ad-hoc queries.

How Database Replication Works


This section explores the database replication process.

Replication Setup
Before you can use the data replication functionality, you must install the following applications:

• Progress SonicMQ V7.6 application or higher - This application is not included with the replication server installation.

• Either MS SQL Server 2000 or MS SQL Server 2005 - This application must be installed on either the same machine
or on a machine connected to the machine where you installed the replication server.

Replication Dataflow
The following components are involved in replicating data from a source database to a destination database:

1. An Epicor source, or
publisher, database which 3 5
contains the data you wish to
replicate. You must define 2 4
how this source database 1
interacts with the
replication functionality.

2. The Replication Agent and


the Replication Log Reader
are required to connect the
publisher database with the
Sonic server. The Replication
Log Reader captures the data
from the publishing database
and sends it out to the
replication server. The
Replication Agent processes the replication server requests to the publisher database and, in turn, sends the requested data back
out to the replication server.

3. The functionality uses Sonic messages to send the requests back to the publishing database and then pull the requested data
out to the replication server.

574 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

4. The replication server is a separate .NET component which executes the data replication; it pushes the data out to the target
databases. You can run the replication server as either a Windows server or a console application.

5. One or multiple target databases receive the replicated data. Each target database is assigned to a specific subscriber, which is
a .NET class, that defines how the replication server interacts with this database, the schematics of the database, and so on.

Replication Components
Two separate systems manage the replication components:

• Publishing Components – You manage the publishing components within the Epicor application. The programs you need
to use are Replication System Maintenance, Replication Profile Maintenance, Replication Agent Process, and the Replication
Log Reader.

• Subscribing Components – You manage the replication server and the subscriber functions through the Replication
Management Console. You install this application separately and then access it to define your subscribing databases.

Publishing Components
This section details the programs you need to set up for the publishing functionality within your source Epicor database.

Replication Profile Maintenance


You begin by launching Replication Profile Maintenance. Use this program to create source profiles; each profile indicates the specific
tables you want replicated within the database. The data within the tables you select for the profile is queried and this data is sent out
to the replication server for distribution among the subscribing databases.

You later assign a profile to a specific company within Replication System Maintenance. You can assign different profiles to different
companies, so you can replicate the specific data you need from a publishing database.

Main Menu Path: System Management > Replication > Replication Profile Maintenance

To create a replication profile:

1. Click the New button on the


Standard toolbar.

2. Enter the name of the 1


Profile you need.

3. Enter a concise Description


for the new profile. Be sure
to enter text that explains the 2
purpose for the profile.
3

EPICOR SOFTWARE CORPORATION | 575


CHAPTER 15 | DATA REPLICATION

4. You are now ready to add


tables to this profile. To 4
do this, click the Down
Arrow next to the
New button.
5
5. Select New Tables.

6. The Add Tables to 6


Profile window displays.

7. Select a table you want from 9


the left Tables List.
8
8. Click the Right
Arrow button.
10
9. The selected table now 7
displays within the
right Tables List.

10. Continue to add the individual 12


tables you need. To add all the 11
tables, click the Double Right
Arrow button.

11. To remove a table, select


it from the right Tables 13
List and click the Left
Arrow button.

12. To remove all the tables from


the profile, click the Double
Left Arrow button.

13. When you finish adding


and removing tables from the
profile, click OK.

576 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

14. The selected tables display


on the Tables > List sheet.

15. To complete the profile,


click Save.

15 14

Replication System Maintenance


You use Replication System Maintenance to assign a profile to a selected company. You can assign as many profiles as you need
to each company. Data from the tables defined in each profile is then replicated within the subscriber databases.

Main Menu Path: System Management > Replication > Replication System Maintenance

To assign profiles to a company:

1. A list of all the Companies


within the current database
displays within the
Tree View. 1
2
2. Highlight the company
3
to which you want to
assign a profile.

3. A list of all the available


profiles displays within the 4
Available Profiles list. 5

4. Highlight the profile you


want to assign to the
selected company.

5. Click the Right


Arrow button.

EPICOR SOFTWARE CORPORATION | 577


CHAPTER 15 | DATA REPLICATION

6. The profile now displays


within the Selected Profiles
list. Repeat these steps to add
other profiles to the
current company.
6
7. To add all the available profiles
to the selected company, click
the Double Right
Arrow button.

8. You can remove a profile by


highlighting it within the 7 8
Selected Profiles list and
clicking the Left
Arrow button.
9
9. To remove all of the profiles
from the current company,
click the Double Left
Arrow button.

10. You review the identifier and


the name for the current 13
11
company by clicking the
Company Details tab.
12 10
11. When you finish adding the
profiles you need, click the
Actions menu and select
Initialize Subscribers With
New Tables. This command
indicates you want to
replicate the data from the
tables within the selected
profiles out to the
replication server.

12. If you wish to stop replicating


the data, click the Actions
menu and select Reset. You
are asked if you wish to do
this; click Yes to reset the
subscribing information.

13. Repeat these steps to assign


other companies to specific
profiles. When you finish,
click Save on the
Standard toolbar.

Replication Log Reader Process


The Replication Log Reader Process transfers data from the publishing database out to the replication server. Because this program is
a process, you can set it up to run using an automatic schedule. Typically you assign this process to a startup schedule so that it runs
each time the process and agent application servers are launched. By default, this process runs every minute, but you can adjust it to
reflect how often you want the data sent out to the replication server. For more information about setting up processes to run on an
automatic schedule, review Chapter 1: Automatic Data Processing.

578 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

This process queries for records within the Replication Log Table and then places them within a Sonic message. The message
consolidates these records in chronological order, grouping them together by tables. When these records are moved to the Sonic
message, the replication log clears out its data until it is initialized again.

Main Menu Path: System Management > Replication > Replication Log Reader Process

To set up this process:

1. You indicate that this process


should run constantly by
7
selecting the
Continuous Processing
check box. This process then
runs constantly after it 6
launches, using the time
interval you define within the 1
Continuous Processing
Delay field. 2
3 5
2. Use the Continuous
Processing Delay field to 4
define how frequently this
process should run. Enter the
value you need in minutes.

3. Click the Log Filename button to find and select the directory path and file that updates with the replication log
information. The log reader data is saved within this log file.

4. Select the Schedule during which you want this process to automatically run. Typically, you select Daily Start Up from this
drop-down list.

5. If you want this process to run each time the selected schedule activates, select the Recurring check box.

6. When you finish, click Submit.

7. If you want to add this process to a process set, click the Save Process Set button. Process sets organize a series of tasks
(submitted processes or reports) to run in a sequence you define. For more information about process sets, review Chapter 1:
Automatic Data Processing.

Replication Log Reader – How It Works

This section details how the Replication Log Reader gathers data from the publishing database and sends it out to the replication
server. What happens:

1. A user clicks a Save button for


a record (for example, a new
customer record) within the
Epicor application. This sends
1 2 3
a call from the client out to
the business layer.

2. The business object that 5 6


runs the specific programming
task (saving a customer
record) activates. This business
object is a .p procedure file. 4
7
3. Depending on the task, the
business object inserts,
updates, or deletes a record within the corresponding table (for example, the customer table).

4. A trigger runs, which automatically creates a duplicated record within the Replication Log table.

EPICOR SOFTWARE CORPORATION | 579


CHAPTER 15 | DATA REPLICATION

5. When its schedule activates, the Replication Log Reader launches and pulls the data out of the Replication Log Table.
It consolidates the records into chronological order, grouping them by table. It creates a message which contains this data.

6. This message is sent out to the Sonic server.

Replication Agent Process


You use the Replication Agent Process to configure how often the replication agent runs. This program first processes the data
requests from the replication server. It then receives data from the Replication Log Reader. If any of this data answers a request,
the agent then sends this selected data back out to the replication server.

For example, a request for data is sent from subscriber class. The replication server sends this request through a Sonic message to the
replication agent, saving this request to the repl* tables defined within the Epicor application database.

The replication agent processes these requests by reviewing the repl* tables during a specific time you define within this process. If the
process sees that data is available which answers this request, it executes it and sends the replicated data out to the replication server.
The replication server notifies the subscriber class that data is available and the subscriber class, in turn, adds, updates, and deletes the
data within its database.

Main Menu Path: System Management > Replication > Replication Agent Process

To set up this process:

1. Use the Continuous


Processing Delay field 4
to define how often you
want the replication agent
to process requests and data.
You enter this value 3
in minutes.

2. Click the Log Filename 1


button to find and select the
directory path and file where 2
you want to store data from
the replication agent each
time the process runs.

3. When you finish, click Submit


on the Standard toolbar.

4. If you want to add this process to a process set, click the Save Process Set button. Process sets organize a series of tasks
(submitted processes or reports) to run in a sequence you define. For more information about process sets, review Chapter 1:
Automatic Data Processing.
43
Replication Agent Process – How It Works

This section provides more details about how the Replication Agent handles requests coming into the publisher and data being
duplicated out to target databases on the subscriber. What happens:

1. A user initializes a subscriber


instance within the 3 2 1
Replication Management
Console (MMC). This
program handles subscriber 4 5
requests to the publisher; for
more information, review the
next Subscribing
Components section.

580 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

2. This generates a request to the replication server, which is forwarded to the replication agent through a Sonic message.
This request is saved to the repl* tables within the publisher database.

3. The replication agent processes the requests, reviewing the data sent to it by the Replication Log Reader. The data it discovers
that matches a request is sent to the replication server using a Sonic message.

4. The replication server notifies the subscriber (for example, an ad-hoc subscriber) that new data is received and ready
for distribution.

5. The subscriber commits the replicated data to the target database.

Subscribing Components
This section details what you need to set up to define the subscribing functionality within the Replication Management Console.

Replication Management Console


You define the subscribers and the target databases they update within the Replication Management Console. You first indicate which
publishers supply the data to the target databases on the subscribers. Each subscriber record defines the publisher from which it
requests data and then defines which target database receives the replicated data.

You launch the Replication Management Console separately from the Epicor application. To launch this program from the Windows
desktop: Start > All Programs > Epicor Database Replication > Management Console

Replication Management Console Overview

The following are the steps you follow to set up the replication process within this console (more specific instructions follow
this overview):

1. Create a publisher. This record defines the source database from which the data is replicated.

2. Define what kind of subscriber class type you need – Functional, Ad-Hoc, or a Custom database. This record identifies the type
of data you wish to replicate.

3. Create a target database for the subscriber class. This database receives the replicated data.

4. Link the target database to the publisher by creating a subscriber instance.

5. Define which tables and companies are received by the subscriber instance by configuring its filter.

6. Optionally create tables within the target database and copy the existing data to the target database.
5
Add a Replication Server

You begin by creating replication servers below the DB Replication node. This item is the root node which displays all the replication
servers available within your network. To add a replication server:

1. Right-click the DB Replication node


and select Add replication server.

1
5 6

EPICOR SOFTWARE CORPORATION | 581


CHAPTER 15 | DATA REPLICATION

2. The Register a replication server window 2


displays. 3

3. Click the Browse button to find and select


a replication server available within your 4
network.

4. When you select the replication server you need,


click the Register button.

5. The replication server displays below the DB Replication node. To connect this replication server to the server, right click this
node and select the Connect command.

6. Notice that the replication server node displays the name of the server and the port used to connect to the replication server.
Because you may have several replication servers running on the same machine, the port values help indicate the different
instances of each replication server.

Now the replication server is connected to your server and it is also processing data. If you wish to disconnect the replication server
from the main server, right-click the node and select Remove.

Add a Publisher

You manage publisher databases by using the Publishers node. As discussed previously, a publisher is an Epicor application database
from which you receive data. By adding a publisher, you link the Epicor database to the replication server.

To add a publisher:

1. Right-click the Publishers


node and select
Add Publisher.

582 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

2. The Properties 2
window displays.
3
3. Enter the Name you need
for the publisher. 4
5
4. Enter the Broker URL host
name and the port for the 6
Sonic server using the <host
name>:<port> format.
9
5. The Topic prefix value defines the
specific set of Sonic topics this 7
publisher uses to communicate
between the Epicor application 8
and the Sonic server. Because the
same Sonic server can be used for
multiple replication servers, these topic
set names cannot be identical and
require different prefixes.

6. Enter the Login and Password values


you use to connect to the Sonic server. 10
DATA REPLICATION | CHAPTER 10
7. Select the Default snapshot retrieval
protocol method you wish to use with the current publisher. This method defines how the data is retrieved; select either
the Sonic or the Manual File Copy option.

8. Select the Connect automatically check box to indicate the publisher and all its subscribers automatically connect to the server
each time the server is started.

9. To verify the connection works correctly, click the Test Connection button.

10. When you finish, click OK.

Add a Subscriber Instance

You use subscriber instances to link the current publisher to the target database. You can also filter what data is received through each
subscriber instance.

To add a subscriber instance:

1. Right-click the Subscriber Instances


node and select Add
Subscriber instance.

EPICOR SOFTWARE CORPORATION | 583


CHAPTER 15 | DATA REPLICATION

2. The Subscriber 2
Instance Properties
window displays.
3
3. Enter the Name you 4
need for the subscriber
instance. Be sure this 5
name is unique within
the network.

4. Select the target database


which receives the replicated
data from the Target DB
drop-down list. This database
is either an ad-hoc or
functional database. You
later use this value
for troubleshooting
replication issues.

5. To indicate that you want this


subscriber instance to launch
each time the publisher is 6
connected, select the Start
automatically check box.

6. When you finish, click OK.

You can now manage the subscriber instance as you need. You do this by right-clicking the subscriber instance and selecting
Properties. Use this window to define any filters you wish to use with the subscriber instance. Review application help for more
information on the properties available for each subscriber instance.
3
Manual Snapshot Copy

In some situations it may be faster to copy the data through a manual snapshot. You can then send the data using ftp, http, or
a copied file. If the database is large, you could also burn it onto a DVD and send it to the location you need.

To create a manual snapshot copy:

1. Right-click a subscriber
instance, and, from
the context menu,
select Initialize.

1
6 7

584 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

2. The Initialize Subscriber 2


window displays.

3. In the Snapshot retrieval protocol


section, select the Manual
file copy option.

4. Notice the directory path which displays


within the Full path: field. Using
Windows Explorer®, navigate to this
path. Copy all the files from that folder
to the SnapshotDrop subfolder within
the Replication Server root directory.
(Note that this step is not illustrated.)
3
5. Click the Send request button.

6. As the files are copied to the target


folder, they disappear after a few 4
seconds. This occurs because the
replication server moves them to a
subfolder of the subscriber working 5
directory. You can, however, review the
state of the request on the Replication
Management Console. Navigate to
the Activity node under the subscriber instance.

7. All the current requests for the subscriber instance display within the table. When the State column displays the Completed
status, the manual snapshot is created.
DATA REPLICATION | CHAPTER 10
View Activities

As described briefly in the previous section, you can review activities to track the status of a request sent to the replication server.
Use this feature to track the status of both a subscriber instance and a publisher. The publisher activity list displays the requests sent
to the Epicor application. The subscriber instance activity list displays the requests sent to the replication server.

To view activity:

1. You review activity for publishers by


first expanding the Publishers node.

2. Expand the Subscriber


Instances node.

3. Select the Activity node. 4 5

1
4. A table displays the recent
requests sent to the 2
replication server.
3
5. Note the State column. The 6
values in this column indicate the
current status of the request.

6. To view the publisher activity, expand


the Activity node at the
Publishers level.

For a list of all the states available for both


subscriber instances and publishers, review
the next two sections.

EPICOR SOFTWARE CORPORATION | 585


CHAPTER 15 | DATA REPLICATION

Subscriber Instance States

The following states are available for subscriber instances. You view these values in the State column described in the previous View
Activities section. Available subscriber instance states:

• TRAVELING – The request is sent to the Epicor application through Sonic; however, the receiver has not yet confirmed receipt
of the request. This can happen because the Replication Agent is either stopped or busy processing another request.

• CANCELLING – Another request is requested to be cancelled. This current request is waiting to be cancelled.

• CANCELLED – The request is cancelled by the user.


When the Replication Agent purges requests, only
one COMPLETED or CANCELLED request is available
• COMPLETED – The request is complete.
for each subscriber instance.
• SCHEMA_WAIT – This state is applicable to the requests with the
SCHEMA_AND_DATA and SCHEMA initialization scopes. The subscriber is waiting for schema definitions for some of the tables
to arrive from the Epicor application.

• SNAPSHOT_WAIT – This state is applicable to the requests with the SCHEMA_AND_DATA and DATA initialization scopes.
The subscriber is waiting for snapshots to arrive from the Epicor application.

• INIT_READY – All snapshots and/or schemas have arrived from the Epicor application. All the required data is received.

• FILTERING_SNAPSHOTS – The replication rerver is applying a filter to the snapshots.

• FULL_INIT_PLANNED, SCHEMA_INIT_PLANNED, and DATA_INIT_PLANNED – The subscriber is notified of the pending


initialization request. It has responded to it with the list of the requested tables.

• INITING_SCHEMA – The subscriber is creating tables in the target database.

• SCHEMA_INITIALIZED – The subscriber has created (or recreated) all the tables in the target database.

• INITING_DATA – The subscriber is uploading snapshots to the target database.

• DATA_INITIALIZED – This state is applicable to the requests with the DATA initialization scope. The subscriber has uploaded all
the snapshots to the target database.

• ALL_INITIALIZED – This state is applicable to the requests with the SCHEMA_AND_DATA initialization scope. The subscriber has
created all the tables and has uploaded the snapshots for the tables to the target database.

Publisher States

The following states are available for publishers. You view these values in the State column described within the previous View
Activities section. Available publisher states:

• WAITING – The request is received from the Sonic server and is saved to the request queue (ReplRequest* tables).

• EXECUTING – The Replication Agent is running the request.

• CANCELLED – The request is cancelled from the Replication Management Console. To learn how to do this, review the Cancel
a Request section later in this chapter.

• COMPLETED – The request is complete.

• SCHEMA_SENT – The Replication Agent has created the schema definition for all the tables in the request and has sent it to the
replication server through Sonic.

If the Replication Agent is stopped, the state of all requests stays the same until the Replication Agent activates again.

586 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

View Tables

You can view table information when you need to track the processing status of the database tables selected for replication. You view
this information below a subscriber instance node.

To view table information:

1. Expand the Subscriber


Instances node.

2. Click the Tables node to view the


tables for this subscriber instance.

3. Use the grid that displays to review the


tables. Each row contains data for a
specific table and the columns display
the different information that is 1
replicated from the table. 2 3

Additional information usually displays


as well, like table name, status, number
of records processed, and so on.

DATA REPLICATION | CHAPTER 10


Cancel a Request

You can stop any requests made to a specific publisher or a specific subscriber instance. Here’s how:

1. Expand the Activity node for a specific


publisher or subscriber instance. In this
example, the Activity node under a
subscriber instance is expanded. 2

2. Using the table, right-click the


request you wish to stop. When the 1
context menu displays, select Cancel.

The selected request is cancelled both for the


publisher and for each subscriber instance.

EPICOR SOFTWARE CORPORATION | 587


CHAPTER 15 | DATA REPLICATION

Subscriber Class

A subscriber is a component that defines the target database type, like database server, schema, and so on, which receives the
replicated data. Each subscriber is a .NET class. You need to create a separate subscriber for each database type. When you install the
replication server, the Test, Ad-Hoc, and Functional subscriber classes are installed as well:

• Functional – This subscriber handles data within the Epicor application. The Epicor application must run using SQL Server.

• Ad-Hoc – This subscriber creates a SQL database that has a similar schema to the Epicor SQL database. This database is created
automatically by the subscriber class.

• Test – You use this subscriber to troubleshoot issues with the replication If you need, you can also create a custom subscriber
server. This class records events in the server log and does not support a class. For information on how to do this, review the
target database. Developing Custom Subscriber Class topic within the
application help.
You need to link subscribers to a target database. Here’s how:

1. Right-click a subscriber class and


select Add target database.

2. Enter the Name of the


database you need.
2 3
3. Click the DB Connection
tab to define the SQL Server
connection to this
target database.

4. When you finish, click OK.

588 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

Target Database Tables

A Tables node is available under each target database node. Select this Tables node to review all the tables which exist in the target
database and the current state of each table.

You can also clean up the data from a command available at this node. When you launch the data cleanup, the data within all the
tables and selected companies is refreshed and restored for final display within the target database. During this process, all running
subscribers pause and are placed in a cleanup state.

To view the target database:

1. Expand one of the subscriber


class nodes. 4 5 6

2. Select the Tables node.

3. The tables included within the


target database display
within a grid.

4. The Table column displays the


name of the table.
56
5. The State column indicates 3
the current status of the
specific table. The following
table statuses can display in
this column: 1

2
• AVAILABLE – No
database cleanup is in
progress and the table is
ready to receive the
replicated data.

• CLEANUP_PENDING –
The user has submitted
the cleanup request; this
table is waiting its turn to be cleaned up.

• CLEANING_UP – The replication server is cleaning up this table.

6. The Last Action column displays the time and date during which this table received the replicated data.

Now the data you need to display from the publishing database is automatically replicated in the subscribing target database.
By leveraging this functionality, you can make important data available for review throughout your entire organization.

EPICOR SOFTWARE CORPORATION | 589


CHAPTER 15 | DATA REPLICATION

Replication Wizard

To streamline creating your database replication process, the Replication Management Console contains the Replication Wizard.
This step-by-step program guides you through the entire process, from selecting the replication server to creating the subscriber
instance. Use this wizard to quickly and correctly set up database replications for your organization.

To use this wizard:

1. Right-click the DB Replication node.

2. Select Start replication wizard.

1 2

3. The Replication 3
Wizard displays.

4. A list of the available replication


servers is available. Select the
replication server you want to
receive data from your
Epicor application. 4

5. Click Next.

590 | EPICOR SOFTWARE CORPORATION


DATA REPLICATION | CHAPTER 15

6. You now indicate how the


publishing database connects to the
Sonic server. Enter the Name of the
publishing database.

7. Define the Sonic MO information


by entering the Broker URL. This
value is the host name and port 6
for the Sonic server. Use the
<host name>:<port> format.
7
8. The Topic prefix value defines 8
the specific set of Sonic topics
this publisher uses to 9
communicate between the Epicor
application and the Sonic server.
Because the same Sonic server can 10
be used for multiple replication
servers, these topic set names
cannot be identical and require
different prefixes. 11

9. Enter the Login and Password


values you use to connect to the
Sonic server.

10. Click the Test connection button


to verify that the Sonic connection
works correctly.

11. Click Next.

12. You now define the target, or


subscribing, database that will
receive the data. Available options:

• Epicor (Functional) – This


database is created by running
the Epicor installation program.
You must create this
database before you run 12
the Replication Wizard.

• Blank (Ad-hoc) – The


replication server creates this
database using the tables you
have selected. You use this
database for custom reporting;
you cannot display this data
within the Epicor application.

13. Click Next.


13

EPICOR SOFTWARE CORPORATION | 591


CHAPTER 15 | DATA REPLICATION

114. During this wizard step, you specify


the connection information for the
target database. If you need, enter
a specific User and Password
for this connection.

15. Optionally, select the Windows


authentication check box to 15
indicate you use Windows to validate
this database connection.

16. Click the Server drop-down list 14


to select which server handles 16
the connection.
17
17. Click the Database drop-down
list to select the subscriber database. 18

18. Now click the Test connection


button to verify the connection 20
works correctly.
19
19. Enter the Windows log on
account. This account is used by the
SQL Server service.
21
20. Click the Validate button to make
sure this Windows account
works as expected.

21. Click Next.

22. Create the subscriber instance you


want to use between the publisher
and the target, or subscriber,
database. Enter a Name that
identifies this subscriber instance.

23. Click Finish.


22
The subscriber instance for the publisher
and subscriber relationship is created.
Run this wizard again to create as many
subscriber instances as you need.

CHAPTER 10 | DATA REPLICATION

23

592 | EPICOR SOFTWARE CORPORATION


Worldwide Headquarters Latin America and Caribbean Europe, Middle East and Africa Asia Australia and New Zealand
San Francisco Bay Area Blvd. Antonio L. Rodriguez #1882 Int. 104 No. 1 The Arena 238A Thomson Road #23-06 Level 34
4120 Dublin Boulevard, Suite 300 Plaza Central, Col. Santa Maria Downshire Way Novena Square Tower A 101 Miller Street
Dublin, CA 94568 USA Monterrey, Nuevo Leon, CP 64650 Bracknell, Berkshire RG12 1PU Singapore 307684 North Sydney NSW 2060
Toll Free: +1.888.448.2636 Mexico United Kingdom Singapore Australia
Direct: +1.925.361.9900 Phone: +52.81.1551.7100 Phone: +44.1344.468468 Phone: +65.6333.8121 Phone: +61.2.9927.6200
Fax: +1.925.361.9999 Fax: +52.81.1551.7117 Fax: +44.1344.468010 Fax: +65.6333.8131 Fax: +61.2.9927.6298

You might also like