This project is read-only.

Which version to install?

Apr 7, 2009 at 1:17 AM
Hi Guys,

This is very exciting--I'm really looking forward to continued development of this tool.  One question:  Should I be running the 1.1 Alpha release?  I've tried to follow the steps in the video as closely as possible, but I get the "Unknown Error" when trying to edit a task form.  I have compile=debug and custom errors off in the web.config, but still don't get an error message, nor do I find anything in the logs. Looking over the changesets since the December release, it looks like there are some bug fixes I need.  I noticed the GetTaskData method in the template for the task item, and changed that back to GetData, but I'm thinking the errors might be due to how I specified the task form in the workflow metadata.  In the video Wouter used:

<

Task_0FormUrl>/_controltemplates/SimpleApprovalWorkflow/ApprovalTaskControl.ascx</Task_0FormUrl>

 

But in another discussion thread it was suggested to use:

<

Task_0_FormUrl>/_controltemplates/SimpleApprovalWorkflow/ApprovalTaskControl.ascx</Task_0_FormUrl>

 

I'm not sure which changeset that was implemented in.  I'd love to use this in a workflow project I'm currently doing.

Regards,
Mike Sharp




Apr 7, 2009 at 1:55 AM
Edited Apr 7, 2009 at 1:57 AM
First, I'd recommend using the 1.0 Release version.  The 1.1 Alpha was posted to help a few developers who needed a signed version with a bug fix.  If you're not using a task list in a web part containing the full toolbar, stick with 1.0.  It's been better tested.

Second, the videos and blog posts are good reference material for the concepts since they haven't changed much since the start of the project.  The other details like the metadata have changed and I'd recommend referencing the sample application that ships with the project for information like that.

It sounds like the Unknown Error is coming from the compilation of the .ascx page.  If you're seeing Unknown Error, something didn't happen correctly in the web.config file.  I'd recommend verifying that the web.config file you changed was the right one.  One way to check if you're on a dev machine is to break the web.config file by making the XML invalid and seeing if WSS breaks.  Don't do this on anything other than a dev machine and make sure you put it back right afterward.

If none of this helps, post the sections of the web.config you changed along with your ascx file and we'll get it sorted out.

Chris

P.S.  You should use the Task_0_FormUrl property when defining the page for a task
Coordinator
Apr 7, 2009 at 6:48 AM

Use 1.0. We are stabilizing 1.1 right now.

For your task, use <Task_0_FormUr>, two underscores. This was changed during the first beta cycle for consistency with a few other areas we use the metadata. Also, paths to controls always start with a ‘/’ slash. That way the file is always read correctly (your sample shows this correctly).

Met vriendelijke groet / with kind regards,

Wouter van Vugt

Technology Evangelist

Email: wouter@code-counsel.net
Mobile: +31 (6) 438 317 12
Weblog: http://blogs.code-counsel.net/wouter

Code Counsel

Sharing Knowledge With Passion

From: rdcpro [mailto:notifications@codeplex.com]
Sent: dinsdag 7 april 2009 2:18
To: Wouter van Vugt
Subject: Which version to install? [wss3workflow:52482]

From: rdcpro

Hi Guys,

This is very exciting--I'm really looking forward to continued development of this tool. One question: Should I be running the 1.1 Alpha release? I've tried to follow the steps in the video as closely as possible, but I get the "Unknown Error" when trying to edit a task form. I have compile=debug and custom errors off in the web.config, but still don't get an error message, nor do I find anything in the logs. Looking over the changesets since the December release, it looks like there are some bug fixes I need. I noticed the GetTaskData method in the template for the task item, and changed that back to GetData, but I'm thinking the errors might be due to how I specified the task form in the workflow metadata. In the video Wouter used:

<

Task_0FormUrl>/_controltemplates/SimpleApprovalWorkflow/ApprovalTaskControl.ascx</Task_0FormUrl>

But in another discussion thread it was suggested to use:

<

Task_0_FormUrl>/_controltemplates/SimpleApprovalWorkflow/ApprovalTaskControl.ascx</Task_0_FormUrl>

I'm not sure which changeset that was implemented in. I'd love to use this in a workflow project I'm currently doing.

Regards,
Mike Sharp



Read the full discussion online.

To add a post to this discussion, reply to this email (wss3workflow@discussions.codeplex.com)

To start a new discussion for this project, email wss3workflow@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Apr 7, 2009 at 11:10 PM
Hi Guys,

Thanks for your rapid response!  After messing with this a bunch this morning, and then going back over the video to make sure I didn't miss anything, I still get "Unknown Error".  I only have a few web applications on this dev server, and even though my naming convention makes it quite clear which one is which, I verified I was using the right one by breaking the web.config and verifying the SharePoint site doesn't load up. 

I can attach the debugger to the parts of the workflow1.cs that are running, but I can't figure out how to debug when the exception is thrown before the task form itself even loads. 

Also, for what it's worth, the Sample Application, TPG.SharePoint.Workflow.Sample, works just fine.  So it's probably just something I fat-fingered, or else it's an issue with the VS templates (like the Task_0_FormUrl issue).

I hope debugging errors isn't always this difficult!  ;^)

So, here are the applicable parts of my Web.config:

    <customErrors mode="Off" />

and 

    <compilation batch="false" debug="true">
      <assemblies>
        <add assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </assemblies>
      <expressionBuilders>
        <remove expressionPrefix="Resources" />
        <add expressionPrefix="Resources" 
                        type="Microsoft.SharePoint.SPResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add expressionPrefix="SPHtmlEncodedResources" 
                        type="Microsoft.SharePoint.SPHtmlEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add expressionPrefix="SPSimpleFormattingEncodedResources" 
                        type="Microsoft.SharePoint.SPSimpleFormattingEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add expressionPrefix="SPUrl" 
                        type="Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </expressionBuilders>
    </compilation>

And my ASCX task file:

<%@ Control Language="C#" AutoEventWireup="true" Inherits="TPG.SharePoint.Workflow.TaskControl, TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>

<tpg:InputForm runat="server">
    <tpg:InputFormSection runat="server"
      Title="Approval Data"
      Description="Enter Data for Task Approval">
        <ContentTemplate>
            <tpg:InputFormControl runat="server"
              LabelText="MyField"
              ExampleText="abcdefg">
                <ControlTemplate>
                    <asp:TextBox ID="CommentsField" runat="server" Width="100%" />
                </ControlTemplate>
            </tpg:InputFormControl>
        </ContentTemplate>
    </tpg:InputFormSection>
    <tpg:ButtonSection runat="server" ShowStandardCancelButton="false">
        <ButtonTemplate>
            <asp:Button ID="Approve" runat="server" Text="Approve" UseSubmitBehavior="false" CommandName="Commit" CommandArgument="Approved" />
            <asp:Button ID="Reject" runat="server" Text="Reject" UseSubmitBehavior="false" CommandName="Commit" CommandArgument="Rejected" />
            <asp:Button ID="Cancel" runat="server" Text="Cancel" CommandName="Cancel" />
        </ButtonTemplate>
    </tpg:ButtonSection>
</tpg:InputForm>

<script type="text/C#" runat="server">
    protected override void LoadData(bool isInitialLoad)
    {
        if (isInitialLoad)
        {
            //TaskData temp = GetTaskData();
            TaskData taskData = GetData();
            CommentsField.Text = taskData["MyComments"] as string;
        }
    }

    protected override TaskData SaveData(object commandArgument)
    {
        TaskData taskData = new TaskData();
        taskData["MyComments"] = CommentsField.Text;
        taskData["Approver"] = Context.User.Identity.Name;
        taskData["MyApprovalStatus"] = commandArgument;
        return taskData;
    }  
</script>

 
Thanks again!
Mike

Apr 7, 2009 at 11:33 PM
Odds are it's just a simple compilation error in the .ascx file.  I just noticed you're not settings CallStack property to true in the web.config as well.  That might help you get more information on the error.  I've never tried just changing some of the properties.

Check this blog post to see an example.

http://blogs.msdn.com/angus_logan/archive/2006/12/16/how-to-enable-debugging-in-wss-3-0.aspx

If that gives you a better error message, let me know.

Chris
Apr 8, 2009 at 12:28 AM
Oh yeah, that helped! 

Object reference not set to an instance of an object.   at TPG.SharePoint.Workflow.TaskPage.get_DueDate()

I never realized the call stack was turned off.  Now that I can actually get the call stack for the exception, this error makes more sense.  In fact, I was browsing through the other discussion threads and saw something about DueDate...http://wss3workflow.codeplex.com/Thread/View.aspx?ThreadId=44475  I'm not sure why I didn't try this before...

The fix is pretty obvious:

private void CreateApprovalTask_Invoking(object sender, EventArgs e)
{
    WorkflowConfigurationData configDataInitiation =
     WorkflowDataSerializer.DeserializeFromXmlString<WorkflowConfigurationData>(workflowProperties.InitiationData);
    TaskId = Guid.NewGuid();
    CreateTask activity = (CreateTask)sender;
    activity.TaskProperties = new SPWorkflowTaskProperties();
    activity.TaskProperties.AssignedTo = configDataInitiation.Approver;
    activity.TaskProperties.TaskType = 0;
    activity.TaskProperties.Title = "Please approve this";
    activity.TaskProperties.DueDate = DateTime.MaxValue;  // I'll probably want to add DueDate in the initiation form as a required field, or set a business rule for it.
}


So, one other question, then (though it should probably be on a separate thread), is there any way using your tool to control the content of the Task Notification email, or is that something I'll have to do via a separate SharePoint customization?

Thanks for your help!
Mike
Apr 8, 2009 at 12:31 AM
I'm glad that fixed it for you.

I'm not in front of a SharePoint machine right now, but I believe there's a property in activity.TaskProperties in your Invoking method above that allows you to define the email that is sent.  We don't have anything in the toolset that helps with that.

Chris
Apr 8, 2009 at 12:43 AM
Oh, you're right.  Doh, it's right below TaskProperties.DueDate in the intellisense... TaskProperties.EmailBody.

I gotta say, this workflow tool rocks!  This is so much easier than the manual method.  Now I have figure out how to roll ContentTypes into this, and I'll be set. 

Thanks again for your efforts,
Mike
Apr 8, 2009 at 1:19 AM
It's good to hear you like the tools.  We always like hearing positive feedback.

Chris
Coordinator
Apr 8, 2009 at 7:20 AM

Note that the DueDate not being set is resolved in v1.1. My bug, sorry J. For now you should just set the duedate to a real value, or install the 1.1 alpha (named it alpha, is the same code though)

Please review our project so people can get a sense of quality when they visit the main page! Thanks!

Met vriendelijke groet / with kind regards,

Wouter van Vugt

Technology Evangelist

Email: wouter@code-counsel.net
Mobile: +31 (6) 438 317 12
Weblog: http://blogs.code-counsel.net/wouter

Code Counsel

Sharing Knowledge With Passion

From: predeekc [mailto:notifications@codeplex.com]
Sent: woensdag 8 april 2009 2:19
To: Wouter van Vugt
Subject: Re: Which version to install? [wss3workflow:52482]

From: predeekc

It's good to hear you like the tools. We always like hearing positive feedback.

Chris

Read the full discussion online.

To add a post to this discussion, reply to this email (wss3workflow@discussions.codeplex.com)

To start a new discussion for this project, email wss3workflow@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com