Programming Workflow Activity Guide - 5
Programming Workflow Activity Guide - 5
5. Why is the Originator data item included in the A notice is sent to the originator indicating whether
Capital Projects Approval workflow process? the project was approved or rejected.
6. Why is the Work Order Status data item included The status code is necessary because it is updated
in the Capital Projects Approval workflow process? from “pending” (E3) to either “accepted” (E4) or
“rejected” (D).
7. Why is the Approval Action Code data item Approval Action Code is needed to indicate the
included in the Capital Projects Approval workflow action the approver takes (A = Accept, R = Reject).
process?
2. On the Add Object to the Project form, click Workflow Process under the Workflow
heading and then click OK.
4. For the key data structure, enter WF5601<last two digits of your user ID>A.
5. For the additional data structure, enter WF5601<last two digits of your user ID>B.
e
s
9. The K5601<last two digits of your user ID> Capital Projects Approval workflow
process should display under the Capital Projects Approval project.
U
Designing a NER Business Function
A I
O
Create the D564801<last two digits of your user ID>data structure for the business
function as described in the Activity Overview.
l &
Designing the Business Function
n a
te r
1. Create the named event rule N56480<last two digits of your user ID> object:
a. In OMW, focus on the Objects node of the Capital Projects Approval project and
I n click Add.
O d. Click OK.
2. To define the business function, select the Design Tools tab and click Start Business
Function Design Aid.
a. On Business Function Design, use STA1<last two digits of your user ID> as the
Parent DLL.
b. On Business Function Design Aid, complete the fields in the grid as described in
the Activity Overview.
3. To attach the D564801<last two digits of your user ID> data structure to the business
function:
a. Select the row with the N56480<last two digits of your user ID> business
function and select Parameters from the Row menu.
b. On the Select Business Function Parameters form, type D564801<last two digits
of your user ID> in the QBE column for the Template Name field, and click
Find.
c. After the D564801<last two digits of your user ID> data structure appears in the
grid, click Select.
a. Select the row with the N56480<last two digits of your user ID> business
function and select Edit from the Form menu.
b. On the Named Events Rule Design form, enter the event rules shown in the
n l y
Activity Overview.
O
b. After the business function builds successfully, exit the Busbuild application.
Workbench.
l &
6. On the Business Function Design form, click OK to return to Object Management
n a
te r
7. N56480<last two digits of your user ID> should now appear as an object in the
Capital Projects Approval project.
O ra Name of Task
ASKAPRVL
Type
Message
Description
Send message to ask approval
for a work order request
Additional Information
Use message template
LM561<last two digits of your
user ID>A
1. In Object Management Workbench, select the K5601<last two digits of your user
ID> Capital Projects Approval workflow process and click Design.
2. On the Workflow Design form, click the Design Tools tab, and then click Start
Workflow Modeler.
2. Drop the task onto the diagram by clicking anywhere in the diagram.
e O
Process
Version 1
U s
K5601<last two digits of your user ID>
Task
Description
A IASKAPRVL
Work Order Approval Request
Category Code 1
O Blank
Category Code 2
l& Blank
na
Category Code 3 Blank
And Join (Y/N)
e r Blank
I
4. Click OK.
nt
c l e The Askaprvl task appears in the Workflow Modeler diagram.
r a
Creating the UPDATE Task
O 1. In Workflow Modeler, click the Message icon.
2. Drop the task onto the diagram by clicking anywhere in the diagram.
4. Click OK.
2. Drop the task onto the diagram by clicking anywhere in the diagram.
n l y
The Workflow Task Revisions form appears.
e O
3. On the Workflow Task Revisions form, enter the following information:
Field
U s
Value or Status
Process
Version A I
K5601<last two digits of your user ID>
1
Task O ACCEPEDT
Description
l& Send WO Accepted Message
na
Category Code 1 Blank
Category Code 2
e r Blank
nt
Category Code 3 Blank
e I
And Join (Y/N) Blank
c l
r a 4. Click OK.
O
Creating the REJECTED Task
The Accepted task appears in the Workflow Modeler diagram.
2. Drop the task onto the diagram by clicking anywhere in the diagram.
4. Click OK.
l y
To configure the Askaprvl message task, you must define the contents and the recipient
of the message.
n
diagram, and then select Event Rules.
e O
1. In Workflow Modeler, right-click the Askaprvl message task that you added to the
te r <Blank>
I n
Active <Define Active Message> Find and select application
P98805, Form W98805A.
r a cCommentRequired
3. Click OK.
1. In Workflow Modeler, right-click the Update business function task that you added to
the diagram, and then select Event Rules.
2. On the Business Function Search form, find source module N564801<last two digits
of your user ID> and then click Select.
BF cApprovalActionCode Æ
O
cApprovalActionCode
e
BF szWorkOrderStatus
BF mnWorkOrderNumber
Æ
Æ
U s
SzStatusCodeWo
mnDocumentOrderInvoiceE
A I
4. Click OK.
O
Configuring the ACCEPTED Task
l &
n a
1. In Workflow Modeler, right-click the Accepted message task that you added to the
r
diagram, and then select Event Rules.
te
n
2. Enter the following information:
I
cle
Field
Recipient
Value
BF mnOriginatorNumber
Additional Information
O ra Structure Type
Mailbox
Subject
<Single Recipient>
<Electronic Workbench>
<Blank>
Text <Blank>
Active <None>
3. Click OK.
1. In Workflow Modeler, right-click the Rejected message task that you added to the
diagram, and then select Event Rules.
e O
Subject
Text
<Blank>
<Blank>
U s
Active
Message
<None>
A
<Define Message>
I Type LM561<last two digits of
te r message.
Assign the following values:
In
&1: BF mnWorkOrderNumber
&2: BF mnEstimatedAmount
r a
O 3. Save your changes and exit Workflow Modeler.
Results
The following illustration shows the completed tasks for the Capital Projects Approval
workflow:
A I
2. On the Workflow Design form, click the Design Tools tab, and then click Start
Workflow Modeler.
O
l &
3. On Workflow Modeler, move each task to a location in the workspace that
corresponds with the workflow diagram.
n a
You might find it easier to create the diagram horizontally rather than vertically in
r
the workspace.
te
n
4. Connect the tasks by clicking the Transition icon on the toolbar.
I
c le Click and drag the mouse from the task at which you want the transition to originate
to the next task in the process.
r a
Adding and Attaching Transition Conditions
O Create and attach the two transition conditions to the workflow diagram as follows:
IFAPPROVED
To create and attach the IFAPPROVED condition:
1. Right-click the transition between the Askaprvl task and the Accepted task, and then
select Add and Attach.
2. To complete the Process Rule Revisions form, enter the following information:
n l y
4. Click OK twice to return to Workflow Modeler.
e O
IFREJECTED
U s
A I
To create and attach the IFREJECTED transition condition:
1. Right-click the transition between the Askaprvl task and the Reject task, and then
select Add and Attach.
O
l &
This Transition Condition evaluates the approval action code. If a value of R is
a
returned, the Rejected message is sent to the originator.
n
Field
te r
2. To complete the Process Rule Revisions form, enter the following information:
Value or Status
I n
Process K5601<last two digits of your user ID>
c l e
Version 1
r a Rule
Description
IFREJECTED
If Credit Limit Change is Rejected
O Category Code 1
Category Code 2
Blank
Blank
Category Code 3 Blank
Results
After adding the IFAPPROVED and IFREJECTED transition conditions, the Capital
Project Approval workflow diagram should appear similar to the following illustration:
n l y
Validating the Workflow Process
• A I
message means that you can now attach the workflow process to an application.
If the version contains errors, a dialog box appears with a list of errors. Click
O
Start Workflow Modeler to open the version in Workflow Modeler and correct
the errors.
l &
Workbench.
n a
2. On the Workflow Design form, click OK to return to Object Management
te r
Attach the Workflow Process to an Application
I n
1. In Object Management Workbench, search for the Work With Work Orders (P48201)
c le application and then add it to the TRN<last two digits of your user ID>102 Capital
Projects Approval project.
O Name the copies P56481<last two digits of your user ID> and T56481<last two
digits of your user ID> respectively.
5. In Object Management Workbench, search for the Project Task Details (P48014)
application and then add it to the TRN<last two digits of your user ID>102 Capital
Projects Approval project.
Name the copies P56482<last two digits of your user ID> and T56482<last two
digits of your user ID> respectively.
9. Verify that your K5601<last two digits of your user ID>workflow process is active.
Click P56482<last two digits of your user ID> and enter the design mode to attach the
K5601<last two digits of your user ID>workflow process.
1. Add the event rules to the OK button, Post Button Clicked event.
l y
3. Create an event rule to start the workflow process only if the work order type is equal
to 3.
n
Results
e O
The bolded lines show the event rules to disable the WOACTRULES workflow
s
process and to start the workflow process only if the work order type is equal to 3.
U
FORM: I
=======================================================================
A
PROJECT TASK DETAILS [FIX INSPECT] (P55482xx)
O
=======================================================================
CONTROL: HYPITEM &OK
EVENT:
l &
Post Button Clicked
n a
-----------------------------------------------------------------------
Show Control (FC Pre Order Number)
te r
If SV Form_Mode is not equal to CO ADD_MODE And VA
frm_cX4801ErrorCode_ERRC is not equal to “1,2”
I nEnd If
Press Button(HC &Cancel)
c l e //
// Call Workflow
r a //
O
If SV Form_Mode is equal to CO ADD_MODE Or SV Form_Mode is equal to CO
COPY_MODE
If FC Type is equal to “3”
! Start Process(WOACTRULES, <Mapped, <Mapped>)
End If
End If
If SV Form_Mode is equal to CO UPDATE_MODE
If FC Type is equal to “3”
! Start Process(WOACTRULES, <Mapped, <Mapped>)
End If
4. Enter the event rules to start the K5601<last two digits of your user ID> Capital
Projects Approval workflow process as follows.
e. Enter K5601<last two digits of your user ID> in the QBE column.
f. Click Find.
g. Double-click to select the K5601<last two digits of your user ID> process.
h. Click OK.
e O
WorkOrderNumber
U s
A I
k. For Additional Data Structure, double-click <Define Mapping>.
l.
O
On Data Structure Mapping, enter the following information:
Value
na
FC Type Æ WorkOrderType (cTypeWO)
FC Business Unit
e r Æ ChargetoBU (szCostCenter)
nt
FC Est. Amount Æ EstimatedAmount (mnAmountOriginalDollars)
e I
FC Originator
FC Status
Æ
Æ
OriginatorNumber (mnAddNoOriginator)
WorkOrderStatus (szStatusCodeWO)
c l
<NOT Assigned> 0 ApprovalActionCode (cApprovalActionCode)
r a
O
n. Click OK.
Results
The bolded line shows the event rules to start the K5601<last two digits of your
user ID> workflow process.
=====================================================================
FORM: PROJECT TASK DETAILS [FIX INSPECT] (P55482xx)
=====================================================================
CONTROL: HYPITEM &OK
EVENT: Post Button Clicked
---------------------------------------------------------------------
Show Control (FC Pre Order Number)
If SV Form_Mode is not equal to CO ADD_MODE And VA
frm_cX4801ErrorCode_ERRC is not equal to “1,2”
Press Button(HC &Cancel)
End If
n l y
//
// Call Workflow
e O
//
U s
If SV Form_Mode is equal to CO ADD_MODE Or SV Form_Mode is equal to
I
CO COPY_MODE
A
If FC Type is equal to “3”
Start Process(K5601xx, <Mapped>, <Mapped>)
!
O
Start Process(WOACTRULES, <Mapped, <Mapped>)
End If
End If
l &
a
If SV Form_Mode is equal to CO UPDATE_MODE
n
BC
te r
If VA frm_mnOriginalAmount_AMTO is not equal to BC Amount –
Estimated(F4801) Or VA frm_szOriginalStatus_SRST is not equal to
O End If
End If
This form sends the originator the Pending message when the work order enters the
workflow process. No values are passed.
c. Click Select.
e. Click OK.
Results
The bolded lines show the event rule to create a form interconnect to the
Workflow Pending Review Notification form (P98805, Form W98805B).
=====================================================================
FORM: PROJECT TASK DETAILS [FIX INSPECT] (P55482xx)
=====================================================================
CONTROL: HYPITEM &OK
EVENT: Post Button Clicked
---------------------------------------------------------------------
Show Control (FC Pre Order Number)
If SV Form_Mode is not equal to CO ADD_MODE And VA
n l y
frm_cX4801ErrorCode_ERRC is not equal to “1,2”
Press Button(HC &Cancel)
e O
End If
//
U s
// Call Workflow
//
A I
O
If SV Form_Mode is equal to CO ADD_MODE Or SV Form_Mode is equal to
CO COPY_MODE
&
If FC Type is equal to “3”
l
a
Start Process(K5601xx, <Mapped>, <Mapped>)
!
r n
Call(App:P98805, Form W98805B)
Start Process(WOACTRULES, <Mapped, <Mapped>)
I n te
End If
End If
If SV Form_Mode is equal to CO UPDATE_MODE
r a BC
Status Code W.O.(F4801)
End If
End If
End If
f. Save your changes and exit P56482<last two digits of your user ID> to return to
Object Management Workbench.
6. Click P56481<last two digits of your user ID> Work With Work Orders and then
click Design.
7. Change the event rules to call the P56482<last two digits of your user ID> Project
Task Details form. Use the following steps:
Results
The bolded line shows the event rule that assigns the processing option to call the
Project Task Details form.
=====================================================================
FORM: WORK WITH WORK ORDERS [FIND BROWSE] (W55481xxA)
=====================================================================
CONTROL: FORM
EVENT: Dialog is Initialized
l
---------------------------------------------------------------------
//==============================================================
n y
// Revisions Log
e O
//==============================================================
l &
//-------------------------------------------------------------------
If PO CategoriesWorkOrder001 is not equal to <Blank> And PO
a
CategoriesWorkOrder001 is not equal to <Null>
n
te r
b. On the Add button -- Button Clicked event, locate the Call Simple Work Order
I n Entry section.
Results
The bolded lines show the event rules to disable the form interconnect to P48014
and add a form interconnect to P56482<last two digits of your user ID> Project
Task Details.
=====================================================================
FORM: WORK WITH WORK ORDERS [FIND BROWSE] (P55481xx)
=====================================================================
CONTROL: HYPITEM &Add
EVENT: Button Clicked
---------------------------------------------------------------------
//===============================================================
// Call Work Order Entry
//===============================================================
.
.
//===============================================================
// Call Simple Work Order Entry
//===============================================================
If PO Work Order Program is equal to “2”
Check Object Version
If VA frm_cVersionExists_EV01 is not equal to “1”
Set Control Error(HC &Add, “016F”)
Stop Processing
End If
n l y
O
! Call(App:P48014, Form:W48014A)
Call(App:P55482xx, Form:W55482xxA)
End If
//
s e
I U
e. Save your changes and then exit Form Design Aid.
l &
n a
1. To create an address book record for the Accounting department, select Address
Book Revisions on menu G01:
te r
a. On menu G01, select Address Book Revisions.
I n
b. On the Work With Addresses form, click Add.
cle c. Create an address book record using the values shown in the Activity Overview.
O ra d. Click OK.
Note. Ignore the warning message for the Payables field on the Additional tab.
e. Click OK again.
a. Use Fast Path UDC or menu GH9011 to access User Defined Codes and to add a
new structure type to UDC 01/TS.
b. Use Fast Path UDC or menu GH9011 to access Work With User Defined Codes.
c. Type 01 for Product Code and TS for User Defined Codes and then click Find.
d. Click Add.
e. On the User Defined Codes form, complete the last row in the detail area as
specified in the Activity Overview.
f. Click OK.
e O
112<last two digits of your user ID>
Structure Type
U s
W<last two digits of your user ID>
First Response
O Selected
l&
Higher Level Override Selected
na
Authorization Required Selected
e r
I nt
d. Enter the members of the distribution list and their threshold values, and then
c l e
Results
assign them to the appropriate groups.
g. The distribution list tree structure should display, showing all the members.
n l y
a. In OMW, select the K5601<last two digits of your user ID> workflow process in
the Capital Projects Approval project.
b. Click Design.
e O
U
c. On the Design Tools form, click Workflow Modeler. s
I
d. Right-click the ASKAPRVL task and select Event Rules.
A
O
e. To change the recipient from 1001 to 112<last two digits of your user ID>, select
Literal and enter 112<last two digits of your user ID>.
f.
l &
Change the structure type from <Single Recipient> to <Capital Projects <last
a
two digits of your user ID>>.
n
te r
g. Click OK to return to the Workflow Modeler workspace.
I n
h. Save and exit from Workflow Modeler.
c le
5. On the Design Tools form, click Validate Workflow.
1. In OMW, select the K5601<last two digits of your user ID> workflow process in the
Capital Projects Approval project.
2. Click Design.
n l y
6. Click OK.
e O
Operator Left Operand Comparison
s
7. On the Criteria Design form, enter the following information:
U Right Operand
If BF szChargetoBU
A I
Is equal to “ 1, 9”
O
l &
8. Click OK twice to return to Workflow Modeler.
I n
1. Right-click the background of the Workflow Modeler diagram, select Recipient
O Process
Version
K5601<last two digits of your user ID>
1
Rule BUNOT1OR9
3. Click OK.
2. On the Workflow Recipient Rule Revisions form, enter the following information: n l y
Recipient Condition Address Book Number Description
e O Structure Type
BU1OR9 112<last two digits of your
user ID>
U s
Accounting Department
<last two digits of your
W<last two digits
of your user ID>
BUNOT1OR9 4800
A I user ID>
Josephson, Michael
O
3. Click OK.
l &
n a
r
This concludes the activity. Do not continue.
te
I n
c le
r a
O
Course Review
This lesson has no activities.
n l y
e O
U s
A I
O
l &
n a
te r
I n
c l e
r a
O
Notes
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
l y
______________________________________________________________________
n
O
______________________________________________________________________
e
s
______________________________________________________________________
U
I
______________________________________________________________________
A
O
______________________________________________________________________
l &
______________________________________________________________________
n a
r
______________________________________________________________________
te
I n
______________________________________________________________________
cle ______________________________________________________________________
r a ______________________________________________________________________
O ______________________________________________________________________