Sunteți pe pagina 1din 19

K2 Building Blocks

K2 BLACKPEARL 101: MODULE 2

PAGE 1
K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

CONTENTS

APPLICATION BUILDING BLOCKS .................................................................................................................... 3


SmartObjects................................................................................................................................................. 3

PROCESS BUILDING BLOCKS .......................................................................................................................... 7


Activities ........................................................................................................................................................ 7
Events ........................................................................................................................................................... 7
Lines and Rules............................................................................................................................................. 8

PUTTING THE BUILDING BLOCKS TOGETHER ................................................................................................ 9


K2 Workspace ............................................................................................................................................... 9
Managing Users and Roles ............................................................................................................................ 9
Management Console.................................................................................................................................. 11
Process Designers ...................................................................................................................................... 13
SharePoint Integration ................................................................................................................................. 17
Office Integration ......................................................................................................................................... 18
Environment Library .................................................................................................................................... 18

LAB – K2 BUILDING BLOCKS ........................................................................................................................... 19


Overview ..................................................................................................................................................... 19

Page 2 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

APPLICATION BUILDING BLOCKS


Building blocks provide a quick and accurate way of designing and configuring the various pieces of a K2
blackpearl application. The building blocks minimize the amount of configuration needed to be done by the user
as well as provide access to wizards and other tools that aid in the construction of the overall solution. This
module describes the building blocks available in K2 blackpearl.

SMARTOBJECTS
SmartObjects are reusable objects that surface in the K2 Designer for Visual Studio and the K2 Workspace, and
are created from within Visual Studio. To create a new SmartObject in Visual Studio, use the ―Add New Item‖
dialog from the context menu in the Solution Explorer. SmartObjects provide an abstraction for defining business
entities such as an Employee or a Region. Once created, a SmartObject can be used throughout K2 blackpearl.
The data that represents the SmartObject can live in an existing back end system or can be managed by K2
blackpearl, or both. The K2 platform reduces the cost of creating, managing and making use of business
information that exists across any number of line-of-business systems. It allows for rule-based decision making,
routing, and reporting, based on 360-degree visibility into business entities — SmartObjects — such as
customers, employees, orders and invoices.

The SmartObject Designer


The SmartObject designer in the K2 Designer for Visual Studio allows business entities to be defined and
deployed to a K2 Server. The designer shown below provides an easy and intuitive way of building SmartObjects.

Page 3 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

[FIGURE 1: CREATING A SMARTOBJECT IN THE K2 DESIGNER FOR VISUAL STUDIO]

SmartObject Maintenance
Custom SmartObject editors may be created through the K2 blackpearl APIs. Below is a custom SmartObject
Maintenance page written in ASP.NET.

Page 4 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

[FIGURE 2: EXAMPLE CUSTOM SMARTOBJECT MAINTENANCE PAGE]

SmartObject Methods
Various services can be accessed from within K2 blackpearl enabling the user to create SmartObjects by
accessing service methods and objects applicable to their business from back end systems. These services
display the definition of the back end system. In Visual Studio, a user can create and configure SmartObject
methods which use service instances and objects from other systems. This reflects the business information. By
adding a new service method, properties of the service objects can be mapped to existing SmartObject
properties. A combination of services can be used to create composite SmartObjects.

The Add button is displayed in the SmartObject Method toolbar when the Advanced Mode has been selected in
the SmartObject designer.

Page 5 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

[FIGURE 3: SMARTOBJECT METHOD TOOLBAR]

The Add button opens the Add Method wizard which allows you to define new SmartObject methods:

[FIGURE 4: DEFINING A NEW SMARTOBJECT METHOD USING THE WIZARD]

Page 6 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

PROCESS BUILDING BLOCKS


Process building blocks provide the essential pieces that make up an overall process. The following sections
discuss the key process building blocks.

ACTIVITIES
Activities act as the containers for events within a process. An Activity within a process can potentially contain
Client Events, Server Events or Inter Process Communication (IPC) events. The business logic includes concepts
like: ―who must be involved in the Activity,‖ and ―are there any pre-requisites that must be met before workflow
participants can start with the Activity.‖ Activities are important components in the process because they represent
points where decisions are to be made, data is to be delivered, or actions are to be carried out. One of the most
important properties of Activities is the business rules associated with the activity. These Activity Rules represent
the tools used to build business logic into the activity. For an activity to be useful, it must have at least one event
associated with it.

There is one activity that comes out of the box; this is the Default Activity.

2003 Tech Tip: More Activities exist in K2.net 2003. These activities can be used in K2
blackpearl. The Default Activity is a container for Events.

EVENTS
Events are the actions that can occur within an Activity. Events can be broken down into three key categories:
Server Events, Client Events, and IPC Events (Inter Process Communication Events). Server Events are events
that occur within code that execute on the server. Client Events are events that require some form of client
interaction. IPC Events are a special category of Server Event that allows one process to communicate with
another.

Client Events
The Client Event represents the physical interaction that takes place between a human user and the process
instance. Interaction is on an activity-to-activity basis. In combination, these Events are used to create
collaborative (human-to-human), transactional (human-to-system) and application integration (system-to-system)
workflow solutions.

The Default Activity can only host one Client event, which performs one Client event action. This approach
categorizes tasks into single steps where one task is handled per Default Activity. Where multiple steps of Client
Event interaction are required in a process, the tasks are linked together by successive default activities each
containing one client event.

Server Events
The Server Events execute server side code. A Server Event has no Client interaction. This creates application
integration (system-to-system) workflow solutions.

Page 7 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

IPC Events
IPC Events are a special category of Server Events that allow processes to be called by other processes. This
allows for a modular design of processes and allows reuse of common process steps. IPC Events can be called
synchronously, in which the parent process will wait for a return value, or asynchronously, in which the parent
process starts the child process and continues down its logical path.

ACTIONS AND OUTCOMES


Actions and Outcomes allow processes to separate what decisions, or Actions, users are able to make from the
implications, or Outcomes, of those Actions. Because Actions and Outcomes are defined outside of the form,
maintenance of those decisions and routing logic is made more simple in K2 blackpearl.

 Actions are the decisions that the user can make about the form.
 Outcomes are K2’s way of taking the business decision and deciding where the form goes next.

Common examples of Actions include ―approve‖ or ―decline.‖ Outcomes are the results of the actions such as ―all
users approved an item,‖ or ―all users declined an item.‖

LINES AND RULES


Lines provide the ability to connect the outcome of one Activity in a process to another Activity. Many of the
properties of an Activity are rules of some kind or another. These Activity Rules represent the tools used to build
business logic into the Activity. There are five different Activity Rules.

Preceding Rule
A logical expression that must evaluate to true before an Activity can be created. Stated in another way: What
conditions must be true before the Activity is created for the instance?

Start Rule
The Start Rule is time related and dictates when an Activity can start.

Destination Rule
If the Activity involves some kind of human interaction, the role or user needs to be specified. By stating who can
action the Activity, the workflow participants are stored in a Destination Rule.

Escalation Rule
Your organization might have a business rule that states a specific Activity must be completed within 8 hours; if
not, some special action must be taken. The Escalation Rule is used to specify when and how this special action
takes place.

Succeeding Rule
A logical expression that must evaluate to true before an Activity can be completed. Stated in another way: What
conditions must be true before the Activity is allowed to end?

Page 8 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

PUTTING THE BUILDING BLOCKS TOGETHER


The SmartObjects and Processes can be used together to build complete, end-to-end applications. These
applications provide the ability to create, delete, edit and update business entities by accessing them via Web
Pages that contain SmartObjects, connected to the underlying business entities. These applications can also
contain workflows that are applied to the business processes associated with the entities being created.

K2 WORKSPACE
The K2 Workspace is a web based interface for working with deployed workflow applications.

Available in Web Browser


One of the main advantages of the K2 Workspace is that it is web based. Support for users to leverage and build
K2 blackpearl applications from anywhere and with minimal client side application requirements is an important
part of the K2 platform. The following web browsers work with the K2 Workspace:

 Internet Explorer 6 with latest Service Packs


 Internet Explorer 7 with latest Service Packs

MANAGING USERS AND ROLES


K2 blackpearl relies on user providers to bring user information into the context of the K2 platform. K2 blackpearl
configures Active Directory and SQL user providers, but other user providers can be added. The default user
provider is Active Directory and uses the K2 security label. The SQL user provider uses the K2SQL security label.
Labels are used to identify user providers.

Roles are managed in the Management Console and can span user providers, meaning that roles can contain
users with different labels. User and role permissions are resolved using a concept called the Context Grid, which
allows for the definition and management of user permissions. For example, if a role is created that contains
users from an Active Directory group and a SQL group, the role can be used in the destination rule for an event
and all users will see worklist items related to that event. The Context Grid allows actions to be assigned to users
based on their role membership. Role membership can also be configured to exclude users. This is useful, for
example, when an Active Directory group contains individuals who should not receive notifications or worklist
items.

When role membership changes, users removed from a role will no longer see worklist items associated with the
role. Conversely, users added to a role will see worklist items associated with the role after the refresh interval.

Users can be added to processes directly as destinations but a more flexible approach is to add users to roles
and use the roles as destinations. This way, when responsibilities change, the role can be modified without having
to redeploy the process definition.

Page 9 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

Note: While using roles is recommended when setting destination rules for processes, this course
shows examples setting users for destinations for easier process design and testing.

User Management
User providers can display users from various systems, such as Active Directory, SQL Server, or any custom user
provider that has been developed to work with K2. Once the user provider has been defined, those users are
displayed in the K2 Object Browser under the User Browser and can be given permissions on processes.

Role Management
Roles are defined in the K2 Workspace and can be used in processes. Roles can contain users or groups from
the configured user providers. Roles can also be used to set permissions on different tasks (for example, the
approver role can see approve and decline, the administrator role cannot). When using roles, worklist items are
assigned to roles rather than individual users.

Task Management
The K2 Worklist is shown when a user browses to the K2 Workspace. All tasks assigned to the user are visible
and can be actioned through the Worklist screen shown below:

[FIGURE 5: HOME PAGE OF THE K2 WORKSPACE WITH THE WORKLIST DISPLAYED]

Individual task items or groups of items can be actioned upon. A batch of items can be actioned by selecting
more than one item in the worklist.

Page 10 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

MANAGEMENT CONSOLE
The Management Console of the K2 Workspace provides access to create, edit, delete and manage the
fundamental building blocks of K2 blackpearl. Some of the items available are shown in the tree view below:

[FIGURE 6: MANAGEMENT CONSOLE ON THE K2 WORKSPACE]

Reports
The Reports menu in the K2 Workspace enables a user to run or edit existing reports, as well as build new
reports using workflow data and SmartObjects, depending upon the business requirements.

The Report Designer allows the user to create various types of reports required by the business to effectively
manage data and business processes. There are various report layouts that can be selected and customized to
represent the data to suit the business.

Page 11 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

[FIGURE 7: CREATING A REPORT IN THE REPORT DESIGNER]

Notifications
K2 blackpearl enables the developer to configure a customizable notification when an event takes place using
Notification Events.

The Notification Event Designer page displays existing events and enables the developer to create and configure
new notification events.

Page 12 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

[FIGURE 8: NOTIFICATION EVENT DESIGNER ON THE K2 WORKSPACE]

PROCESS DESIGNERS
K2 blackpearl allows business users, developers and domain experts to participate in the design and creation of
processes, reports, and forms; and they can use what has been built to rapidly assemble applications that help
drive business. The unique modeling experience in K2 blackpearl supports multiple, interchangeable canvases
and tools (such as K2 Web Designer, K2 Designer for Visio, or K2 Designer for Visual Studio). K2 blackpearl
abstracts the view information from the underlying definitions to ensure that the core definition is the same
regardless of the canvas or tool. The result is a solution platform that allows each participant in the process-
modeling experience, regardless of role (business user, technologist, or domain expert), to use the modeling
environment in which they are most comfortable.

Page 13 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

K2 Designer for Visio


There are no stencil requirements when using K2 Designer for Visio — simply use any of the built-in stencils that
come with Microsoft Office Visio 2007 or use your existing drawings. A user can open any previously created
Visio 2007-compatible diagram, and the K2 Designer for Visio takes advantage of all the easy-to-use wizards
available in other K2 blackpearl design canvases.

[FIGURE 9: EXAMPLE INTEGRATION IN K2 DESIGNER FOR VISIO]

Page 14 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

K2 Web Designer
Business users can visually model, build and deploy processes using the K2 Web Designer. This is available
directly within a browser or surfaced within SharePoint 2007. The K2 Web Designer for SharePoint offers a set of
built-in workflow options to design workflows for libraries and lists in a SharePoint site collection. Within
SharePoint, the user has the option to select Outcome Templates and Document Wizards. Outcome Templates
describe one or more actions a user can take, while Document Wizards define what happens to a document or list
item as a result of each action.

[FIGURE 10: EXAMPLE K2 WEB DESIGNER PROCESS]

Page 15 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

K2 Designer for Visual Studio


Visual Studio 2005 enhanced with K2 components can be used to visually model, build, debug, and deploy
processes. In this environment, developers simply drag and drop components onto the process-design canvas.
Windows Presentation Foundation-based wizards, including wizards for integrating with technologies like
SharePoint, sending e-mail, and displaying ASP.NET or Microsoft Office InfoPath 2007 forms, guide the
developer through configuration and automatically generate the underlying code, Workflow Foundation schedules,
supporting files, rules and activities. Developers may use the K2 Wizard SDK to develop their own custom
wizards.

[FIGURE 11: EXAMPLE PROCESS IN THE K2 DESIGNER FOR VISUAL STUDIO]

Page 16 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

SHAREPOINT INTEGRATION
K2 blackpearl extends built-in SharePoint workflow features by providing a rich, graphical user interface for
designing workflows and more powerful business process applications. K2 blackpearl templates and wizards can
manage SharePoint documents and list items, sites and users, and the metadata associated with these entities.
Process data about K2 blackpearl workflows deployed on SharePoint can be exposed through the SharePoint
Business Data Catalog. For more information, see Module 26: Delivering K2 Information in SharePoint (BDC).

K2 blackpearl Enterprise Workflow Features


While the SharePoint workflow features built on the WF platform are useful for gathering document feedback and
simple document approval, they do not include options that enterprises need for typical end-to-end and complex
workflow scenarios. K2 blackpearl brings features to SharePoint that address enterprise workflow solution
requirements, such as:

 A graphical workflow-design experience that is intuitive and easy to use for business users
 The ability for multi-site actions, such as moving documents between SharePoint sites or publishing list items
to a different site
 Escalation potential based on working hours, custom actions, calendars, and out-of-office capacity for
transactional communication with systems outside the SharePoint environment
 Dynamic task assignment, reassignment, and deletion capabilities
 Role-based task allocation
 A unified view of all tasks assigned to an individual across multiple sites and portals in any environment,
including SharePoint
 Detailed auditing and dynamic, user-designed reporting capabilities
 The ability to version process definitions at development and deployment including process instances
 A wizard-driven, integrated, graphical workflow design experience in Visual Studio where developers can
write code to extend a workflow or incorporate advanced requirements

Worklist and Workflow History List Integration


In all workflows designed in K2 Web Designer for SharePoint, associated tasks are entered in the default
SharePoint task list and completed tasks and other workflow information are stored in the Workflow History list.
These two lists are the same lists that are used by built-in SharePoint workflows. Visual Studio must be used to
change the list to which tasks and the workflow history are written. The K2 Worklist Web Part provides more
workflow details and supports batch actions. This Web Part and the Worklist on the home page of the K2
Workspace should be used instead of the standard SharePoint task list. However, both of the default SharePoint
lists are maintained and updated throughout the process. More detailed workflow history reports than the ones
available in SharePoint can be generated using workspace reports.

Page 17 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

OFFICE INTEGRATION
K2 blackpearl integrates with many Microsoft Office applications, including Microsoft Office SharePoint Server
(MOSS) 2007. The client applications, such as Microsoft Office Word, Excel and PowerPoint 2007, are capable
of displaying SharePoint workflow task alerts, including alerts from SharePoint workflows built with K2 blackpearl.

K2 blackpearl can use custom Microsoft Office InfoPath 2007 form templates to gather workflow data and capture
workflow activities. In addition, K2 blackpearl allows customers to build comprehensive process applications using
InfoPath forms. The associated data on an InfoPath form is contextualized into the K2 blackpearl process,
allowing complex logic, data lookup and business decision-making based on user input and line-of-business
(LOB) system integration. This is a significant advancement from simple document routing and list-based
approvals.

The K2 Designer for Visio enables workflow design using new or existing drawings, independent of the stencils
used to create the drawing.

ENVIRONMENT LIBRARY
The Environment Library provides a way of managing all of the servers associated with a particular environment.
For example, during a typical project lifecycle a process will first be created in a development environment with
development servers. Later, that process will be tested in a test environment with test servers. Finally, the
process will be moved to production with a different set of servers.

In order to make management of a process easier and not hard code or build any dependencies (such as server
names, addresses) K2 blackpearl uses an Environment as a way of managing this information external to the
process. This provides a clean and easy way of building, testing and deploying across three completely different
sets of environments without ever needing to go back and change code. All that needs to happen is to change
the environment.

Page 18 of 19 | Version 1.6


K2 BLACKPEARL 101: MODULE 2
K2 BUILDING BLOCKS

LAB – K2 BUILDING BLOCKS

OVERVIEW
This module is purely an introduction to K2 building blocks. There is no lab associated with this module.

Page 19 of 19 | Version 1.6

S-ar putea să vă placă și