1

Using Visual Studio I am creating several custom Tasks to be created in a Workflow. Each of the Tasks have the same fields -- an area for appending comments and a Choice field for indicating where the workflow should go next. The only difference between the types of Tasks are the CHOICE values that are available.

For example

Technical Review Content Type

   Publish
   Reject

Publishing Review Content Type

   Publish
   Reject
   Revise
   Legal Review

My original thought was to

  1. Define Site Column
  2. Create Base Custom Task that references two custom fields
  3. Create Specialized Custom Tasks where the CHOICE field is overwritten with new CHOICE values

As in...

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Field
        ID="{5f8fe565-f627-4aed-b7b1-48e5bd2ec8ac}"
        Name="ArticleAction"
        DisplayName="Action"
        Description="Task actions that can be taken in the given state."
        Type="Choice"
        Required="TRUE"
        Format="RadioButtons">
        <CHOICES>
            <CHOICE>Publish</CHOICE>
            <CHOICE>Reject</CHOICE>
        </CHOICES>
    </Field>
</Elements>


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Task (0x0108) -->
    <ContentType ID="0x01080100B98211051B3409DB40D35D1515D2AB36"
                 Name="Knowledge Base Task"
                 Group="KB Article"
                 Description="Base Content Type for KB Workflow Tasks"
                 Inherits="FALSE">
        <FieldRefs>
            <FieldRef ID="{5f8fe565-f627-4aed-b7b1-48e5bd2ec8ac}"
                      Name="ArticleAction" />
            <FieldRef ID="{5f4f08ad-7f5b-4d5d-879c-50b416acae3d}"
                      Name="ActionComment" />
        </FieldRefs>
    </ContentType>
</Elements>

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Knowledge Base Task (KnowledgeBaseWorkflow\KnowledgeBaseTask) (0x01080100B98211051B3409DB40D35D1515D2AB36) -->
    <ContentType ID="0x01080100B98211051B3409DB40D35D1515D2AB36003EE4B5580C5846B6BE74BFC41A663388"
                 Name="Technical Review Task"
                 Group="KB Article"
                 Description="Content Type for Technical Review Tasks in KB Workflow"
                 Inherits="TRUE"
                 Version="0">
        <FieldRefs>
            <!-- Can I update the CHOICE values here ??? -->
            <FieldRef ID="{5f8fe565-f627-4aed-b7b1-48e5bd2ec8ac}"
                      Name="ArticleAction" />
        </FieldRefs>
    </ContentType>
</Elements>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.