Showing posts with label Workflows. Show all posts
Showing posts with label Workflows. Show all posts

Nov 3, 2017

We can't do that for you because the file is no longer checked out or has been deleted

This error is an interesting scenario but so weird one which I faced recently while migrating SharePoint 2010 designer workflows to SharePoint Online.
Post migration, when I try to edit the workflow in designer I got the below error:

It clearly shows some configuration files are missing.
Hence I have navigated to All Files (from SharePoint Designer 2013) -> Workflows folder -> Workflow -> noticed only one file is migrated but other configuration XOML, XSD or XML files are missing.Now, logged in to the designer with the account which I migrated and found all these required files are Checked Out. When I try to check in the file then I get this error:
It is so confusing that you are not able to Check In the file even when you are SCA or have full control over the site or even if you have created the workflow.
After hours of confusion, finally found the file has having wrong file name or characters which SharePoint Online(Office 365) does not support. But this name format is supported in SharePoint 2010 version. Screenshot for reference.
Issue Fix:

Navigate to Workflows folder -> select the workflow name -> Right Click on the file -> Properties -> Remove the forward slash '/' -> Save -> Check in the file :)
Now, you should be able to edit the workflow in designer, save / publish it with no issues.
Thought this is worth sharing so that it saves someone's time!

Oct 10, 2016

Deploying List Workflow in SharePoint Online

Recently, I had a query from one of my readers about migrating the Workflows from development to production and the environment is SharePoint Online.
Scenario:
Suppose that you have created a List Workflow in development site in SP Online and now it is ready to move to Production in SP Online, you can follow the following steps to deploy the workflow. This method is easy, cheaper since no third party tool (licensing cost) is used for migration/deployment.
Solution:
1. Take the backup of SP list with or with out content (depending upon the requirement). List backup will be in .stp format.
2. Download the List Template from List Templates (Site Settings -> Web Designer Galleries -> List Templates).
3. Upload the List Template in the PROD site in the same path (Site Settings -> Web Designer Galleries -> List Templates).
4. Create a new app from "Add an App" and create the list with the same Internal Name (impt: the internal name of the list created in the PROD should be the same as DEV environment)
5. Open the DEV site SP designer, point to the List Workflow -> Click save as template from ribbon (in Manage section) - This will save your WF as web part solution (.wsp) in the Site Assets Library. 
6. Download the WSP and upload it to the PROD site solutions: Site Settings ->  Web Designer Galleries -> Solutions -> Upload & Activate the solution
7. Now navigate to the Site Settings -> Site Actions -> Manage Site Features -> Activate the workflow (it should be in the name Workflow Template "name of the workflow" from web template "name of the site")
Note: If you do not the create the list with the same internal name in the PROD, you will get an error while activating the feature.
8. Now, navigate to the list -> list settings -> workflow settings -> you should see the Workflow associated with the list already. If you face any issues, remove the associated workflow, add it again either from SP designer or from SharePoint UI itself.
Hope this helps you in deploying the workflow from development site to production site in SharePoint Online.
If this useful to you, share this post using the buttons below / share your comments which will make me write more!  😊

Jul 1, 2012

Visual Studio Workflow in SharePoint

Part II
To know about the Basics and Advantages of using Visual Studio Workflow
read this article.
In this article, we will how to Create a Simple Sequential Workflow Console Application.
Steps:
1. Open Microsoft Visual Studio -> File -> New Project -> Select Visual C# -> SharePoint -> Workflow -> SequentialWorkflowConsoleApplication

2.  You can see the required DLL’s added in the solution for running the work flow in the Solution Explorer

3.  From the Toolbox -> Select Code -> drag and drop inside the designer view as shown below. Double Click on the codeActivity1 -> you will be navigated to Code behind page of the solution.


4. I have initialized a variable with get and set methods and activity for the code1 as shown below:

5. Now, go to the Design view -> From Toolbox -> Drag and drop IF ELSE activity and the code activity for IF and ELSE branch

6. Right click on codeActivity2 and click Generate handlers to create handlers the activity and do the same for codeActivity3
7. Now, we will set the condition for the ifElseActivity1 and 2. Right Click on ifElseActivity1 -> Properties -> Condition -> Select Declarative Rule Condition


8. Give the Condition Name and then Click on Expression for setting the condition:
9. Following are the conditions set for both the activities:


10.Now,if you click on any one of the activity -> properties -> select the name
then -> you can see the two conditions being used in the solution as shown:

11. Finally, I have added the message to be returned for the both activities

12. Now build the solution and then execute the code:

Here is the full solution. Click to download. Happy Sharing!
Hope, you have enjoyed this article.
Please free to comment and share this article, if it helps you!
Happy Coding!!

Visual Studio Workflow in SharePoint

Part I
To know about the Basics of Workflow in SharePoint, read this article.
To know about the Creating a Designer Workflow, read this article.
To know about the New Features added in SharePoint Designer 2010, read this article.
In this we will learn about Basics of Visual Studio Workflows in SharePoint.
Windows Workflow Foundation -WWF:
Windows Workflow Foundation (WF) is a Microsoft technology for defining, executing, and managing workflows.
Why Visual Studio Workflow is necessary?
From the business perspective, we need some custom workflows to be designed and developed in order to meet the requirements. By using designer, we cannot achieve all the custom actions and hence Visual Studio workflows are necessary.
Moreover, Visual Studio is a known environment to the developers (working with Microsoft Software’s) and hence the design and development is very easy.
Software Requirements
  Ø  Windows Server 2003 R2 Download
  Ø  Microsoft .NET framework 3.0 Download
  Ø  Windows SharePoint Services 3.0 Download
  Ø  Microsoft Visual Studio 2005 with SP1 Download
  Ø  Windows SharePoint Services 3.0 SDK Download
  Ø  Visual Studio 2005 Extensions for Windows Workflow Foundation Download
   Limitations of using Designer Workflow:
  Ø  A major disadvantage is that, you can create only Sequential Workflows using designer and not the State Machine workflows.
  Ø  We cannot write custom code and custom activities for workflows while creating using designer.
  Ø  Maintenance and upgradeable methods are very less.
To know how to create a sample Sequential Workflow using Visual Studio, read this article Visual Studio Workflow in SharePoint.

Apr 22, 2012

New features of SharePoint Designer 2010

Read this article, to know the Basics of Workflow in SharePoint.
Read this article, to know about Implementing Designer workflow in SharePoint using SharePoint designer 2007.
In this article, we will come to know about the new features added in the SharePoint designer 2010 for the workflow.

What is new in workflows in SharePoint Designer 2010?
In the SharePoint 2010 designer you will see a ‘ Work flows’ tab in the ribbon on the top. Now you can create three types of workflow in SharePoint 2010 using designer 2010:


Ø  List Workflow – This is associated with a specific list or libraries in SharePoint.

Ø  Reusable Workflow – This type of workflow can be associated with multiple lists or content types. It is more flexible than the List workflow type. Later this content type can be used with a list. One more advantage of this type of work flow is you can import it to Visual Studio and we can write code to enhance this type of workflow.

Ø  Site Workflow – This workflow is not associated with any lists or site content types and can be started from All Site content in the page i.e., it operates on the site level.

When you create a workflow, you will see the following new options in the ribbon which makes the user to create and trouble shoot the workflow in SharePoint very easily.

Now let us know about the new options for implementing the workflow in SP 2010 designer. Particularly in the ribbon interface.


  1. Save button – Now you can save the workflow. This option was not available in SharePoint Designer 2007.
  2. Publish button – By clicking the publish button, you can publish the workflow to the SharePoint site.
  3. Condition – Here you can implement the conditions for the workflow.
  4. Action – Here you can add multiple actions when a specific condition occurs in the workflow.
  5. Export to Visio – Using this option, you can convert a workflow and show it in a diagrammatic representation to the user which gives clear understanding, actions, process, people involved and status of the workflow.
  6. Initiation Form Parameters – you can define the starting parameters for the workflow.
  7. Local Variables – Here you can define the internal variables of the workflow using this option.

Apr 16, 2012

Workflow using SharePoint designer 2007

To know about the basics of the Work flows in SharePoint, read this article.
In this article, we will learn how to create a designer workflow in SharePoint designer 2007.
Scenario:
1.   Create a workflow in SharePoint designer 2007
2.   This workflow should be automatically triggered when an item is created or updated in a SharePoint Document library
3.   When the workflow is initiated, then the document created or updated in the document library should be copied to another document library
4.   Also, we will have parameter (flag) in the document library whether to move or not in the document library.

Solution:
We will create two document libraries named, “Draft Library” and “Publish Library”.
In the Draft Library we will create an additional column named Move to Publish Library of type Choice menu (YES or NO)
When a document is uploaded or updated in Draft Library with the flag value equals to yes, then the workflow should be triggered which will copy the item to the Publish Library.

Steps:
Open the SharePoint site in the designer and click on File -> New -> Workflow


Give the name of the workflow and Select the document library for the workflow to be associated (Draft Library in our case). Then Select two options Automatically starts the workflow when an item is created or change and click on Next.


In the Step1, click on the conditions and select Compare Draft Library field


Now, select the Move to Publish Library column and Value equals to Yes as shown below



Now we will apply the action for the workflow. Click on Actions -> Copy List Item. 


Now select Draft Library to Publish Library in the values as shown below


Once you click on finish, then the workflow will be associated to the “Draft Library”.


Navigate to the SharePoint Document library and when you check the workflow settings, and then you will see the MoveDocuments workflow associated with the Draft document library.


Now, we will test the workflow. Go ahead and upload a document into the “Draft Library”. Select YES in the Move to Publish Library option as shown below:


Now, our workflow will be initiated and you will see the status of the workflow (completed) in the document library as shown below:



Click on the completed in the document library where you will be navigated to the workflow information as shown below:


Now, navigate to the publish library, you will see the document being copied as result of the workflow as shown below:


Now, at the end of this article we have learned the following from this article:
1. Creating a Designer workflow in SharePoint using SharePoint designer 2007.
2. Used workflow to copy an item form one document library to another document library.


To know about the new features added in SharePoint Designer 2010, read this article.

Free to comment if this article helps you!

Workflows in SharePoint

What is a Workflow in SharePoint?
Ø  In simple words, we can say workflow is a serious of activities occurs in steps which will produce an output at the final step.
Ø  In SharePoint, workflow is an automated movement of documents or items through a sequence of actions or tasks that are related to a business process
Ø  Business process is a sequence of steps that occurs on a document or a task or an item and finally produces a result as an outcome.

Types of Workflows
Basically, there are two fundamental types of workflows in the SharePoint:
                       
   1.   Sequential workflow
It represents the steps that execute in order until the completion of last activity. It is represented graphically in flowchart with start, end and all the sequential activities in between.
Example

   
  2.   State-Machine workflow
It represents a set of states, transitions and actions. As sequential workflows, it does not have prescribed execution flow and need not have an end. It can have any number of states and transition and it can any items related to any transition.
Example


The different types of workflow in the various versions of SharePoint present by default are listed below:

Ways for creating workflows in SharePoint
The different ways of creating the workflows in SharePoint are as follows:
    1.   In SharePoint site directly
    2.   SharePoint Designer
    3.   Microsoft Visual Studio with workflow extensions installed (WWF- Windows Workflow Foundation) – basically called custom workflows
    4.   Third party tools like K2 Black Perl, Nintex, etc.,

What are the pre-requisites for creating a workflow in SharePoint?
    1.  There should be a at least one list or document library to create and associate a workflow.
    2.   If you do not have a single list or document library in your site, you will be prompted for creating a list or library.
    3.   If you want your workflow to be associated with custom columns or settings in the site, then those changes should be made before you create the workflow so that it will be available in the designer.

Advantages
 Ø  Allow the business activities to be automated, enabling actions such as document review, approval, issue tracking and signature collection.
 Ø  Allow the document to be routed to one person to another for approval by assigning a task to each person. This is followed by analysis, review, and approval and finally the document is published. Hence making the document management easier.
 Ø  Also improves the collaboration in an enterprise.

To know about creating a designer workflow in SharePoint using SharePoint designer 2007, read this article.


To know about the new features added in SharePoint Designer 2010, read this article.