|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Home > Thinking out aloud - Dave Hunter's SharePoint Blog > Categories
|
06/06/2008
When you upgrade your K2 environment to the latest release (for example 803), you can update a process developed in a previous version by updating the design templates. You can do this by:
- Please see the note below before continuing.
- Right clicking on the design surface
- Select "Update Design Templates" (pictured below).
- You can then select the top node to update everything or specify particular activities etc to update and then click Finish
Note: What it doesn't tell you is that the process of updating the design templates will lose any server code in the process. Make sure you backup the process before you update the design templates. When the update is complete you will need to copy and paste the server code back in place.
I found this post on K2 Underground confirming this behaviour http://www.k2underground.com/forums/thread/20602.aspx. 14/03/2008
It's important to backup K2's databases before you deploy any new workflows. At the moment there isn't a tool to remove K2 BlackPearl Workflow Process definitions deployed to a server.
If you have a backup of the databases then you can restore to that point in time. K2 BlackPearl has 14 databases so it's easier to run a script to perform the backup rather than using Microsoft SQL Server Management Studio.
Here's my backup script ....
/* declare the variables */
declare @dbname as nvarchar(255)
declare @bckstmt as nvarchar(255)
declare @backupDir as nvarchar(255)
declare @dateSufix as nvarchar(10)
declare @year as varchar(4)
declare @month as varchar(2)
declare @day as varchar(2)
/*
Creates a backup for each of the K2 BlackPearl databases in a specified folder set by the variable @backupDir Adds a suffix to the database names to reflect the date for example: In folder C:\_DBBackups Categories_2008-03-14.bak */
/* set the variables */
SET @backupDir = 'C:\_DBBackups'
SET @year = CONVERT(varchar(4),DATEPART(yyyy, GetDate()))
SET @month = CONVERT(varchar(2),DATEPART(mm, GetDate()))
SET @day = CONVERT(varchar(2),DATEPART(dd, GetDate()))
/* make sure the month and day variables contain 2 characters */
IF LEN(@month) = 1
SET @month = '0' + @month
IF LEN(@day) = 1
SET @day = '0' + @day
/* build the date suffix */
SET @dateSufix = @year + '-' + @month + '-' + @day
/*************************************************************** backup the Categories database ****************************************************************/
set @dbname = 'Categories'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the Dependencies database ***************************************************************/
set @dbname = 'Dependencies'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the EnvironmentSettings database ***************************************************************/
set @dbname = 'EnvironmentSettings'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the EventBus database ***************************************************************/
set @dbname = 'EventBus'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the EventBusScheduler database ***************************************************************/
set @dbname = 'EventBusScheduler'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the HostServer database ***************************************************************/
set @dbname = 'HostServer'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the K2Server database ***************************************************************/
set @dbname = 'K2Server'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the K2ServerLog database ***************************************************************/
set @dbname = 'K2ServerLog'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the K2SQLUM database ***************************************************************/
set @dbname = 'K2SQLUM'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the SmartBox database ***************************************************************/
set @dbname = 'SmartBox'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the SmartBroker database ***************************************************************/
set @dbname = 'SmartBroker'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the SmartFunctions database ***************************************************************/
set @dbname = 'SmartFunctions'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the WebWorkflow database ***************************************************************/
set @dbname = 'WebWorkflow'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
/*************************************************************** backup the Workspace database ***************************************************************/
set @dbname = 'Workspace'
set @bckstmt = 'BACKUP DATABASE ' + @dbname + ' to ' +
'Disk = ' + char(39) + @backupDir + '\' +
rtrim(ltrim(@dbname)) + '_' + @dateSufix + '.bak' + char(39)
exec (@bckstmt)
Hope it helps. Please test before using.
UPDATE: Corrected a syntax error. 29/02/2008
When defining the rule on an outcome and comparing the text of a Workflow Field, K2 converts "TRUE" to "True".
Let me just take a step back to explain the process. I have several activities within my workflow process. One of them I want it to run several times one after the other (like a while loop). I define an activity with some child events etc and a outcome pointing to itself. In the outcome I add a rule ... like the screenshot below.
So when "Outcome" field equals "FALSE" the line out should be followed (so goes back to itself).
When you click finish K2 changes the value to "False".
I set the "Outcome" field using a server event to "FALSE". Once the processed was deployed and run, the line rule wasn't evaluated. This was due to me setting in the "Outcome" field to "FALSE" and the line rule being "False".
It's just something you need to be aware of ... always use Pascal case instead of upper case. 07/02/2008K2 BlackPearl can be run as a service or a console application. The console application is best for developers while interrogating a process. The default for logging is set to Info. This should be increased so that information can be displayed in the console window.
1. The configuration for logging is stored in HostServerLogging.config which is located in C:\Program Files\K2 blackpearl\Host Server\Bin\. Remember to replace C:\ with the install drive of BlackPearl.
2. Open the file in notepad (make a backup first so you can revert back if needed) and search for the following:
<ApplicationLevelLogSettings>
<ApplicationLevelLogSetting Scope="Default">
<LogLocationSettings>
<LogLocation Name="ConsoleExtension" Active="True" LogLevel="Info" />
<LogLocation Name="FileExtension" Active="True" LogLevel="All" />
<LogLocation Name="EventLogExtension" Active="False" LogLevel="Debug" />
<LogLocation Name="ArchiveExtension" Active="False" LogLevel="Debug" />
<LogLocation Name="MSMQExtension" Active="False" LogLevel="Debug" />
</LogLocationSettings>
</ApplicationLevelLogSetting>
</ApplicationLevelLogSettings>
3. Change the attribute LogLevel of the element ConsoleExtension to “Debug” (see the line highlighted below).
<ApplicationLevelLogSettings>
<ApplicationLevelLogSetting Scope="Default">
<LogLocationSettings>
<LogLocation Name="ConsoleExtension" Active="True" LogLevel="Debug" />
<LogLocation Name="FileExtension" Active="True" LogLevel="All" />
<LogLocation Name="EventLogExtension" Active="False" LogLevel="Debug" />
<LogLocation Name="ArchiveExtension" Active="False" LogLevel="Debug" />
<LogLocation Name="MSMQExtension" Active="False" LogLevel="Debug" />
</LogLocationSettings>
</ApplicationLevelLogSetting>
</ApplicationLevelLogSettings>
4. Save the file. 5. Restart the K2 Host Server.
You can log to this window by using Console.WriteLine(“message”) in the code of a server event.
The screenshot above displays a values "Counter" and "Outcome" using Console.WriteLine within a server event (code behind). 29/01/2008
I've been working with K2 BlackPearl since August last year. This is the first of many (hopefully) posts on BlackPearl.
After you install K2 BlackPearl and open the workspace you may see the following error message "Unable to connect to server name on port 5252 No connection could be made because the target machine actively refused it."
To resolve this issue you need to start the K2 windows service. Starting the K2 server console also fixes the issues but is designed to be used by a developer for diagnosing issues and tracing information.
- Open Services (Administrative Tools > Services).
- Scroll down to the K2 [blackpearl] server.
- Right click service and click start.

- Go back to the workspace and the error shouldn't appear.

|
|
|
|
| I’m attending the first ever SharePoint Saturday in the UK | 31/08/2010 19:43 | | I’ve re-joined CIBER UK | 31/08/2010 19:26 | | I’ve been Awarded a MVP for SharePoint | 01/04/2010 19:49 | | SharePoint 2010 Training on Microsoft E-Learning | 15/03/2010 17:56 | | SharePoint UK User Group - Thursday 27th August London Meeting | 25/08/2009 17:56 | | CAML Query that filters on the current user | 23/07/2009 17:50 | | Microsoft Ramp Up Free SharePoint Developer Training | 22/07/2009 20:59 | | How To: Change a SharePoint Application Pool Programmatically | 07/07/2009 18:08 | | SharePoint Forums Topping 100 Answers | 06/07/2009 12:29 | | Find out the SharePoint Internal Name for a Column or Site Column | 28/05/2009 09:56 |
|
|
|
|
|
|
|
|
 |
 |
 |
 |
|