copyright © 2012. infor. all rights reserved. practices with enterprise... · copyright © 2012....

33
1 Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Upload: trinhcong

Post on 28-Apr-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

1Copyright © 2012. Infor. All Rights Reserved. www.infor.com

2Copyright © 2012. Infor. All Rights Reserved. www.infor.comCopyright © 2012. Infor. All Rights Reserved. www.infor.com 2

Best Practices with Enterprise Integrator –Intermediate Level

Buddy Bates, Senior Consultant

Guide Technologies, LLC

3Copyright © 2012. Infor. All Rights Reserved. www.infor.comCopyright © 2012. Infor. All Rights Reserved. www.infor.com 3

Customizing the User InterfaceBuddy Bates, Senior Consultant

Guide Technologies, LLC

4Copyright © 2012. Infor. All Rights Reserved. www.infor.com

• Combine attributes and lists

• Create compound cards within compound cards for complex interface

• See R9 Item Revision for a good example

Compound Cards

5Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Best Practice

• Create a Card for each section

• Remember not everyone has the same screen resolution as you

• Use as a layout tool when an object has multiple categories of attributes to group together

Compound Cards

6Copyright © 2012. Infor. All Rights Reserved. www.infor.com

• Multiple workspaces on the same object for different functions

• When adding an object to an application card choose the appropriate workspace

• Build as many as you need for different groups using the same object

Workspaces – combined query components and more

7Copyright © 2012. Infor. All Rights Reserved. www.infor.com

• When objects have workspaces with the same name, the workspace is inherited when browsing from one object to the next

• Control Menu options

• Specify the view subset and sort when “Finding” a related object

• Subset options is particularly useful

Workspaces – advanced features

8Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Best Practice

• One version of the truth

• Designing a workspace properly may prevent each user from customizing their own interface and potentially working from different data

• Use presentation schemes to highlight important patterns in the data

Workspaces

9Copyright © 2012. Infor. All Rights Reserved. www.infor.comCopyright © 2012. Infor. All Rights Reserved. www.infor.com 9

Customizing the DataBuddy Bates, Senior Consultant

Guide Technologies, LLC

10Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Custom Business Objects –preaching to the choir• Start with a good Entity Relationship Diagram (ERD)

• Properly normalize data (minimize redundancy and dependency)

• Plan your table relationships carefully

• Best to plan and design in advance

• Relationships give you a wealth of built-in functionality; take advantage of that!

11Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Custom Business Objects - designBest Practices

• When designing your application remember the 2 degrees of separation rule

• Only direct “Many to 1” related objects are available as attributes on views/cards. Can not use attributes from Parent’s Parent

• Use an overview card to address this problem if possible

• Logical attributes may help

• Properly normalizing today allows easier customization tomorrow

• Subset detail records to find all “Foo Bars” with color = red and mass change to inactive vs. hard coding this logic in a program

12Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Custom Business Objects - design

13Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Relationship Action• Used when related data can not be permanently stored in a table

• Examples

• Intranet page with a list of current projects

• Currently active jobs in a subsystem

• If you can write a program to collect the data real time, then you can present it to the user

• Only available on “1-to-Many” relationships

14Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Relationship Action – User Perspective

What the user sees

What really happens

15Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Relationship Action – getting started• Define a business object just like you normally would

• Create the file in a library that will be in the library list

• Define the business object

• Define attributes and attribute classes

• Define relationships to objects

• This is just a normal business object (usually non-maintainable)

• Data is usually temporary

• File being populated usually resides in QTEMP

16Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Relationship Action – programming• Write a program to populate the table

• Usually accepts parameters from related “parent” business object

• Create a copy of the file in QTEMP*

• Populate table with data

• Remember you may want to view your new business object from many related objects, so design your program accordingly

* QTEMP is normally needed to prevent different users from interfering with each other’s temporary data.

17Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Relationship Action – define the action• Define in “Parent” business object

18Copyright © 2012. Infor. All Rights Reserved. www.infor.comCopyright © 2012. Infor. All Rights Reserved. www.infor.com 18

Customizing the LogicBuddy Bates, Senior Consultant

Guide Technologies, LLC

19Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User ExitsBest Practices

• Add meaningful text to the beginning of the Call Description

• Change the Call Program Type if you love SQL like me

• Re-generate each time you modify the program so that the Source tab shows current revisions

20Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – code reuseBest Practices

• Write callable programs or modules and call from within your user exit

• Use subroutine and procedure User Sections of your user exit to avoid copy paste code

• Use Infor APIs when possible to avoid duplicating business logic

• e.g. Get item revision information from program UMVIMH0R

• Put custom code in the provided areas

• You will lose custom code

21Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – code placement

0015.10 C*

0015.11 C M_P$RTVR IFNE '*YES'

0015.12 C*

0015.13 C*---------------------------------------------------------------- *

0015.14 C* Default logic for field RCITNO *

0015.15 C* @@@@ - Insert here the custom default logic for the attribute. *

0015.16 C*---------------------------------------------------------------- *

0015.17 C* START USER PROTECTED SECTION - SECQ0R 0010.000 / *USR / RCITNO

0015.18 /Free

0015.19 If URCITNO = ' ';

0015.20 URCITNO - MKEY001 + %subst(MKEY002:1:12);

0015.21 EndIf;

0015.22 /End-Free

0015.23 C* FINISH USER PROTECTED SECTION - SECQ0R 0010.000

0015.24 C*---------------------------------------------------------------- *

0015.25 C*

0015.26 C ENDIF

0015.27 C*

0015.28 C* Convert TRNDTA format, if called by client.

0015.29 C*

0015.30 C P#CLPR IFEQ '*CLTAPI '

0015.31 C uRCITNO ANDNE *BLANKS

0015.32 C MOVEL '*YES ' W#PFPR

Insert your logic between the

START and FINISH lines

Best Practices

22Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – Some of the provided areas• Maintenance history –

• Identify your modification and mod mark changes (Best Practice)

• File definitions

• Data definitions

• Input specifications

• Variable definitions

• Change logic

• Delete logic

• Integrator fields

• Initialization considerations

• Open considerations

• Subroutines and compile time array data

23Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – debugging• Get Job information for Power-Link Job

• Help | About or File | Summary Info

• Press Ctrl+D (D=Diagnostics)

• Select Proc Connection button

• Scroll to top of the presented window and highlight first record job information (this list represents your job’s log)

• Right click and copy to clipboard

• Start a service job

• STRSRVJOB jobNumber/User/jobName

• Start debugging your user exit

• STRDBG UXXXXN0R UPDPROD(*YES)

• Be aware that some user exits run in batch mode

24Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – Diagnostics Screen

25Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Exits – debugging

26Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Beyond Business Objects• Sometimes you need an application to do

more than what is built into the Integrator Business Object

• Options

• Logical Transaction

• Transaction

• Host Print/ Host Job

• User Action

…and

beyond!

27Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Logical Transactions• Highlight Change, Create, Delete transaction and click new

• Can define a subset of attributes to use for the logical transaction

• Special transaction type is defined in the Business Object user exits for processing a logical transaction

• Check mTRID variable to determine if your logical transaction is running in case the logic is different

28Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Transactions• Just like a Business Object but without the table

• Apply Defaults and Edit Buffer

• Perform transaction work in Process Buffer user exit

• Transactions can be performed against selected records in a list, or from a card file

• Even if multiple selections are active in a list the user must submit each transaction individually

• Define Attributes and relationships

• Attributes can have classes like Date, Time, Warehouse, etc.

29Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Host Print/Host Job• Host processes perform an action for each record in a list

• User chooses between current subset, selected records, etc.

• Host Print

• Creates a spool file with key data by default

• Modify user exits to perform some report output for each record

• Host Job

• User section to perform logic for each record

• Just like host print without the spool file

• Use the Process Buffer user exit to perform per/record logic

30Copyright © 2012. Infor. All Rights Reserved. www.infor.com

User Actions• Program

• Host Program – System i program call

• Local Program – PC program call

• Define Attributes and relationships

• Attributes can *NOT* have classes like Date, Time, Warehouse, etc.

31Copyright © 2012. Infor. All Rights Reserved. www.infor.com

Which Method to Use

I want to… Use Note

Change just one/two fields in my

business object (e.g.

Activate/Deactivate)

Logical TransactionUses the Business object user

exits

Perform some function on related data Transaction

Processing one at a time. Edits,

Attributes with classes, etc. all

available

Perform some function on related data

for many rowsHost Job

User only has to click and enter

values once. Shows under File |

Status

Perform some function on the local PC User Action | Local ProgramOnly supported way to run code on

the user’s PC

Perform a simple operation on the

iSeriesUser Action | Host Program

Rarely is a function simple enough

and guaranteed to remain that way

– use a Transaction

Best Practice

32Copyright © 2012. Infor. All Rights Reserved. www.infor.comCopyright © 2012. Infor. All Rights Reserved. www.infor.com 32

Special thanks:Josh Diggs, Senior Consultant

Guide Technologies, LLC

33Copyright © 2012. Infor. All Rights Reserved. www.infor.com