Friday, April 20, 2012

Review Status Workflow

Hi,

In the portal, there was a flow like if any user requests his article to publish. That information will be saved in the list KBArticle, with relevant info under columns Article Status, Review Status

Now requirement is as follows

1) If article gets approved, email has to be triggered to article owner

2) In case if article gets denied, email has to be triggered to article owner

Review Status workflow has been created with SharePoint Designer 2010 by setting the actions, conditions as below

If CurrentItem:ReviewStatus equals Approved Email CurrentItem:CreatedBy

Else if CurrentItem : ReviewStatus equals Denied Email CurrentItem:CreatedBy

Article Status Workflow

In the portal, there was a flow like if any user requests his article to publish. That information will be saved in the list KBArticle, with relevant info under columns Article Status, Review Status

Now requirement is as follows

1)If Article is UnderReview, email has to be triggered to the article owner, notification has to be displayed to wait for publishing of his article.

2) In case Article Status becomes Ready for Publish, email has to be triggered to article owner, notification has to be displayed to user to wait for getting published

3)In case if article is Published, email has to be triggered to article owner and to contributor of the list

Article Status workflow has been created with SharePoint Designer 2010 by setting the actions, conditions as below

If CurrentItem:ArticleStatus equals UnderReview Email CurrentItem:CreatedBy

then wait for ArticleStatus toequal Published

Else if CurrentItem : ArticleStatus equals ReadyforPublish Email KBArticleOwner

then wait for ArticleStatus toequal Published

Else if CurrentItem : ArticleStatus equals Published Email KBArticleContributor; KBArticleOwner

Tuesday, April 10, 2012

Warm Up SPSites

If we are acting a role as SharePoint 2010 Administrator, now a days it is necessary to explore more knowledge in powershell. Recently we had a requirement in power shell i.e. warming up the sites as it has become daily practice to most of the clients to do so. For this after having google search I got the below info .
#############################################
# Title: Warmup-SPSites.ps1
# Author: Ingo Karstein: http://ikarstein.wordpress.com/2011/08/03/sharepoint-warm-up-now-with-timeout/
# Modified by: Wahid Saleemi
# Twitter: @wahidsaleemi
# Reference: http://www.wahidsaleemi.com
#############################################

#Region Define Variables
### Setup your variables here
$timeout = 60000 #=60 seconds
# Leave the line below commented if you want all of the Web Apps. Uncomment and set for only specific ones.
#$urls= @("http://finweb", "http://another.sharepoint.local")
#EndRegion
#Region Load SharePoint Snapin
$ver = $host | select version
if ($ver.Version.Major -gt 1) {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#EndRegion


#Region MyWebClient
Add-Type -ReferencedAssemblies "System.Net" -TypeDefinition @"
using System.Net;
public class MyWebClient : WebClient
{
private int timeout = 60000;
public MyWebClient(int timeout)
{
this.timeout = timeout;
}
public int Timeout
{
get
{
return timeout;
}
set
{
timeout = value;
}
}
protected override WebRequest GetWebRequest(System.Uri webUrl)
{
WebRequest retVal = base.GetWebRequest(webUrl);
retVal.Timeout = this.timeout;
return retVal;
}
}
"@
#EndRegion

#Region Function to get Site List
Function Get-SiteList {
$script:sitelist = "$env:temp\siteURLs.txt"
New-Item $script:sitelist -itemType File -Force | Out-Null
# To WarmUp, we really just need the load the Web Apps
$sites = Get-SPWebApplication -IncludeCentralAdministration | Select Url
# If we want to try some caching too, get all the site collections, comment above and uncomment below
# $sites=Get-SPSite -Limit ALL
foreach ($site in $sites)
{
#write-host $site.Url;
$site.Url | Out-File $script:sitelist -append
}
}
#EndRegion
#Region Set URLs to WarmUp
# check to see if a variable $urls is set.
if (!(test-path variable:\urls))
{
Get-SiteList
$urls = (Get-Content $script:sitelist)
}
#EndRegion

#Region Perform the WarmUp
New-EventLog -LogName "Application" -Source "SharePoint Warmup Script" -ErrorAction SilentlyContinue | Out-Null
$urls | % {
$url = $_
Write-Host "Warming up $_"
try {
$wc = New-Object MyWebClient($timeout)
$wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$ret = $wc.DownloadString($url)
if( $ret.Length -gt 0 ) {
$s = "Last run successful for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss'))"
$filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\SPWarmUp.log")
if( Test-Path $filename -PathType Leaf ) {
$c = Get-Content $filename
$cl = $c -split '`n'
$s = ((@($s) + $cl) | select -First 200)
}
Out-File -InputObject ($s -join "`r`n") -FilePath $filename
}
} catch {
Write-EventLog -Source "SharePoint Warmup Script" -Category 0 -ComputerName "." -EntryType Error -LogName "Application" `
-Message "SharePoint Warmup failed for url ""$($url)""." -EventId 1001
$s = "Last run failed for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss')) : $($_.Exception.Message)"
$filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\lastrunlog.txt")
if( Test-Path $filename -PathType Leaf ) {
$c = Get-Content $filename
$cl = $c -split '`n'
$s = ((@($s) + $cl) | select -First 200)
}
Out-File -InputObject ($s -join "`r`n") -FilePath $filename
}
}
#EndRegion
$script:sitelist | Remove-Item -force -ErrorAction SilentlyContinue

Comparison between SharePoint workflows and third party workflows

In one of our client discussion, looking for capabilities and feature comparison document between SharePoint 2010 workflows and other available third party workflow tools (like Nintex, K2 etc..)
So that based upon on our explanation, he was supposed to tell the requirement I hope.
After googling, I got the below info which was worthy to say about
• 1)K2 appears to have the most mature products. Both are quite pricy, though they are supposedly reworking their cost model. Their blackpearl product is a trimmed down version that focuses on SharePoint integration, so hooking into other LOB systems will be limited, but still possible. Allowing the workflow engine to be separated from the wss front end server, not so in Nintex.
• 2)Nintex appears to be a step up from SPD 2007 and 2010. Compared to K2 blackpoint (their SharePoint/Nintex competitor price wise) Nintex has some Active Directory and Exchange actions that could come in handy for provisioning new staff.
• 3)K2 has an upgrade path to their blackpearl full product, which provides an environment/api for creating custom enterprise data connectors so your workflows can integrate with any system. Nintex has an api for developing custom actions, though not as completely defined.
4)K2 has AD and Exchange integration today (for read and email purposes ) but just announced rich extended AD and Exchange integration (see http://www.k2.com/en/blackpearl.aspx - Look in "whats coming" TAB) in addition to lots of other capabilities.
5)K2 provides a range of visual designers (from one built on Silverlight 4 and embedded into SharePoint to a standalone designer and one fully integrated with Visual Studio (2008 and 2010), a very rich "sharepoint integrated " process management capability called Process Portals and rich out of box reports and analytics.
6)K2 also has amazing Infopath Integration and fully manages Forms and Process versioning and lifecycles , something critical to any process requiring Infopath.
7)K2 also adds some really important workflow fundamentals out of the box. SharePoint Designer is a cool tool, but you will very quickly run out of steam, especially when you have to think about issues like how to "go back to a previous step (one or more steps back) in the process (eg a re-work capability)" and do this at multiple places in the process. Many real-life human workflow processes require this ability . Just three other examples are support for time zones, working hours and rich rules capabilities that are highly extensible through K2 Inline Functions.Hope this helps out you as well.