Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

Tuesday, December 15, 2009

Issues and solutions in SharePoint workflows


1) Problem:

The workflow template has specified no FormURN for this page or Falied on Start (Retrying)

Solution:
It actually happens when developers use WSPBuidler to develop workflows. WSPBuidler assumes that Association , InstantiationUrl,and Modification forms are pre-defined. At times, we dont need any forms. Therefore, if don't use any form we get remove in elements.xml or workflow.xml as follows:

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>

<Workflow
Name=”StateWorkflowFeature”
Description=”Description for StateWorkflowFeature”
Id=”2b4d26ea-3ca0-494a-9bfc-d692e5774593″”
CodeBesideClass=”WorkflowTest.WorkflowFeature”
CodeBesideAssembly=”WorkFlowTeste, Version=1.0.0.0, Culture=neutral, PublicKeyToken=da0cdeee5575f79e”
TaskListContentTypeId=”0×01080100C9C9515DE4E24001905074F980F93160″”
AssociationUrl=”_layouts/CstWrkflIP.aspx”
InstantiationUrl=”_layouts/IniWrkflIP.aspx”
ModificationUrl=”_layouts/ModWrkflIP.aspx”
StatusUrl=”_layouts/WrkStat.aspx”>

and REPLACE WITH:

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>

<Workflow
Name=”StateWorkflowFeature”
Description=”Description for StateWorkflowFeature”
Id=”2b4d26ea-3ca0-494a-9bfc-d692e5774593″”
CodeBesideClass=”WorkflowTest.WorkflowFeature”
CodeBesideAssembly=”WorkFlowTeste, Version=1.0.0.0, Culture=neutral, PublicKeyToken=da0cdeee5575f79e”>

2) Problem:
Could not find a part of the path C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\CustomWorkflowFeature\Forms

Solution:
It also happens when developer doesn't uses any form. In this case, we have to make sure the following tag is set as such: "<Property Key="RegisterForms" Value="*.xsn" />", the value of RegisterForms key indicates the path to the forms relative to feature file location, if you don't have forms, we should use *.xsn.

Just add this tag "<Property Key="RegisterForms" Value="*.xsn" />"to the Feature.xml file.

REPLACE:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="94276D94-FF30-4da8-801F-C286FF98BA55"
Title="Roll of Dice WF"
Description="This feature is a workflow that rolls dice for you"
Version="12.0.0.0"
Scope="Site"
ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
ReceiverClass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver"
xmlns=http://schemas.microsoft.com/sharepoint/>
<ElementManifests>
<ElementManifest Location="ListTemplates\workflow.xml" />
</ElementManifests>
<Properties>
<Property Key="GloballyAvailable" Value="true" />
</Properties></Feature>

WITH:


<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="94276D94-FF30-4da8-801F-C286FF98BA55"
Title="Roll of Dice WF"
Description="This feature is a workflow that rolls dice for you"
Version="12.0.0.0"
Scope="Site"
ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
ReceiverClass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver"
xmlns=http://schemas.microsoft.com/sharepoint/>
<ElementManifests>
<ElementManifest Location="ListTemplates\workflow.xml" />
</ElementManifests>
<Properties>
<Property Key="GloballyAvailable" Value="true" />
<Property Key="RegisterForms" Value="*.xsn" />
</Properties></Feature>

3) Problem:

The file Shared Documents/Test.doc has been modified by SHAREPOINT\system on 5 July 2009 16:51:42

Solution:
It happens when we upload a documents with workflow in WSS 3.0. It also happens when update any artifact (webpart/workflow/feature etc)through object model. If we execute List item like item.Update(), we will get an error. Its because While update ListItem the file and ListItem object getting disconnected.

Therefore, item.File.Update() will solve your issue.
More info on http://www.mstechblogs.com/sharepoint/

Saturday, August 15, 2009

How to: Extending the List Template programatically with "Content Types"

Hi All,

In previous last post, I had created a List Template and an List Instance programatically using VSeWSS and WSPBuilder. In the List Template (and also List Instance) we can also add "Content types" very easily.

>> We have can create the "content types" through SharePoint UI,
>> Attach the content types to the List Template and List Instance.
>> Use the SharePoint Solution Generator 2008 to reverse engineer the list and we can use this list as WSP package.

These are following steps:

Step1: Create content types through SharePoint UI by navigating to
Site Actions >> Site Settings >> Galleries > Site Content Types












Step2: Create new content type as follows:











Step3: We will create 2 content types for this list. Firstly, Create "Desktop" content type; Select parent content type: "Document Content Types";Parent Content Type: Document and create new group as "System Checklists"




















We will follow Secondly content type "Servers" with "System Checklists" group.


Step4: We navigate to "Test System Checklists" document library which we created through SharePoint UI, Settings >> Document Library Settings >> Add from existing site content type as follows:










Step5: Select site content types from "System Checklists" and both the content types i.e. Desktop and Servers and click OK.














Step6: Select the "Document" from the content type












Step7: Delete this default content type














Step8: Now, you will get these content type when you click on New button.













Step9: We need to SharePoint Solution Generator 2008, Choose "List Definition" >> Choose list (Test System Checklists) >> Project Name: System Checklists v2 >> Finish.

Copy schema.xml of "SystemChecklistsv2" (SharePoint Solution Generator 2008) to "IT.SystemChecklists". Modify the ID of schema.xml and use same as ListTemplates.xml and ListInstances.xml.

Build >> Upgrade the WSPBuilder.

Now, delete the "IT System Checklists" document library, deactivate the site feature "[IT] System Checklists" and activate the feature again.

You will see 2 content types for IT System Checklists.















Happy Programming!

--Aroh

Low Code Reimagined with AI + Copilot Pitch Deck - Copy Copilot day (Virtual) - 2023

 Hi All,  I presneded a session at Pune UG on Low Code Reimagined with AI + Copilot Pitch Deck.  Video is at this address  https://www.youtu...