Sharepoint Workflow Task Error: This task is currently locked by a running workflow and cannot be edited
By peter.stilgoe
Error in Event Log on Sharepoint Server: This task is currently locked by a running workflow and cannot be edited
When a workflow processes a task normally, the following sequence of events is expected to occur:
1. The process begins.
2. The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.
3. The workflow processes the task.
4. The lock is released when the task processing is finished.
The error occurs because the lock never gets released, which usually occurs between steps 2 – 4. You can read more from this forum post.
http://connect.nintex.com/forums/thread/6503.aspx
Anyway I was getting this problem in a K2 Blackpoint / Blackpearl workflow which was preventing my workflow from moving to the next step. I resolved it by creating a new task list & pointing my K2 process to the new task list, no locking errors & the workflow runs fine now.
You may get similar errors with any workflow product ie. Nintex, Sharepoint Designer Workflow, C# Workflow etc, anything that uses the Sharepoint Workflow Engine & Sharepoint Task Lists.
K2 Blackpoint Blackpearl – How to update a Sharepoint list items using common meta data
By peter.stilgoe
In a K2 Sharepoint process you will quite often have to update the same piece of meta data in multiple locations ie. you have a status column which is part of the list your process is attached to but you may need to reflect this status update on another list item in another list for reporting purposes or something similar. Your lists will need to have a common piece of metadata like a ‘reference number’ or something similar in order for you to return the List IDs’.
You can do this fairly easily using the ‘Sharepoint Search’ event wizard in K2.
- Drop the Sharepoint Search Event wizard on to your design canvas
- Choose ‘Search in a Sharepoint List or Library’ this will just search the specific list your point it at
- Add the URL of the Sharepoint site where the list resides & pick the list you want to search
- Now specify you search parameters ie
Content Type: Order
Field: Reference Number
Operator: Equal
Value: Order Number (This column exists on your other list ie. the one attached to your existing process)
This is now searching your list for a reference number that matches the order number on your original list.
- Create a content field in order to store the results on the next screen
- Finish the process and save
- Now if you go into your process explorer you can browse your new content field that will contain the List ID of your item everytime your search event fires
ie. Object Browser –> XML Fields –> ‘Process Name’ –> ‘Content Field Name’ –> Items –> Item –> Item (This contains the List Item ID of the item you wish to update on the other list)
ps: I wrote this in a hurry which is probably apparent!
K2 Blackpoint / Blackpearl: Using Sharepoint lookup columns in K2 processes
By peter.stilgoe
As you probably know lookup columns in Sharepoint are stored in this format “ID;#String” (record number & then the string value). I was trying to use a lookup value in a K2 process to make up the new sites URL when provisioning new sites. Obviously this was failing due to the way lookup columns are stored ie. illegal characters ID;#String.
You can get round this by using the K2 ‘Code Reference Event’
1) Add a ‘Code Reference Event’ to one of your activity containers on the K2 canvas.
2) Give the code event a name
3) Event Method Editor –> Call Constructor –> Add Reference –> Microsoft.Sharepoint
4) Now on the Select Constructor Screen: Microsoft.Sharepoint –> SPFieldLookUpValue –> Constructor(String fieldValue)
5) Assign your Sharepoint Lookup Column to the fieldValue parameter
6) Now map the LookupValue field to whichever field you wish to store the lookup string value in, set ‘Retrieve Value’ and tick ‘after’
7) Now the field you chose to store the lookup string value will contain just the string without the prefix ID;# and can be used throughout the rest of your K2 process.
More From pstilgoe
K2 Process / Workflow Automation – Questions to ask
By peter.stilgoe
PROCESS QUESTIONS
1. Does the process require reporting, auditing, compliance or version control?
2. Can the process be mapped? Or has the process been mapped and optimized already?
3. Is this process in operation today, electronically, in paper or otherwise?
4. If the business process is new to the business, have the necessary participants of the process been informed and involved in the change management and business improvement exercise?
5. Do you have a paper forms and folders that are passed around?
6. Is this process time sensitive? Are there service level agreements? Do you need escalation points when specific time limits are reached based on your SLAs?
7. Do you have a business process that requires more than one type of review or decision at the same time?
8. Does the process share information with any other process?
9. Does the process run for a long time?
PEOPLE QUESTIONS
1. Will tasks need to be performed on behalf of another person?
2. Will the process involve the participation of the entire organization?
3. Are the process participants geographically dispersed?
4. Does the process need to escalate if someone fails to action it?
5. Do multiple people need to review and sign this off?
6. Are external parties involved in the process, for example regulatory agencies, customers and partners?
7. Is it important to notify users of process status?
8. Is overall process visibility important, for example for employees, managers, executives or auditors?
9. Do you need visibility into your process, like who is doing what and how long does tasks take to complete?
More From pstilgoe
Installing K2 Blackpoint beta on a MOSS Standalone environment using SQL Express
By peter.stilgoe
When installing Blackpoint Beta in a MOSS standalone environment, if you have problems connecting to the SQL database try the steps below which should resolve your issue:
1) Open SQL Server Configuration Manager, expand SQL Server 2005 Network Configuration, Protocols for SQLEXPRESS, Enable Named Pipes.
2) Open SQL Server 2005 Surface Area Configuration, select Surface Area Configuration for services and connections, Expand Data base Engine node and select Remote connections in the tree view, Under Local and remote connections select a option that include named pipes.
3) Make sure to add your database name in the K2 configuration as TESTSQL\SQLEXPRESS
More From pstilgoe
Creating a scheduled email reminder using Sharepoint Designer
By peter.stilgoe
Thanks to Dink at Sharepointu.com for this solution:
You can actually achieve this through a simple workflow in SharePoint Designer using a custom list in your SharePoint site.
In your site, create a custom list called “Emails” and add in two columns:
First column called “Body” – type “Multiple lines of text” (this will contain the actually “body” of the email).
Second column called “Date” – type “Date and Time” (this will be used to hold the next date/time the email will be sent).
Additionally, enable versions on the list – choose “Create a version each time you edit an item in this list” (this will be used for tracking how many times the email is sent and serves as a “confirmation” that the workflow did run).
*Additionally, if it doesn’t already exist, create a new group in the site that you will add in all the users who need to receive the monthly email (permissions for this is not important so you can use an existing site group if it already has the users you need).
In SPD, connect to your site and create a new Workflow “File > New > Workflow” called “Email Users” and attach it to the “Emails” list:
Set it to both:
“Automatically start this workflow when a new item is created” and
“Automatically start this workflow whenever an item is changed”.
At first glance, you may be thinking that setting it this way will cause an infinate loop, and you’d be correct – this is intentional.
Click next to create the Workflow steps.
We only need one step so name it “Send Message”.
**In any of the following steps, if you do not see the specified Action listed when you click the “Actions” button, select the “More Actions” option from the bottom of the list to bring up a complete list of all the actions available where you can now find the Action specified.**
Click “Actions” and choose “Pause Until Date”.
Click “this time”, click the “fx” button, then choose “Current Item” and “Date” for the “Source” and “Field” dropdowns, then click “OK”.
Click “Actions” and choose “Send an Email”.
Click “this message”.
Click the address book icon in the “To” field then scroll through the list of site groups to find the *group that your users belong to (this will be the list of users that need to receive the email), select the group then click “Add>>” then “OK”.
Click the “fx” button in the “Subject” field and choose “Current Item” and “Title” in the “Source” and “Field” dropdowns, then click “OK”.
Click the “Add Lookup to Body” button and choose “Current Item” and “Body” for the “Source” and “Field” dropdowns, then click “OK”.
Optionally, you can now add any additional text to the body of the email message by placing your cursor before or after the “[%Emails:Body%]” lookup and type in whatever you want.
Once completed, click “OK”.
Click “Actions” and choose “Add Time to Date”.
Click on “0″ and change it to “1″.
Click on “minutes” and change it to “months”.
Click on”date”, click the “fx” button, then choose “Current Item” and “Date” from the “Source” and “Field” dropdowns, then click “OK”.
Leave the “(Output to “Variable: date)” part as is.
Click “Actions” and choose “Update List Item”.
Click “this list”.
Choose “Current Item” in the “List” dropdown.
Click “Add” and choose “Date” from the “Set this field” dropdown, then click the “fx” button.
Choose “Workflow Data” and “Variable: date” for the “Source” and “Field” dropdowns, then click “OK”.
Click “OK” again, then one more time to close the “Update List Item” screen.
Your workflow should now appear as:
Pause until Emails:Date
then email [Your Group Name Here]
then Add 1 months to Emails:Date (Output to Variable: date)
then Update item in Emails
Click the “Check Workflow” button to verify there are no errors in the Workflow (confirmation box will open – click “OK” to close it), then click the “Finish” button to build the workflow and associate (attach) it to the “Emails” list.
Back on your site, go to the “Emails” list and create a new item.
Give it the “Reminder to Submit Expense Forms” title (or whatever you require) and add to the body the message you want then to read. Choose the next “11th” as the date (obviously the current month if its before the 11th, or the following month if its currently after the 11th), then click “OK” to add the item.
What’s going to happen is that as soon as the item is added to the list, the workflow will start. If the date listed (in the item) is in the future, it will pause until that date, then when the date is reached, it will send out an email to each member of the group with the details of the item as the email (title will be email title – body will be email body). Once it has emailed the message out, the workflow will then add 1 month (not 30 days, but one calendar month) then update the “date” field in the item on the list to reflect this new date. Since we’ve now “modified” the list item, this will again fire off the workflow which has the first step of pausing until the date listed in the item – which is now one month in the future (and will always be on the 11th).
You can now also look through the version history of the item to see an etry of each time the email had been sent (indicated by a new version being listed for each time).



April 1st, 2011
