Workflow Lite for SharePoint RC1 (Finally!)

Finally I've found some time to work some more on my SharePoint Lite for SharePoint project and today the Release Candidate 1 can be downloaded form the GotDotNet Workspace. RC1 is feature-complete for V1 (I've already got some cool features for the next version in mind), to get an idea what's possible you can watch this video. To install the workflow engine, execute the MSI package (so the assembly gets deployed to the GAC) and follow the installation instructions closely. The installation instructions are modified a little bit, so the installation video isn't up to date anymore but it will be updated ASAP. Probably the main part in the installation is the creation of the config file that contains the workflow logic. At this point you need to alter the configuration XML file manually, but there's a Configuration Application on its way. A very basic configuration file could look like this (updated on the 15th of June, see http://weblogs.asp.net/jan/archive/2004/06/15/156419.aspx):

<?xml version="1.0" encoding="utf-8" ?>
<WorkflowConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Leadit.SharePoint.Workflow/WorkflowConfiguration">

  <WorkflowStage DocumentLibraryURL="
http://server/site/documentlibrary">
    <Description>DocumentLibrary 1</Description>
    <Properties>
      <Property Name="Status">
        <Triggers>
          <Trigger PropertyValue="Ready To publish">
            <Actions>
              <Action Type="COPY">
  <Parameter1>In Review</Parameter1>
  <Parameter2></Parameter2>
  <Parameter3></Parameter3>
       </Action>
              <Action Type="SETFIELDVALUE">
  <Parameter1>Submitted by</Parameter1>
  <Parameter2>{FIELD:Modified By}</Parameter2>
  <Parameter3></Parameter3>
       </Action>
              <Action Type="DELETESOURCE">
  <Parameter1></Parameter1>
  <Parameter2></Parameter2>
  <Parameter3></Parameter3>
       </Action>
              <Action Type="SENDMAIL">
  <Parameter1>review@mycompany.com</Parameter1>
  <Parameter2>Document {FIELD:Title} added for review</Parameter2>
  <Parameter3>Submitted by{FIELD:Submitted by}{NEWLINE}Submitter comments:{NEWLINE}{FIELD:Comments}</Parameter3>
       </Action>
            </Actions>
          </Trigger>
        </Triggers>
      </Property>
    </Properties>
  </WorkflowStage>
</WorkflowConfiguration>

A configuration file contains one or more WorkflowStage nodes, each node corresponds to a stage in the workflow process, so a SharePoint document library corresponds to a WorkflowStage. The DocumentLibraryURL tag sets the location of the document library for which it should work, the Description tag is descriptive only. A WorkflowStage node can contain one or more Property nodes, contained in the Properties tag. A Property node corresponds with a field of the document library which will be used by the workflow process. The Name attribute of the Property tag should contain the name of that document library field. Each Property node can contain one or more Trigger nodes, contained in the Triggers tag. A Trigger node corresponds with a specific value of the document library field, which should be specified in the PropertyValue attribute. Finally a Trigger node can contain one or more Action nodes, contained in the Actions tag. An Action node corresponds with an action that the workflow process should execute. Each Action node has a specific type, and three optional parameter values. Here’s a list of the Action types that are currently implemented:

  • Action type: COPY
    Copies the document library item to a specified document library. Any action that is executed before the copy statement is applicable to the originating document library item. Any action that is executed after the copy statement is applicable to the copied document library item. For example: a SETFIELDVALUE action that happens before the COPY action, changes a field value of the originating document library item. A SETFIELDVALUE action that happens after the COPY statement will change a field value of the copied document library item. Of course the DELETESOURCE is always applicable to the originating item!
    Parameter 1: destination document library
    Parameter 2 and 3: not used
  • Action type: SETFIELDVALUE
    Sets the value of a field to a specified value. This value can be a fixed string, or a reference to other field values.
    Parameter 1: name of the field to set
    Parameter 2: value to which the field should be set (see formulas for more information about the format). Examples: “Fixed string“, “{FIELD:OtherField}“, “{FIELD:OtherField1} fixed string {FIELD:OtherField2}“
    Parameter 3: not used
  • Action type: DELETESOURCE
    Deletes the originating file from the document library.
    Parameter 1, 2 and 3: not used
  • Action type: CREATEEVENTITEM
    Creates an event item in a specified event log SharePoint list. The event log SharePoint list is a custom list, containing the following fields: Title (default), Event (single line of text), Initiator (user lookup field), Comments (multiple lines of text). 
    Parameter 1: the event log SharePoint list
    Parameter 2: the event type (for example: “Document Published“, “Document Declined“)
    Parameter 3: comments for the event log item (see formulas for more information about the format)
  • Action type: SENDEMAIL
    Sends an email to a specified person or a specified SharePoint group.
    Parameter 1: mail to value. This value can either be a fixed string like “reviewer@mycompany.com“, the name of a SharePoint Group (site level) or the value of a specific field like “{FIELD:Modified By}“. In the last case, the workflow engine will retrieve the corresponding email of the user specified in the Modified By field. The value of parameter 1 can contain HTML, so HTML formatted mails are sent.
    Parameter 2: mail subject value (see formulas for more information about the format)
    Parameter 3: mail body value (see formulas for more information about the format)

A parameter that can contain a formula, can use references to other fields of the document library item. The syntax is pretty straight forward, some examples:

  • {FIELD:Submitter Comments}
  • Comments by {FIELD:Modified By} {NEWLINE} {FIELD:Submitter Comments}
  • Submitted by {FIELD:Modified By} on {NOW}

So what's next? In the next few days I will create more documentation and update the demo and installation video to reflect the new possibilities. Based on your feedback the final V1 version will be released. After that I'll be accepting contributors for the GotDotNet Workspace, if you're intrested contact me, and I'll invite you. Please do only apply if you are really planning to contribute to the project! Thanks to the people who have mailed me their feedback and bugs!

44 Comments

  • This looks similar to the CorasWorks email connector/workflow solution, but it's 'marginally' cheaper. Very good. Thanks for sharing.

  • Can you explain a little bit more Thomas? When do you want to filter?

  • Great stuff Jan, looking forward to checking this out...

  • What I meant was when a document is not yet published it should not show up in the search results.

  • Hi Jan!



    Your RC1 looks promising. :) I tried to download it but I can't (it shows a disclaimer). How can I download it? By the way, I applied for your workspace, but I realized that I can't help/contribute to your project. Feel free to decline my application. :) Thanks!

  • Hi jan!



    I have successfully installed the Beta version but after installing the RC1 edition, I am having a problem. I am receiving the error



    Could not execute the COPY action.(System.ArgumentException: Value does not fall within the expected range.

    at Microsoft.SharePoint.SPWeb.c(String A_0, Boolean A_1, Boolean A_2)

    at Microsoft.SharePoint.SPWeb.f(String A_0)

    at Microsoft.SharePoint.SPFile.a(String A_0, Boolean A_1, Boolean A_2)

    at Microsoft.SharePoint.SPFile.CopyTo(String strNewUrl, Boolean bOverWrite)



    Any ideas?

  • Eugene, that's strange... send me an email and I'll mail it to you.



    Graham, I've send you an email for some more info.

  • I am having trouble getting RC1 to work. I was succesfully using the beta and now It doesnt seem to work.

  • Hi Jan,



    I installed the beta version, and it works fine but for RC1, it does not work eventhough I followed the instructions indicated on the readme. I don't receive any application error.



  • Still unable to get RC1 to work. I followed the install precisely. Any idea why I am unable to get it to work. In the meantime I went back to the beta version.



    Please keep me posted

  • I'm getting the &quot;Value does not fall within the expected range&quot; error too, with RC1.

  • Has anybody had any luck with RC1 ?

    I'm also getting the &quot;Value does not fall within the expected range&quot; error on COPY action in the Event log.

  • I am also getting this error, any news on how to fix it? Btw, great job Jan the videos look great for a sharepoint only workflow which is exactly what I'm looking for at the moment. Looking forward to getting this fixed...

  • I am also having the same COPY error. The Delete function works so I know it is executing. Are we able to download the Beta version in the meanwhile?? I can't find it anywhere. Thanks.

  • I'm getting the &quot;Value does not fall within the expected range&quot; error too, with RC1.

  • I'm having the following Error!! How can I fix it???

    Unable to instantiate event handler (assembly &quot;Leadit.SharePoint.Workflow, Version=0.2.0.0, Culture=neutral, PublicKeyToken=3948f234bbbabe18&quot;, class &quot;Leadit.SharePoint.Workflow.EventHandler&quot;), or report event for &quot;En Progreso/Demo WEB Parts.txt&quot; in &quot;En Progreso&quot;. Could not execute the COPY action.(System.ArgumentException: Value does not fall within the expected range.

    at Microsoft.SharePoint.SPWeb.c(String A_0, Boolean A_1, Boolean A_2)

    at Microsoft.SharePoint.SPWeb.f(String A_0)

    at Microsoft.SharePoint.SPFile.a(String A_0, Boolean A_1, Boolean A_2)

    at Microsoft.SharePoint.SPFile.CopyTo(String strNewUrl, Boolean bOverWrite)

    at Leadit.SharePoint.Workflow.EventHandler.HandleEvent(SPListEvent le))

  • Hi Jan,

    This is really cool

    And I noticed the config file has got sorted out in RC1c



    Btw how about including logging in this.

    Might be easier to troubleshoot issues that may arise that way.

  • Tariq



    What do you mean by loggin? Bugs/issues can be tracked in the GotDotNet Workspace.



    Or do you mean logging inside the workflow engine?

  • this is only work for serial flow.

    is it possible to make it parallel also.

    i mean both work together ??? if yes...tell me in details.....



  • Jain



    Could you explain the scenario you are thinking about, a little bit more? Btw, maybe it's easier to contact me through the contact link to solve this issue.

  • hi jan,



    in this existing scenario , only one persone at a time can approve the document after this it moves to next folder for other person approvable.but if more then one person suppose three person want to approve/reject this doc OR any one out of three then this workflow lite will not work.(parallel flow.)

  • Oier, you can replace Title by the name of the field in your doc. lib. For example {FIELD:MyCustomField}

  • Can workflow lite work with Lists too? Like the Issues list?



    I would like to send email to people based on the status field of the issues list(open, updated, resolved)with fields from the same list in the body of the email message.



  • Hi, I just read your workspace. Is workflow lite work for SharePoint 2003 ?

  • Wade, it only works with Document Libraries (by design of SharePoint itself).



    Riwut, it's for SharePoint Portal Server 2003 or Windows SharePoint Services.

  • Mike, can you send me an email (using the contact form) so we can discuss your problem in detail?



    At this point it's not yet possible to trigger actions based on the value of 2 fields.

  • Is it possible to trigger on the &quot;Approval status&quot; field/value ?

    I have tried with no success.

    I would like to move the documents based on approval status.

  • When I catch &quot;Modified By&quot; fiels I get &quot;#:4Administrator&quot; instead of the value &quot;Administrator&quot; Where did the &quot;#:4&quot; bit come from?? and how can I stop it from adding this extra piece?

  • Problem solved.

    I was testing on an external documentlibraryurl from within my local network.

    Works fine now, compliments, I'm very interested in what is to come next.

  • Hi ,

    I had modified config file and reduced the Actions only to COPY.It's not working ...

    Whether all actions be present in the config file ??

    Pls. respond.

  • Hi Poonam,



    No, not all actions have to be present.

    There are a few things however you should look after :

    Be sure that all colums and actions in your config file have the exact same name as in your document libray, they are case sensitive!



    In detail :



    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;

    &lt;WorkflowConfiguration xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://Leadit.SharePoint.Workflow/WorkflowConfiguration&quot;&gt;

    &lt;WorkflowStage DocumentLibraryURL=&quot;-X1-&quot;&gt;

    &lt;Description&gt;DocumentLibrary 1&lt;/Description&gt;

    &lt;Properties&gt;

    &lt;Property Name=&quot;-X2-&quot;&gt;

    &lt;Triggers&gt;

    &lt;Trigger PropertyValue=&quot;-X3-&quot;&gt;

    &lt;Actions&gt;

    &lt;Action Type=&quot;COPY&quot;&gt;

    &lt;Parameter1&gt;-X4-&lt;/Parameter1&gt;

    &lt;Parameter2&gt;&lt;/Parameter2&gt;

    &lt;Parameter3&gt;&lt;/Parameter3&gt;

    &lt;/Action&gt;



    &lt;/Actions&gt;

    &lt;/Trigger&gt;

    &lt;/Triggers&gt;

    &lt;/Property&gt;

    &lt;/Properties&gt;

    &lt;/WorkflowStage&gt;

    &lt;/WorkflowConfiguration&gt;









    If for example you want to copy a document from documentlibray work to documentlibrary done

    Suppose the libraynames are &quot;<a target="_new" href="http://localhost/sites/wflow/work&quot;">http://localhost/sites/wflow/work&quot; and &quot;http://localhost/sites/wflow/done&quot;



    Replace in the above :



    -X1- with the source documentlibraryurl : &quot;<a target="_new" href="http://localhost/sites/wflow/work&quot;">http://localhost/sites/wflow/work&quot;

    -X2- with the column you use for action triggering : for example &quot;Status&quot;

    Be sure that this column is in your documentlibarylistheader

    -X3- with the value of column X2 on which you will take action : for example : &quot;Ready&quot;

    -X4- with &quot;done&quot;





    In your case both doclibs should have the same columns.

    If you want to give the document in the destination library a new status you must the setfieldvalue action.



    I hope this helps, otherwise you can contact me on bk.2000@home.nl



    Sjeng



  • Problem with triggering on the &quot;Approval field&quot; solved.



    If you want to trigger on the approval field (I wanted to copy a document based on the approvalfield value) add this to the config file:

    &lt;Properties&gt;

    &lt;Property Name=&quot;Approval Status&quot;&gt;

    &lt;Triggers&gt;

    &lt;Trigger PropertyValue=&quot;0&quot;&gt;

    &lt;Actions&gt;

    &lt;Action Type=&quot;COPY&quot;&gt;

    &lt;Parameter1&gt;In Review&lt;/Parameter1&gt;

    &lt;Parameter2&gt;&lt;/Parameter2&gt;

    &lt;Parameter3&gt;&lt;/Parameter3&gt;

    &lt;/Action&gt;

    &lt;Action Type=&quot;SETFIELDVALUE&quot;&gt;

    &lt;Parameter1&gt;Submitted by&lt;/Parameter1&gt;

    &lt;Parameter2&gt;{FIELD:Modified By}&lt;/Parameter2&gt;

    &lt;Parameter3&gt;&lt;/Parameter3&gt;

    &lt;/Action&gt;

    &lt;/Actions&gt;

    &lt;/Trigger&gt;

    &lt;/Triggers&gt;

    &lt;/Property&gt;

    &lt;/Properties&gt;

  • By the book, nice video showing how it should work.





  • I also have a problem with the modified by attribute, I get &quot;10;#&quot; appended the front of the name when I use that field value to SETFIELDVALUE another one.

  • Is there a way to speed up the time taken for the events to trigger when moving a doc from one library to another?

  • Is it possible to use workflow lite with a forms library?

  • Any idea on how I should do this, I've tried and tried but not getting anywhere.



    Thanks

  • Jan,

    is there an event to catch a doc being inserted into a library?

  • hi, i'm from brazil and i need all pack with 3 files (leadit.sharepoint.workflow.dll , readme.txt , Sample.xml).
    I take de movie class WorkflowInstallation.wmv , and i need 3 files for to do the workflow here...

    if you've de link... please give me...

  • hi
    release candidate 1 in the gotdotnet workspace does not contain the dll.


  • Hi. I have a series of actions (send mail, copy, set 3 different values) to take place when an event triggered.

    sometimes the actions didn't take place. and gives impersonation error.

    How should i solve this? appreciate any help.

  • I have a problem in your design. I use Firefox in Ubuntu.

  • Lucy! Please call me,Lucy! Please call me

  • Lucy! Please call me,Lucy! Please call me

Comments have been disabled for this content.