Upload
lenhi
View
217
Download
0
Embed Size (px)
Citation preview
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing with EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 4
What This Session Is About
This session…
… describes new features in the SAP Business Workflow areaWeb Application Server releases 620 to NetWeaver 2004S
… is not an introduction to SAP Business WorkflowYou have to be familiar with SAP Business Workflow to fully profit from this session
… covers a lot of different independent topicsIt should give you an overview and a first impression of the newconceptsMore details can be found
in the slide notesin the appendixin the documentation
… is about technology, not about real-world scenarios
© SAP AG 2006, 5
Release Dependency
New workflow features introduced in this presentation are associated with the Web Application Server release they are first available in
The release number is highlighted in the upper right corner of each slide
NW04S
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and Blocks Dealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 7
Re-implementation of the Container 6.20
Complete reimplementation of container technology
No restrictions concerning data typesDDIC types with arbitrary lengthsBinary dataStructures with arbitrary depth and complexityABAP OO references
Container is by default stored as XML documentFacilitates diversity of supported data typesSaves storage space (especially for large containers/structures)
No database entry for each structure field required anymoreEntails serialisation / deserialisation effort
Old container persistence (SWCONT, SWCONTOB) still supportedCompatibility modeWorkflow Builder setting ( Appendix)
© SAP AG 2006, 8
Parameter Container Interface
The old container was represented as an internal tableManipulating the container meant using awkward container macros
The new container implementation is ABAP Objects based
A (released) API is provided for reading an manipulating container datathe ABAP Objects interface IF_SWF_IFS_PARAMETER_CONTAINER
This interface represents the container already in a number of workflow APIs (and will get more ubiquitous from release to release)
IF_SWF_IFS_PARAMETER_CONTAINER contains the following methods:
Delivers a list of names of all elementsLIST_NAMES
Sets the value of an elementSET
Delivers a reference to the value of an elementGET_VALUE_REF
Delivers the data type of an elementGET_TYPE
Delivers the value of an elementGET
Resets an element to its type-based initial valueCLEAR
DescriptionMethod
6.20
© SAP AG 2006, 9
Expressions
Expressions now provide index access to multi-line elements
Second order of first customer&customers[1].orders[2]&
Projection to a single column&table[].columnName&
Access to a component of a table line&table[index].columnName&
Access to an entire table line&table[index]&
Expressions can contain functional method calls to BOR or ABAP Objects The expression evaluates to the result value of the method It is possible to pass parametersMethods used in expressions must not have side effects
„Read only“ methodsNo database changes
%my_class.static_method( param1=&exp2& )%Static method&my_object.methodA( param1=&exp1&; param2=17 )&Instance method w parameters&my_object.get_value( )&Instance method w/o parameters
No more restrictions concerning data typesABAP-OO object referencesStringsNested structures
6.40
© SAP AG 2006, 10
New Binding Editor
target container
source container
import binding
export bindingbinding
instructions
drag & drop
drag & drop
drag & drop
6.20
© SAP AG 2006, 11
Binding Instructions
Source and Target of a binding instruction are expressionsAssigning a table line to a structure component is now possible (if compatible)
Several binding operators are availablefor expression to expression binding (as above)for container to container binding
The button lets you choose the right binding operator
source expression binding operator dataflow direction target expression
6.20
Merge (Copy all elements)Container to container
Assign value
Expression to expression Append to table
Programmed Binding (SWCONT)Programmed Binding (Container-IF)
XSLT TransformationInitialize
see Appendix for further cofiguration possibilities
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 13
Step Conditions 6.20
READY
CHECKED
SELECTED
STARTED
COMPLETED
CreateWork ItemConditionInstantiation
Execution
CompleteExecutionCondition
CompleteWork ItemCondition
see Appendix for further details
© SAP AG 2006, 14
SWITCH: The New Multiple Condition Flavor
1. Double-click on multiple condition icon
2. Select Multiple Condition Flavour
3. Enter Branches and Conditions
4. Name Default Branch
Each branch of the SWITCH carries a condition definition
The conditions are evaluated in the given order
The first branch whose condition evaluates to TRUEis taken
If none of the conditions evaluates to TRUE, a default branch is taken
Condition Editor
Condition 1 is TRUE
Condition 2 is TRUE
Default branch
6.40
© SAP AG 2006, 15
Blocks: Basic Features
Blocks…
are modeling elements
can contain other modeling elements
represent a data sub-contextall modeling elements within the block refer to this data context (binding, conditions, …)
have a data interface
have one start and one end node
are represented by block work items new work item type
can be deadline monitored (latest end only)
can catch exceptions ( see Appendix)
Start node
Block
End node
6.40
© SAP AG 2006, 16
Blocks: Work Item Hierarchy
Block items introduce new levels in work item hierarchies
Blocks can contain dependent work items
Blocks are represented as folders in the workflow log
Block structure is sustained at runtimeBlock is completed only if dependent work items are in a final stateIf a block is cancelled, all its dependent work items are cancelled, too
6.40
© SAP AG 2006, 17
Blocks: Data Context Properties
Every block has a containerNested blocks form nested data contexts
Parent relationships between containersWorkflow is the top level block
Parent context is visible within sub contextBindings can be defined from
the parent context to the sub context (Import binding at block instantiation)the sub context to the parent context (Export binding after block completion)
Blo
ck C
onta
iner
Wor
kflo
w C
onta
iner
Visi
bilit
y of
da
ta
Impo
rt
Bin
ding
Expo
rt
Bin
ding
Pare
nt
Con
tain
er
6.40
© SAP AG 2006, 18
Blocks: Dynamic Parallel Instantiation
Block instantiation can be dynamically controlled by multilinecontainer elements (ParForEach)
Similar to the „ParForEach“ dynamic parallel processing for activities!
For each entry in the multiline element, one block instance is createdCorresponding line data transported to the block context via binding
Process continues after the ParForEach block if eitherall instantiated parallel blocks are completed ora special join condition evaluates to TRUE after completion of a block
Block definition
+
Multilinecontainer element
:objectN
object2object1
= :
N parallel block instances
N
2
1
6.40
© SAP AG 2006, 19
Blocks: Dynamic Sequential Execution
Block execution can be dynamically controlled by multilinecontainer elements (ForEach)For each entry in the multiline element, the sequence of steps defined within the block is executed once
Only one block item is created!ForEach loop semantics
Process continues after the ForEach block if eitherall table entries are processed ora special condition evaluates to TRUE after completion of a loopsequence
Block definition
+
Multilinecontainer element
:objectN
object2object1
=
N block sequence cycles
…1 2 N
6.40
© SAP AG 2006, 20
Local Workflows
Local workflows…are control flow snippets
not part of the main process sequence
are just special blocksrepresented by block work items
are started via local eventsdata binding event – local flow
have full access to process datacan be instantiated an arbitrary number of timesare cancelled if still active when main process completes
3. Local event is raised
2. Exception is caught by block
1.Exception is raised
4. Local workflow is started
6.40
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 22
Workflow Header Events (1)
1. Select „Basic Data“
2. Select „Version-Dependent“
3. Select „Events“4. Enter event data
5. Choose receiver type
Conditions „Create Work Item“ and „Complete Work Item“ are evaluatedEvaluate Pre- and Postconditions
Agent determination of all active dialog work items is repeatedReevaluate Rules
The workflow instance is set to status CANCELLEDA new instance is started with the same data
Cancel and Restart Workflow
The workflow instance is set to status CANCELLEDCancel WorkflowReaction of Workflow to EventReceiver Type
The workflow instance can listen to eventsEvent couplings only exist if the corresponding object exists in the workflow container The receiver type tells you how the workflow processes the event
6.20
© SAP AG 2006, 23
Workflow Header Events (2)
A specified local event is triggeredThis local event could
start local workflowscomplete wait steps (event items)
see one of the next slides for the extended wait step!
Trigger Local Event
Event is delivered to existing appropriate wait step (event work item)If no active event work item exists, the event is parkedsee one of the next slides for parked events and the extended wait step!
Wait Step EventReaction of Workflow to EventReceiver Type
WAS 640 (NW04) offers you two new receiver types
6.40
© SAP AG 2006, 24
Parked Events (1) 6.40
event
Problem/Feature 1:
Workflow can only react on events ifappropriate wait step has already beeninstantiated
If event is raised „too early“, it is lost forthe processwait for
event
event
Problem/Feature 2:
Events always complete all correspondingactive wait step instances (event items)
token
© SAP AG 2006, 25
Parked Events (2) 6.40
event
parked eventsevent
parked eventsevent
consume parked event
The process instance can act as an intermediate event storage
If active receiver event items exists, the one created first receives the event
If no active receiver event item exists, the event is parked
The first matching event item created consumes the first event parked
In any case: One event is delivered to exactly one event item
See Appendix for further details
© SAP AG 2006, 26
workflow
Correlations (1)
Event couplings are created using
event name (design time information)
event object instance (run time information)
The object instance has to be known to theprocess
6.40
container
A
A
A
Problem: How to wait for events of yet unknown objects?
Knowing an object means knowing its key ( unique identifier)
But: objects can also be identified using semantic information
Goal: Wait for events of objects semantically coupled to objects known
knownobject
instantiate event item
© SAP AG 2006, 27
Correlations (2) 6.40
B
A
Correlations are objects which group other objects by semantic criteria (correlation key)
“objects having to do with each other”
correlationinstance
correlatedobject
instance
known object instance
Event couplings can also be created using
event name (design time information)
event object type (design time information)
correlation instance (run time information)
The object instance does not have to be known to the processbut at least one correlated object instance has toExample: know order to identify correlated invoice
© SAP AG 2006, 28
workflow
Correlations (3)
Correlations are instantiated using oneparticipating object instance
(semantic) correlation key has to be determined
Example: order ID
Wait step (event item) is instantiated using
correlation instance (semantic key)
object type
event
Example: wait for creation of invoice referring to known order
6.40
container
A knownobject
instantiate event item
Correlationinstance
A
instantiate correlation
B event
Event of unknown, yet correlated object is delivered to event item via the correlation instance
see Appendix for further details
© SAP AG 2006, 29
Wait for condition
SWWCOND
Wait for local eventWait for event using workflow
Wait for event
Wait Step: Four Different Flavours
Conventional wait step
Wait for global event
Correlations can be used
Condition specified in wait step
Evaluated by periodic background job SWWCOND
Wait for global event
received by workflow instance
dispatched to event item
Correlations can be used
eventevaluate condition
workflow instance
event
workflow instance
Local event
Wait for local event raised by trigger step within the same workflow instance
6.40
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 31
Boosting SBWP Performance
Means to improve SBWP performance have been provided
Scenarios that benefit most are
Many agents work on large pools of work items (e.g. call center scenario)
Large, slow work listsNecessity to often refresh the work list (due to work item „overlaps“)
Extensive usage of dynamic columnsparticularly with large work lists
Grouping of work items in large work lists using container dataGrouped according to contentGrouped according to content typeGrouped according to sort key
To mitigate SBWP performance issues, BAdIs have been defined
6.20
© SAP AG 2006, 32
SBWP-BAdI: Filtering Work Lists
BAdI WF_BWP_SELECT_FILTER enables the reduction of the number of work items displayed in the Business Workplace workflow inbox
It imports the entire work list (work item header information)It exports the (reduced) work list to be displayed as inbox
Custom filtering algorithms can be implementedExample implementation based on random numbers available
Performance critical operations applied to reduced work listDefault attributes, dynamic columns, work item text in differentlanguages, …
Availability: WAS 620 SP 44, WAS 640 SP 9 (see note 765783)
end user standard work list selection
entire work list
filtering
BAdI
work list subset
preparation for display
Business Workplace
WF_BWP_SELECT_FILTER
6.20
© SAP AG 2006, 33
SBWP-BAdI: Accelerating Dynamic Columns
Dynamic columns can be customized on task levelDisplay work item container information in Business Workplace inbox
Usage of dynamic columns is performance criticalRead container for every single work itemInstantiate objects and read object attributesContainer and Business Object Repository are not mass-enabled
BAdI WF_BWP_DYN_COLUMN can help to improve performanceThe BAdI implementation facilitates
custom bufferingmass selection from database
Availability: Future Support Packages for WAS 620 and WAS 640see note 848382 (not released yet)
work list to be
displayed
1st stage (determination
by BAdI)
WF_BWP_DYN_COLUMN
BAdI
dynamic columns partly
determined
subset with dynamic columns
2nd stage (standard
determination)
work list to be
displayed
6.20
© SAP AG 2006, 34
SBWP-BAdI: Evaluating Default Attributes
Default object attributes are displayed as object representatives
Determination of object attributes is time consumingNot mass-enabledVery critical for large numbers of work items
BAdI WF_BWP_OBJ_ATTRIBUTE can help to improve performanceAllows a custom, mass-enabled determination of default attributes
Availability: Future Support Packages for WAS 620 and WAS 640see note 848382 (not released yet)
_WI_OBJECT_ID _WI_GROUP_ID
_WI_OBJECT_ID
_WI_GROUP_ID
6.20
© SAP AG 2006, 35
Email Notifications
Replacement for SAP MAPI is providedClient-based MS Outlook integration of SAP Business WorkflowSupport ends 10/2005
New solutionsServer-based (zero footprint)Mail client independentCovers 90% of workflow-related MAPI customer scenarios
Different replacements for different SAP releases
Report RSWUWFML2Polling report sending email notificationsReleases 4.6C – 620
Extended NotificationsServer notification frameworkReleases > 640
6.20
© SAP AG 2006, 36
Extended Notifications: Overview
SAP Business Workflow
send e-mails
Extended Notifications
process workitem
collect workitems
End user
Email client
SAP GUI or Portal UWL
6.40
© SAP AG 2006, 37
Extended Notifications: Basic Features
Notify users about work items that need to be processed Send workitems to groupware (e.g. MS Outlook or Lotus Notes) carrying direct callbacks to backend transactions
Execution of web-based work items (Web Dynpro, People centric UI, …)Execution of work items via SAP GUI for Windows
6.40
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 39
BI Integration for SAP Business Workflow (1)
The Workflow Information System (WIS) has become obsolete with WAS release 610
Customers do their reporting using BI
Workflow projects with BI requirementscould not use standard workflow-related data extractionhad to implement their own extraction logic for workflow data
This gap has now been closedTechnical work item data is available in BI as infocubeHow many workflows of type ‘xy’ were executed?What is the average processing time for a given workflow (step)?How many steps of type ‘xy’ were executed by org unit ‘abc’?
Workflow and Business Objects worlds are linked by work item to object relation information available
6.20
© SAP AG 2006, 41
Work Item Programming Exits (1)
Work item exit classes have to implement the ABAP Objects interface IF_SWF_IFS_WORKITEM_EXIT
Exit classes can be attached toSteps (activity, decision, wait, web activity) corresponding work itemsBlocks block itemsWorkflows flow items
Exit classes are called at particular times in the work item lifecycle
work item exit implementation
BEFORE_CREATIONAFTER_CREATIONAFTER_RULE_EXECSTATE_CHANGEDBEFORE_EXECUTIONAFTER_ASYNC_INVOKEAFTER_EXECUTIONBEFORE_REMOVE
IF_S
WF_
IFS_
WO
RK
ITEM
_EXI
Twork item
6.20
© SAP AG 2006, 42
Work Item Programming Exits (2)
The workflow runtime provides the work item exit withthe name of the lifecycle eventa work item context object (reference to IF_WAPI_WORKITEM_CONTEXT)
The work item context provides methods toread work item data (header, task, agents, texts, …)get container handles (IF_SWF_IFS_PARAMETER_CONTAINER)
of the work item itselfof the super ordinate workflow
read properties ( see next slide)write messages to the workflow log
work item exitwork item event nameevent name
work
item
context
6.20
© SAP AG 2006, 43
Properties
Properties are custom labels for workflow definition entitiessteps (activities, decisions, wait steps, web activities)blocksworkflows
Properties can be used tocategorize stepsmark process states (milestones)
Properties are just name value pairsThey can be queried in work item exits ( custom process reporting)
„Is the current work item an approval work item?“„Is the current process still in negotiation phase?“
6.20
© SAP AG 2006, 44
Application Specific Workflow Reporting
Reporting tool
Application specific reporting database
Work item exit
Workflow definition
workflow completed
workflow started
activity
activity
activity2
1
Work item context
step with work item exit
step property
6.20
IntroductionHandling Data with Containers and ExpressionsControlling Flow with Conditions and BlocksDealing With EventsDistributing WorkMonitoring Your ProcessesTesting Workflows and Using ABAP Objects
© SAP AG 2006, 46
Testing Workflows: Start Options (1)
Workflow test transaction (SWUS) offers start options
Select „Goto“ „Options“
Switch on workflow trace and set trace levelTrace Level
Use aRFC instead of tRFCDebug Mode
Switch off synchronous dialog chains Start Dialog Automatically
Background steps are executed synchronously, not via tRFCValuable for debugging background steps
Simulate background processing
The workflow instance is started via aRFCStart Workflow AsynchronouslyExplanationOption
Start options can be specified when testing workflows (SWUS)Options enable better error analysis
DebuggingTracing
6.40
© SAP AG 2006, 47
Testing Workflows: Start Options (2)
Extended start options with release 700
Specify container persistence profile for single step tasks (TS…)The persistence profile for workflows (WS…) is specified in the workflow definition
Persistence ProfileInstantiate and start workflow a specified number of timesRepeated Starts
ExplanationOption
NW04S
© SAP AG 2006, 48
Using ABAP Objects in Workflows (1)
SAP Business Workflow now supports two object repositoriesBOR (Business Object Repository)SE24 (ABAP Objects)
Persistent object keys now have three componentsObject category (CATID) ( BOR or ABAP Objects)Object type (TYPEID) ( BOR object type or ABAP Objects classname)Object key (INSTID)
Both repositories equally well supportedBut: No delegation feature in SE24
SE24 support covers the same aspects as BOR supportContainerExpressionsMethodsEvents
6.40
© SAP AG 2006, 49
Using ABAP Objects in Workflows (2)
Container can reference ABAP OO objectsobject category
classname
ABAP OO objects can be used in expressions
just as BOR objects are used
ABAP OO object methods can be used in standard task definitions
just as BOR object methods are used
object category
classname
method
6.40
© SAP AG 2006, 50
Resources
Public Web:www.sap.comhttp://service.sap.com/bpmsSAP Developer Network: www.sdn.sap.com (Platform -> Business Process Managment)
Related LecturesWhat you need to know about SAP NetWeaver Exchange Infrastructure message processing, monitoring, and troubleshooting(Tuesday, March 28,10:00 am - 11:15 am)
Related SAP Education Training Opportunitieshttp://www.sap.com/education/BIT600, BIT601, BIT603, BIT610
© SAP AG 2006, 51
7 Key Points to Take Home
1. Start to use BI cubes for workflow reporting and for process analysis; this is a building block for Business Activity Monitoring.
2. Local workflows enable you to have a process within a process that can run as many times as the workflow requires.
3. Local events enable workflow flexibility without additional performance overhead.
4. Extended notifications replace SAPMAPI for sending work items to Outlook.
5. Switch your workflow container to use XML instead of SWCONT. This saves storage space since there is no database entry for each structure field requied any longer.
6. Try to get involved in SAP NetWeaver Exchange Infrastructure. Many new workflow features are created to support the BPM runtime. Business Process Managment (BPM) is a natural skill-extension to SAP Business Workflow.
7. Move towards the Universal Worklist as the inbox for workflow items.
© SAP AG 2006, 53
Please complete your session evaluation.
Be courteous — deposit your trash, and do not take the handouts for the following session.
Feedback
Thank You !
© SAP AG 2006, 54
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation.Oracle is a registered trademark of Oracle Corporation.UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc.JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express prior written permission of SAP AG.This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments, and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that this document is subject to change and may be changed by SAP at any time without notice.SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence.The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages.
Copyright 2005 SAP AG. All Rights Reserved