Expand Minimize

Declare required attributes in Workflow

Required attributes Name, CodeBesideAssembly, CodeBesideClass and Id must be declared in Workflow.

CheckId SPC016202
TypeName DeclareRequiredAttributesInWorkflow
Severity Error
Type Workflow

Add required attributes Name, CodeBesideAssembly, CodeBesideClass and Id Workflow. See sample below:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <Workflow
      Name="AdventureWorksWorkflow"
      Id="C6964BFF-BG8D-41ac-AC5E-B61EC111731C"
      CodeBesideClass="AdventureWorks.Workflow1"
      CodeBesideAssembly="AdventureWorks, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e3bce121e9429c"
      Description="Use this workflow to track sequential tasks of users."
      TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
      AssociationUrl="_layouts/myAssocPage.aspx"
      InstantiationUrl="_layouts/myIniPage.aspx"
      ModificationUrl="_layouts/myModPage.aspx">
      <Categories/>
      <AssociationData>
      ...
      </AssociationData>
      <MetaData>
      ...
      </MetaData>
   </Workflow>
</Elements>

To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.

<!-- "SuppressMessage":{"rule":"SPC016202:DeclareRequiredAttributesInWorkflow","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.