Date post: | 15-Jan-2017 |
Category: |
Documents |
Upload: | fady-ishak |
View: | 2,362 times |
Download: | 10 times |
Building Workflows with K2
First, some terminology
Workflow/Business ProcessSequence of connected steps, procedures or activities that may span
across different people, roles or systems. Often visualized with a flowchart
Business Process Automation (BPA)Using software or a platform to implement automated workflows/business
processes
Business Process Management (BPM)Optimization of business processes using management strategies, workflow formalization, BPA, rules engines and organizational structures. Business
Process Management is concerned with the lifecycle of the Process Definition
Business Process Management System (BPMS)Technology or platform used to implement BPM and BPA
K2 Business applicationsBind forms, reports, data, workflows and people together using the K2
platform and its integration features
K2 Business applications: People, Forms, Reports, Workflows and Data
What are SmartObjects?
Short-lived vs. Long-lived workflowsLong-lived Workflows
Duration A few Seconds to Years
Pattern Human-to-Human or Human-to-System System-to-System (long-running) Asynchronous and Persisted Extensive reporting and auditing
Examples Business Processes spanning multiple
people/approvals Processes involving both humans and
systems Long-lasting system-to-system processing
requiring persistence
Short-lived WorkflowsDuration Milliseconds to Seconds
Pattern Single human or Single system System-to-System (short-lived) Synchronous and Transient Little to no historical reporting
Examples Application page flow (“Wizard”) Interactive Voice Response (IVR) Short-running workflows that do not
require persistence
Application-level Workflow
K2 blackpearl Workflow
K2 and the SDLC
K2 Design Tools and Audiences
Features, Capabilities and Complexity
.NET Developers
K2 Designer for SharePoint
K2 Studio K2 Designer* K2 Designer for Visual Studio
SharePoint Power Users
SharePoint Site Owners, Administrators and Developers
K2 Designers (e.g. BA’s, power users, developers)
*only available if K2 smartforms is installed
K2 Design Tools: K2 Designer for SharePoint
Web-Based designer in SharePoint Build SharePoint Item-centric Workflows Accessed from a SharePoint List or Library No client-side installation required Targeted at SharePoint designers, developers and administrators Selection of wizards available Available wizards can be restricted Call SmartObjects to integrate with LOB systems No code
K2 Design Tools: K2 Studio
Installed on designer’s computer Drag-and-drop, configuration-based designer Targeted at Business Analysts and Developers No code Assemble K2 Workflows Build K2 SmartObjects Free-form workflow layout with multiple events per activity All wizards are available Advanced workflow execution models
K2 Design Tools: K2 Designer
Web-based design environment Available if K2 smartforms is installed No client-side install Drag and drop, configuration-based design No code Targeted at Business Analysts, Designers and Developers Create web forms (user interfaces) without any code Create workflows Create SmartObjects Integrate forms with SmartObjects and workflows designed in K2
Studio/K2 for Visual Studio
K2 Design Tools: K2 Designer for Visual Studio
Add-on for Microsoft Visual Studio Assemble K2 workflows Build K2 SmartObjects Targeted at Developers All wizards are available Free-form process layout Multiple events per activity Drag-and-drop, configuration-based designer with option to write
code Debug and error repair capabilities Source Control integration Advanced workflow execution models Developers can override wizard code and/or add custom code to
the workflow
The K2 Host Server
K2 artifacts are deployed to, hosted and executed by the K2 Host Server
Windows service installed on 1 or more Windows application servers
Scalable (i.e. Farm/NLB)
Executes workflows and SmartObjects
Contains hosted services that provide supporting functions
Extendible (e.g. custom security providers)
Comprehensive and configurable logging
Underlying Microsoft SQL database provides robust persistence and scaling opportunities
K2 Host Server: Basic Architecture
Compatibility Matrix:http://help.k2.com/en/blackpearlmatrix.aspx
Worklists
K2 Task List on mobile devices (iOS, Blackberry, Android)
K2 Worklist Web Part (SharePoint)
K2 Worklist in K2 Workspace
Monitoring applications in K2
Reporting tools K2 Workspace Reports K2 Process Portals for SharePoint K2 Reporting Web Parts Custom Reports View Flow Report
Monitoring tools Configurable Logging Error Reporting (and repair) Global Task List (Administrators) and Subordinate’s worklists
(Managers)
K2 Administration tools K2 Workspace K2 Process Portals
Security Administration
Error Repair
Override Task Allocation and set up Out-of-Office routing
Debug workflows with Visual Studio
Versioning Multiple active versions of the same workflow Demote or promote workflow versions In-flight workflow version migration (requires code) Delete old workflow versions
Support for external business rules
Modify existing solution artifacts and deploy as new version
Administration and Optimization
K2 Studio – Introduction
K2 Studio is a Client tool installed on the user’s computer
Installed with the K2 Setup manager (Client Components)
Launched with desktop shortcut/start menu
Used to create K2 SmartObjects and K2 workflows
Targeted at Business Analysts, Developers and more advanced K2 workflow designers
All wizards are available
No code
Typical workflow applications built with K2 Studio
SharePoint-centric processes SharePoint item processes (e.g. Document review and approval) SharePoint admin processes (e.g. Site creation and security management)
Workflows with SmartForm-based User Interfaces Use K2 smartforms to start workflows or complete user tasks
Workflows with InfoPath-based User Interfaces Use thick-client or web-based InfoPath forms to start workflows or complete user tasks
Workflows with custom forms/custom applications Generate forms and then customize the forms Use code to create user interfaces (e.g. ASP.NET forms)
Workflows with simple to advanced complexity Multiple approvals, dynamic task routing and voting scenarios Multiple repeating Escalations Rework loops and parallel paths Call SmartObjects almost anywhere in the workflow Use any of the wizards to integrate with enterprise systems Call external assemblies without any code Note: writing custom code IN a workflow is not possible in K2 Studio
K2 Workflow Terminology Process/Workflow
ActivityOutcomesClient Event (User Task)Server EventLines with Line RulesEventLines
Application Development CycleDESIGN Process Discovery and Design Determine Integration with LOB systems Design User Interfaces and Reports
ASSEMBLE Create User Interfaces Build workflows and SmartObjects with K2 Studio Integrate with systems using wizards and
SmartObjects Configure workflow rules and behavior Build custom reportsDEPLOY Publish K2 artifacts to K2 Server Configure process portal (optional) Configure process security Publish other application artifacts
EXECUTE Start workflow Complete tasks Respond to notifications
MONITOR Error management Workflow Reports Optimize
Design (1/2) People
How are people authenticated? Who is allowed to start, report on or administer the workflow? Who are the participants and how are they identified (Roles, Groups, Org Structure etc.) Other application security/authorization concerns
Forms How will users interact with the application? What data is important on the Forms to allow users to complete their work? Form mock-ups or use cases are very useful
Data What data is important in the workflow, and how should that data be
captured/retrieved/updated? Will the data be used elsewhere? Data audit requirements What systems does the application need to interact with and how would that integration
work? Are these existing SmartObjects for the integration?
Note: Learning module 200.IDO Gathering specifications and requirements for K2 projects describes the design process in much more detail
Design (2/2)
Workflow How will the workflow be started? Manually by a user or automatically by K2/another
system? What are the activities/steps in the workflow? Are specific tasks performed by humans or systems? If tasks are performed by people, who are those people? What work is performed in each task? What are the decision points, conditions and paths in the workflow? What are the rules regarding Notifications and Escalations? Are the rules static or dynamic? Draw a Workflow diagram
Reports What reports are required? How will users access reports?
Assemble: High-level tasks1. Set up resources and dependencies
a) Create the required SharePoint Lists or Libraries and other data sourcesb) Set up integration pointsc) Define security groups
2. Create SmartObjectsa) Create and deploy SmartObjects
3. Create Formsa) Create K2 SmartForms, InfoPath forms or custom User Interfaces
4. Create Workflowsa) Setup process Start and process Propertiesb) Define Process-level and Activity-level Data Fields c) Add References, if neededd) Add Activities and define Activity-level rulese) Configure Client Events and add Destinations, Actions and Outcomesf) Configure Server Eventsg) Set up Lines and Line Rulesh) Configure Escalations
5. Design Reportsa) If required, create custom reports (external design tool)
Process Wizards
Wizards are used to associate the Start of the workflow with certain system events or specific Forms
SharePoint Events Process Automatic start when item is Created or Changed
InfoPath Integration When an InfoPath form is submitted, start the
workflow and pass the InfoPath form data to the workflow
SharePoint Workflow Integration Manual/automatic start by submitting an item to a SharePoint Workflow Use this option if you want to generate user interfaces in SharePoint
SmartForms Integration Integrate the workflow into Rules on a K2 smartform Only available if K2 smartforms is installed
Other Start mechanisms No additional configuration required
Process Properties
Right-click on the design canvas and select Properties Set Process Name, Description and Expected Duration Process-level Escalations Process-level Exception handling
Custom Exception handling code required K2 for Visual Studio
Process Start Rule and Finish Rule Create SmartObjects and SmartObject Associations
Expose workflows as SmartObjects Create Associations or SmartObjects for Reporting
Add References to external assemblies
Lines Lines control the process flow Draw lines by holding down Right
button. Start in the originating activity and stop in the target activity
Move lines around by moving mouse over the line start or end, Click+Drag
Activities and LinesActivities Are containers for client and server
events Drag and drop a default activity
into the workflow or use the gesture
Move activities around by moving the mouse over the activity icon, Click+Drag
Activity gesture: right-click and hold, draw an “A” shape
Events (Tasks)
Events are where work is performed in a workflow
Events are contained in an Activity
One Activity can contain multiple events
Client events: work is performed by People
Server Events: work is performed by the K2 Server Server events are performed in the security context of the K2 service account
unless configured not to
Client Events Client Event Form Options
Default Client Event (300.NRT K2 Workflow APIs and Services) Forms Generation InfoPath (200.AKL K2 and Microsoft InfoPath) SmartForms client event (200.YUL K2 smartforms - Intermediate) SharePoint Workflow Integration (300.CGK K2 and Microsoft SharePoint Content Management)
Notification Customizable E-Mail sent to users when they receive the task Optional: action tasks via email (K2 SmartActions)
Actions The decisions that participants can make on a task
Outcomes The result of the decisions made by the participants
Destination Users Users, Groups or Roles that will receive the task Can be static or dynamic Multiple Destination Sets with Rules for more advanced scenarios
Server Events (1/2)
Default Server Events (Code and WF) Write code (not available in K2 Studio)
E-Mail Event Send dynamic email with/without attachments
IPC Event Call another K2 workflow (“child workflow”)
SmartObject Event Call any SmartObject method Primary integration method for many LOB systems
Code Reference Event Call a referenced service or assembly
Data Event Set a field’s value or perform XML manipulation
Placeholder Event Empty event, does nothing
Server Events (2/2)
Item Reference Event Add a shortcut reference for a SharePoint Item or
CRM entity item
Active Directory Event Manipulate AD items like Users and Groups
Exchange Event Create/Disable Mailboxes, send Meeting Requests
and create Tasks
Word Documents Event Create and convert Word documents and
update document content controls
Upload InfoPath Form Event Save an InfoPath form to SharePoint
CRM Events Integrate with Microsoft Dynamics CRM 4 or 2011
Server Events for SharePoint
SharePoint integration functions
Perform SharePoint tasks across sites and farms
SharePoint Administration tasks like creating sites and lists, setting security
SharePoint Content management tasks like manipulating documents, list items, documentsets, folders
Records management tasks
Search for items in SharePoint and save the results for later use
Publish content in SharePoint
Launch the context browser to drag and drop variables/lookup information
Event Wizards Events are configured with wizards
Drag-and drop interface with ability to reference variables and external systems almost anywhere
Some wizards can be run in “Advanced” mode with additional options
Navigate through the wizardWizard configuration Screen
The Context Browser
Context Browser allows designers to drag and drop dynamic values into fields on wizards
At runtime, the value is replaced with the “real” value of the context item
Different categories of variables Environment (incl. Environment settings and SmartObjects) User Browser Workflow Context Inline Functions Process/Activity Data
Using SmartObjects in Workflows
SmartObject Event Call any external system exposed through a SmartObject
Using the context browser, use SmartObject data in Inline Functions Line Rules/Outcomes Activity and Process Rules Destinations and Destination Sets Escalations Data Events Most Wizard textboxes Can use chained/nested SmartObject calls Some wizards support lists of records from a SmartObject list method
for looping/repeating over each item
Data Storage and Data Access
Process Datafields/XML Fields When data used in a workflow only Built-in auditing (optional)
K2 SmartObjects SmartBox Other LOB system
Assembly/Service Use a .dll or service to access a LOB system Expose an assembly/service as a SmartObject with Endpoint Service
Brokers
SharePoint List Item InfoPath form
Form XML data is stored in the K2 workflow
Document
Escalations1. Determine the escalation context
Process Activity Event
2. Configure the Escalation Settings Relative (after some interval) Absolute (specific date and time) Repeat (how many times or how often to repeat the escalation) Use Working Hours (or not)
3. Configure the Escalation Type Email Redirect task Go To Activity Expire
Notes Escalation will fire if the associated context item has not completed by the
escalation date Escalation dates are calculated and set when the Process/Activity/Event is
initialized
Security Security Groups/Roles
Active Directory Groups SharePoint Groups K2 Roles (configured with K2 workspace) External Data store
Authentication mechanisms Active Directory SQL-based User Manager Claims-based authentication Custom Security Provider
Implementing Security Configure authentication mechanism Set up Groups and Roles Configure Workflow Security (configured after deployment) Configure K2 SmartBox SmartObject security (configured after deployment) Configure K2 server security (configured with K2 workspace) Configure SharePoint security Set up authorization for other systems
Reports
K2 Workspace Standard K2 reports Custom K2 reports
K2 Process Portals Include the process on a shared process portal, or Create a process portal specific to the process
Custom SharePoint Site Customize a K2 process portal site by configuring, adding and removing
WebParts
Custom Reports SharePoint lists Use standard K2 reporting SmartObjects to create custom reports Expose K2 workflows as K2 SmartObjects so that you can create custom
reports in some report design tool
Deploying workflow-centric applications
Workflows and SmartObjects must be deployed (published) to a K2 server before they can be used
The same K2 project can be deployed to multiple environments Environments are maintained by K2 administrators using K2 admin tools
Security: restrict deployment to specific environments
Deployment mechanisms Deploy directly from K2 Studio .msbuild deployment package K2 Package and Deployment tool
K2 will manage workflow versions internally
Workflow Security and Rights
Manage K2 security with K2 Workspace Process Portal
Process rights Start
• Who can Start a new process instance? View and View Participate
• Who can report on all active and completed instances? (“View”)• Who can report on only those instances that they were personally involved in
(“View Participate”)? Admin
• Who can use K2 administration tools to manage process instances?
Reporting Configuration
Note: Users with Admin, View and View Participate permissions will be able to report on processes
K2 Process Portals Multiple processes on the same portal Run standard K2 reports for the available processes Manage the available processes and process instances
K2 Reporting WebParts Create custom SharePoint sites and add K2 reporting WebParts Configure the reporting WebParts to show specific processes
K2 Workspace Run standard K2 reports for the available processes Create custom reports for processes and SmartObjects
Manual Start Start process as a result of a human action
Automatic Start Start process based on a system event or schedule
Notifications and Task Lists K2 can send E-Mails to users when new tasks are assigned to them Users can find their current tasks on the K2 task list K2 task lists are provided for SharePoint and mobile devices Users can Sleep/Redirect/Delegate tasks, set up Out-Of-Office rules
Completing tasks Forms (Generated, SmartForms, InfoPath, SharePoint or custom) K2 SmartActions (E-Mail) Worklists Mobile Applications (iPhone, BlackBerry, Android)
End-User interaction with a K2 Workflow
Reporting on and monitoring workflows
Reporting Data and History K2 maintains reporting data for all instances (active and completed)
K2 Reports Process Portals K2 Workspace Reporting WebParts
Custom Reports K2 Workspace Report Designer Other report design tools
K2 Administration Process Portals K2 Workspace
K2 View Flow Real-time view of running process instances