BPM and Web Dynpro for Java Integration – Guidelines · PDF fileRecommendations, best...
Transcript of BPM and Web Dynpro for Java Integration – Guidelines · PDF fileRecommendations, best...
BPM and Web Dynpro for JavaIntegration – Guidelines
June, 2009
Team Members : Sunil NairSAP NetWeaver RIG APJ
Makoto SugishitaSAP NetWeaver RIG APJ
© SAP 2009 / SAP NW RIG APJ Page 2
Disclaimer
This presentation outlines our general product direction and should not be relied on inmaking a purchase decision. This presentation is not subject to your licenseagreement or any other agreement with SAP. SAP has no obligation to pursue anycourse of business outlined in this presentation or to develop or release anyfunctionality mentioned in this presentation. This presentation and SAP's strategy andpossible future developments are subject to change and may be changed by SAP atany time for any reason without notice. This document is provided without a warrantyof any kind, either express or implied, including but not limited to, the impliedwarranties of merchantability, fitness for a particular purpose, or non-infringement.SAP assumes no responsibility for errors or omissions in this document, except ifsuch damages were caused by SAP intentionally or grossly negligent.
© SAP 2009 / SAP NW RIG APJ Page 3
Content
Overview – Business Process Management
Overview – Web Dynpro for Java
Integrate Web Dynpro Java with Business Process ManagementHow to embed WebDynpro into Business Process Management – Step by Step
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & donts
Important SAP Notes and links
User Interface and Human Activity
Business Process Desk
Task Execution User Interface
Model Based Business Process Management
Composite Business Process
Business Process Modeling Notation (BPMN)
At a glance
Web Dynpro Tools and Code Generation
Web Dynpro DC
Web Dynpro Component and Componentization
Context Mapping and UI Element Binding
© SAP 2009 / SAP NW RIG APJ Page 4
Model-Based Business Process Management
Composition Environment 7.1 EHP1
Process Integration 7.1 EHP1
SAP ApplicationCore Processes
BusinessObject
BusinessObject
Non SAPB2B
SOA DesignGovernance
SAPNetWeaver7.1 EHP1
Human-CentricExecutable modelsProcess collaborationHuman interaction management
System-CentricExecutable modelsProcess automationService and event infrastructure
Packaged ProcessesDescriptive modelsEmbedded workflowExpose services / events
© SAP 2009 / SAP NW RIG APJ Page 5
Graphical modeler based onBPMN
Eclipse-basedSupport key process concepts(workflow, event, task, context, roles,UI) throughout their lifecycleCombine human interaction andsystem integration in one model
Direct path from business viewto process execution
Nothing ‘lost in translation’Dynamic role-based viewsSingle active modelFlexible execution
Embedded in SAP NetWeaver CEIntegrated composition experienceCommon UI technologyService-based connectivity
ProcessComposer
ProcessDesk
Process Server
Characteristics
Composite Business Processes
© SAP 2009 / SAP NW RIG APJ Page 6
BPMN – Sequence Flow Overview
A step in the processRepresents work or action performed
Controls flow branching, merging and parallel actionsPure logic – does not do the decision itself
A signal that „something has happened“Can start, pause and resume or interrupt andredirect a process or activity
Activity
Gateway
Event
© SAP 2009 / SAP NW RIG APJ Page 7
BPMN – Type of Activities
Activity that has to be processed by a naturalPerson
Activity that is processed by a system
A compound (decomposable) Activity that holds asub-process modeled with BPMN – can be showncollapsed or expanded
Human Activity
Automated Activity
Sub-process
© SAP 2009 / SAP NW RIG APJ Page 8
BPM Process Desk
Status Information
Delegating or revokingtask
Attaching notes orfiles to the active taskor the whole process
Process view forshowing processruntime information
BPM Toolbar
1/2
© SAP 2009 / SAP NW RIG APJ Page 9
BPM Process Desk
The Process Desk is the interaction layer between the user and process.
Process Tasks assigned to a user show up in the UWL of the Portal.
Tasks are displayed in the Task Execution User Interface
2/2
© SAP 2009 / SAP NW RIG APJ Page 10
Tasks are displayed in the task viewer User InterfaceEmbeds the Web Dynpro assigned to the task at design time
1
Assigned WebDynproComponent User Interface
Task Execution User InterfaceConstruction
© SAP 2009 / SAP NW RIG APJ Page 11
Can be added to tasks only at runtime
Task Execution User InterfaceAttachments and Notes 2
Viewable in proceeding tasks of the same process instance
© SAP 2009 / SAP NW RIG APJ Page 12
Process Template can be displayed
3
Current user sees current steps within the process
Task Execution User InterfaceProcess Template
© SAP 2009 / SAP NW RIG APJ Page 13
Content
Overview – Business Process Management
Overview – WebDynpro for Java
Integrate WebDynpro Java with Business Process ManagementHow to embed WebDynpro into Business Process Management – Step by Step
Guidelines for WebDynpro DevelopmentRecommendations, best practices, dos & donts
Important SAP Notes and links
User Interface and Human Activity
Business Process Desk
Task Execution User Interface
Model Based Business Process Management
Composite Business Process
Business Process Modeling Notation (BPMN)
At a glance
Web Dynpro Tools and Code Generation
Web Dynpro DC
Web Dynpro Component and Componentization
Context Mapping and UI Element Binding
© SAP 2009 / SAP NW RIG APJ Page 14
At a glance
SAP NetWeaver UI Technology for developing data-driven web applications
Use of declarative and graphical tools reduces the implementation effort
Offers the following advantages for application developers:
Enforces separation of business logic and display logicDeclarative UI development independent of client technology (like web browser, smartclient, mobile device)Uniform metamodel for all types of user interfacesComprehensive library with standard, complex and graphical UI elementsConnectivity to backend systems using, for example, web services, EnterpriseJavaBeans, and adaptive RFCAccessibility supportAdobe Forms integrationThe pages created by WebDynpro can be personalized, user or roles basedYou have the choice to work with visual models or code editors
© SAP 2009 / SAP NW RIG APJ Page 15
WebDynpro Tools and Code Generation
Data Modeler : Sharing data between classes within a componentNavigation Modeler : Creation of navigation links between different UI viewsView Designer : Define the layout and data sources of UI elementsController Editor : Define data storage, instance methods, events, navigation plugs and actionsMessage Editor : Message and text string definitionModel Importer : Wizards to create various types of model object
A glance at Web Dynpro Tools
Support design and development process for UIs and entire applicationsUse of declarative and graphical tools reduces the implementation effortReduces coding efforts by generating entities based on defined meta-data
Source Code Generation for Controller Classes and InterfacesClasses contain user coding areas where additional code can be implementedInterfaces for context objects (typed nodes and node elements)Interfaces for message textsModel classes
© SAP 2009 / SAP NW RIG APJ Page 16
Web Dynpro Development Component (DC)
Development and build unit
Basic reusable units of an applicationOne DC can use another DC by referring to the public interfaces (publicparts)
Web DC comprises ofWeb Dynpro-specific developments, such as Web Dynpro components,models, component interfaces, views, and so onProvides storage buffer for DC metadata which serves to defineapplication relationships between different DCs
Relation between Web Dynpro DC and Web Dynpro Component
© SAP 2009 / SAP NW RIG APJ Page 17
1/2Web Dynpro Component and ComponentizationOverview
Fundamental building block from which all applications are constructed
Basic unit of development and reuse
Atleast one Web Dynpro Component in a Web Dynpro applicationApplications used to implement real-life business scenarios are frequentlyconstructed from a hierarchy of multiple components
An aggregation of independent, yet interrelated Java classes
General Architecture of Web Dynpro Component
Component Controller : Master Controller generated automatically
Custom Controller : Similar but created by explicit design time declaration
Component Interface : Defines set of publicly accessible entry points
Window : Atleast one view and default interface with which user interacts
View : Visual component inside a window with which a user interacts
Model : Provides access to functionality such as BAPI calls or Web services
Application : Defines an entry point into a Web Dynpro component
© SAP 2009 / SAP NW RIG APJ Page 18
2/2Web Dynpro Component and ComponentizationDividing Business Functionality into Components
Focus on implementing the functionality using reusable Web Dynpro components
Focus on reusable Web Dynpro components, not onthe web pages
Component HierarchyRoot Component
Deliver functionality of entire Web Dynpro business application, and can‘t be reused individually.Manage creation, destruction and interaction of child component instancesEntry point into business functionality and cannot be faceless
Intermediate ComponentPerforms specific role within the scope of Web Dynpro applicationDesigned to function within scope of single business application and hence not suitable for reuse
Utility and Model ComponentUtility Component : Small and frequently used units of functionalityProvides access to functionality such as BAPI calls or Web services
© SAP 2009 / SAP NW RIG APJ Page 19
Context Mapping and UI Element Binding
Share data between controllers
Data Storage and consistency
UI Element BindingContext Mapping
Putting data on the screen
Data binding enables interactionbetween UI elements and contextelements
Changes of UI element are transferredto context and vice versa
© SAP 2009 / SAP NW RIG APJ Page 20
Context Mapping and UI Element BindingPutting it all together: From model to screen
Data passes from the model object to the screen using this chain of connections:
The context of the component controller is bound to the model objectThe view controller context is mapped to the component controller contextThe UI elements are bound to the view controller’s context
© SAP 2009 / SAP NW RIG APJ Page 21
Content
Overview – Business Process Management
Overview – Web Dynpro for Java
Integrate Web Dynpro Java with Business Process ManagementHow to embed WebDynpro into Business Process Management – Step by Step
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & donts
Important SAP Notes and links
User Interface and Human Activity
Business Process Desk
Task Execution User Interface
Model Based Business Process Management
Composite Business Process
Business Process Modeling Notation (BPMN)
At a glance
Web Dynpro Tools and Code Generation
Web Dynpro DC
Web Dynpro Component and Componentization
Context Mapping and UI Element Binding
© SAP 2009 / SAP NW RIG APJ Page 22
Define Complete Event in ComponentController and expose it to theInterface Controller
Expose needed context structurefrom Component Controller to theInterface Controller (only contextstructure needed by BPM processmust be exposed)
Fire Complete Event in theComponent Controller (indicatesBPM, that UI task is completed byend user)
Add Web Dynpro Component to PublicPart and set Dependency
Modify BPM ProjectCreate BPM Task and assign UI to that
Map WebDynpro Context to Data Object
Web Dynpro Component
Interface Controller
Component Controller
1
Event
Event
2
3
BPM Task(Web Dynpro Component)
4
5
Integrate Web Dynpro Java with BPMOverview
© SAP 2009 / SAP NW RIG APJ Page 23
Web Dynpro Component ControllerDefine the following Event(s) in ComponentController. You can use arbitrary name for theseevents.
CompleteError (optional)
Web Dynpro Local ComponentInterface Controller
Create the events within Web DynproLocal Component Interface forcommunicating with SAP NetWeaverBPM by pasting the ComponentController Event(s).
Create Event and copy it to Interface Controller1
You can Copy Paste Events from ComponentController to Interface Controller
© SAP 2009 / SAP NW RIG APJ Page 24
Expose Context Structure to Interface Controller
Web Dynpro Component ControllerUse only “built-in” data types for context attributes
Web Dynpro Local ComponentInterface Controller
Only context nodes defined at designtime are visible to SAP NetWeaver BPM
You can Copy Paste Context Structurefrom Component Controller to InterfaceController
2
© SAP 2009 / SAP NW RIG APJ Page 25
Web Dynpro ComponentController
Create methods within Web DynproComponent Controller for firing“Complete” and/or “Error” events
Then bind this method for example toan ActionButton
Fire Complete Event in Component Controller3
© SAP 2009 / SAP NW RIG APJ Page 26
Add Web Dynpro Component to Public Part andSet Dependency
Web Dynpro Component ControllerAdd to Public Part
Development Infrastructure perspectiveSet dependency between Development Componentof SAP NetWeaver BPM and Web Dynpro
4
© SAP 2009 / SAP NW RIG APJ Page 27
Modify BPM projectCreate Task for Human Activity and assign UI
Create a task within SAP NetWeaver BPM
5
Maintain Tasks with additional Information about roles and behaviorImport Web Dynpro Component and assign User Interface to Task
© SAP 2009 / SAP NW RIG APJ Page 28
Modify BPM projectAssign Task to Process Model and Map data
Assign Task in property window of human activity
6
Web Dynpro Contexts are shown in the mapping
© SAP 2009 / SAP NW RIG APJ Page 29
Appendix: Runtime BehaviorCompletion Event and Error Event
By triggering the Event for“Completion”,
The human activity completes
Dialog pops up asking whether to closethe window of the BPM task.
By triggering the Event for“Error”,
The process became the error status (Youcan change the status back in NWA)
Error message appears
© SAP 2009 / SAP NW RIG APJ Page 30
Content
Overview – Business Process Management
Overview – Web Dynpro for Java
Integrate Web Dynpro Java with Business Process ManagementHow to embed WebDynpro into Business Process Management – Step by Step
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & don’t’s
Important SAP Notes and links
User Interface and Human Activity
Business Process Desk
Task Execution User Interface
Model Based Business Process Management
Composite Business Process
Business Process Modeling Notation (BPMN)
At a glance
Web Dynpro Tools and Code Generation
Web Dynpro DC
Web Dynpro Component and Componentization
Context Mapping and UI Element Binding
© SAP 2009 / SAP NW RIG APJ Page 31
task task
BPM
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & don'ts
Recommendations for storing business dataVolume of data low and process is small, you may want to pass and store the entiredata into BPM Context. Nevertheless, BPM has no restrictions on data volume.It is recommended that you pass only the key to the BPM and get updated data
BPM stores instance specific data only till the process is alive and the data is neededFor processes that are very long and the data is expected to change frequently duringthe process execution, then pass the key and fetch the updated informationExternal data store is if user wants to save the temporary dataTake into consideration the supported and unsupported data types (see next slide)
RecommendedOnly for simple scenario
WDModel
Otherdata
Web Dynpro
Entire Data
Web Dynpro
Entire Data
Web Dynpro
task task
BPM
Key Key
Otherdata
Web Dynpro
© SAP 2009 / SAP NW RIG APJ Page 32
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & don'ts
Built-In SimpleTypes: binary, boolean, byte, date, decimal, double,float, integer, long, short, string, time, time stamp
Supported Data Types
Reverse Context MappingWeb Dynpro component’s interface controller context nodes have the property InputElement set to true. This property must be set to false.
Model BindingWeb Dynpro component’s interface controller context nodes, which are bound to WebDynpro model (CMI) are instantiated after the point in time when BPM can access WebDynpro context. Due to this the use of Web Dynpro context nodes, which are bound toused model are not supported.
Dynamic Context Structure ModificationFor creation of runtime data, mappings and rules, BPM takes Web Dynpro component’sstructure from introspection of component at design time
Limitations with CE7.1.1
Dictionary types (predefined types, for example, currency), coredata types (for example, amount, duration, attachment), Java nativetypes
Non Supported Data Types
© SAP 2009 / SAP NW RIG APJ Page 33
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & don'ts
UI for each task should be user friendly. The end user should be able to understandwhat user actions are necessary to compete the task, otherwise the user mightmove to other operation without completing the taskDisplay all necessary information that is required to complete the task on thescreenAvoid UI Transitions that confuse the end users. However, UI transition in a Task issometimes necessary because putting consecutive human task works differently asthe modeler expected (see below)It’s better to validate data in UI screen if possible, in order to avoid the redundanthuman work, e.g. rejectReusability should be considered
If you model several consecutive human tasks, theuser has to complete the first task, refresh UWLand open the second task from inbox again, evenwhen the same user processes those tasks
The behavior of NW BPM is not identical as that ofGuided Procedure
Recommendation on Web Dynpro UI Design
© SAP 2009 / SAP NW RIG APJ Page 34
Guidelines for Web Dynpro DevelopmentRecommendations, best practices, dos & don'ts
Developer’s choice or as per organizational development guidelinesOne Process DC per process with WD DC having one WD Component for each taskor human activity. Additionally, can have WD Utility DC whenever neededReuse tasks, UIs, Interfaces etc. Whole SOA is based on reusability
Request and Approve/Reject Screens can be reused with true/false flags
No restrictions as long as the end user is comfortableTypically, medium size processes can have 6-7 Human Activities i.e. UI screensVery Long processes can have 10 – 15 Human ActivitiesBetter to cut the processes into smaller chunks, better reusability and maintenance
Recommendation on Process Design
Recommendation on DC and WD Component Design
© SAP 2009 / SAP NW RIG APJ Page 35
Guidelines for Web Dynpro DevelopmentImportant SAP Notes and links
SAP Notes
Links
SAP NetWeaver CE7.1 Enhancement Package 1 Library – Modeling Processes(http://help.sap.com/saphelp_nwce711/helpdata/en/ce/19dc55105b46a0b498af9d840a93a8/frameset.htm)
SAP NetWeaver BPM Troubleshooting Guide(https://www.sdn.sap.com/irj/scn/wiki?path=/display/BPMT/Home)
SAP NetWeaver BPM : Flash Island Meets BPM(https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9006a1ee-7410-2c10-66a0-e6214bba38e4)
SAP NetWeaver BPM Resource Center(https://www.sdn.sap.com/irj/sdn/nw-bpm-info)
SAP Business Process Management on SDN(https://www.sdn.sap.com/irj/sdn/nw-bpm)
Note 1263355 - Task UI Integration Limitations
Note 1266539 - XSD-related limitations for SAP NetWeaver
© SAP 2009 / SAP NW RIG APJ Page 36
THANK YOU FOR YOURATTENTION !
QUESTIONS – SUGGESTIONS – DISCUSSION