3

I Created a VS 2010 project with a custom workflow activity and I wish to deploy that to the server. My development machine does not have SharePoint installed, so I decided to use WSP Builder. I haven't used it in over a year so I'm not sure if I'm doing things correctly.

  1. I added a the following folder hierarchy to my project: TEMPLATE\FEATURES\FeatureName\ActivityName
  2. I added a feature file: TEMPLATE\FEATURES\FeatureName\Feature.xml
  3. I added a activity element file: TEMPLATE\FEATURES\FeatureName\ActivityName\Elements.xml
  4. I added a class file for my custom activity
  5. I signed the project and compiled it
  6. I right-clicked the project and built the package from WSP Builder menu

The following are the contents of the xml files:

Feature.xml

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="1D271C8B-6747-45C4-9590-2CF96CFC4F93" 
         Scope="Site"
         Title="Feature Name" 
         Description="Feature Description" 
         Creator="Deverop" 
         xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="ActivityName\Elements.xml"/>
  </ElementManifests>
</Feature>

Elements.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <WorkflowActions>
    <Action Name="My custom activity"
        ClassName="SharePoint.ActivityName"
        Assembly="SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b31fc0364fa5f62c"
        Category="Custom Activities"
        AppliesTo="all">
      <RuleDesigner Sentence="Update web service at address %1 with value %2">
        <FieldBind Field="Address" Text="Address" Id="1" DesignerType="TextArea" />
        <FieldBind Field="StatusId" Text="Status Id" Id="2" DesignerType="TextBox" />
      </RuleDesigner>
      <Parameters>
        <Parameter Name="Address" Type="System.String, mscorlib" Direction="In" DesignerType="Stringbuilder" Description="Web service address" />
        <Parameter Name="StatusId" Type="System.String, mscorlib" Direction="In" />
        <Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In" DesignerType="Hide" />
      </Parameters>
    </Action>
  </WorkflowActions>
</Elements>

Unfortunately, when I deploy the wsp, I do not see my custom action in SharePoint Designer.

Where could I have gone wrong?

1 Answer 1

5

I guess I will answer my own question. The solution was to create a ActivityName.actions file in TEMPLATE\1033\Workflow folder.

ActivityName.actions

<?xml version="1.0" encoding="utf-8" ?>
<WorkflowInfo>
  <Actions>
    <Action Name="My custom activity"
    ClassName="SharePoint.ActivityName"
    Assembly="SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b31fc0364fa5f62c"
    Category="Custom Activities"
    AppliesTo="all">
      <RuleDesigner Sentence="Update web service at address %1 with value %2">
        <FieldBind Field="Address" Text="Address" Id="1" DesignerType="TextArea" />
        <FieldBind Field="StatusId" Text="Status Id" Id="2" DesignerType="TextBox" />
      </RuleDesigner>
      <Parameters>
        <Parameter Name="Address" Type="System.String, mscorlib" Direction="In" DesignerType="Stringbuilder" Description="Web service address" />
        <Parameter Name="StatusId" Type="System.String, mscorlib" Direction="In" />
        <Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In" DesignerType="Hide" />
      </Parameters>
    </Action>
  </Actions>
</WorkflowInfo>

UPDATE In addition, I had to add a SafeControl and AllowedType entry in the web.config in order to use the custom action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.