Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Without a doubts one of the best things of MOSS 2007 is the new SharePoint Designer, and within him, the workflow designer, that allows us speedy and simple form to design workflows. As I have commented in other occasions, if we wish to make more complex workflows, or state machines, we need to use Visual Studio. SharePoint Designer, allows us to make sequential workflows with predetermined activities. Nevertheless, the possibility to extend the basic activities exists and we can extend the functionality of ours workflows without to write them completely in Visual Studio. Out-the-box, SharePoint Designer includes 22 actions.
Those actions are defined in the file WSS.ACTIONS, that resides in the directory “C:\Program Files\Common files\Microsoft Shared \web server extensions\12\1033\TEMPLAT\Workflow”. In this file, the conditions and the actions that appear within SharePoint Designer are defined.
<Condition Name="Creado en un intervalo de fechas determinado" FunctionName="CreatedInRange" ClassName="Microsoft.SharePoint.WorkflowActions.Helper" Assembly="Microsoft.SharePoint.WorkflowActions, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" AppliesTo="list" UsesCurrentItem="true"> <RuleDesigner Sentence="creado entre %1 y %2"> <FieldBind Id="1" Field="_1_" Text="fecha" DesignerType="Date"/> <FieldBind Id="2" Field="_2_" Text="fecha" DesignerType="Date"/> </RuleDesigner> <Parameters> <Parameter Name="_1_" Type="System.DateTime, mscorlib" Direction="In"/> <Parameter Name="_2_" Type="System.DateTime, mscorlib" Direction="In"/> </Parameters> </Condition>
Herein, we can see the assembled dll that handles the condition, to which elements he is applied, and if it is possible to use the present item in the workflow.Within the condition we have the rule for the designer, with the text that is going to appear; each rule uses a series of fields tags FieldBind, that connects with the necessary parameters in the assembled file.Each tag FieldBind has an identifier that corresponds with the position of the field within sentence ID=1, and that will be %1 in the sentence attribute as well.Also we can see attributes like Text, that will be the text by defect, and the DesignerType, that is the type of field.After that, we have the section of Parameters with the different parameters that will go to the assembled file. The Name attribute has to correspond with the Field attribute of tag FieldBind, and the direction of the parameter needs to be In for input and Out for output.
<Action Name="Establecer estado de aprobación del contenido" ClassName="Microsoft.SharePoint.WorkflowActions.SetModerationStatusActivity" Assembly="Microsoft.SharePoint.WorkflowActions, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" AppliesTo="list" ListModeration="true" Category="Acciones principales" UsesCurrentItem="true"> <RuleDesigner Sentence="Establecer estado de aprobación del contenido en %1 con %2"> <FieldBind Field="ModerationStatus" DesignerType="Dropdown" Id="1" Text="este estado"> <Option Name="Aprobado" Value="Approved"/> <Option Name="Rechazado" Value="Denied"/> <Option Name="Pendiente" Value="Pending"/> </FieldBind> <FieldBind Field="Comments" Text="comentarios" Id="2" DesignerType="TextArea" /> </RuleDesigner> <Parameters> <Parameter Name="ModerationStatus" Type="System.String, mscorlib" Direction="In" /> <Parameter Name="Comments" Type="System.String, mscorlib" Direction="Optional" /> <Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" /> <Parameter Name="__ListId" Type="System.String, mscorlib" Direction="In" /> <Parameter Name="__ListItem" Type="System.Int32, mscorlib" Direction="In" /> </Parameters> </Action>
Now, we are going to see how the actions look in the same file; they are very similar to the conditions. The first part includes the assembled one that will take care to handle the action.The second one, are the rules for the designer. In this case the fields that has been used are a combobox (DesignerType= " Dropdown ") and a line of text (DesignerType= " TextArea ")The third part of the parameters, besides to use both fields defined in the rule of the designer, uses three additional parameters that are:__Context: that it is the context of the WorkFlow. __ListId: you go of the list with which we are working __ListItem: the present itemWith these three fields (that they are pre-established, so that we can use them whenever we want) we have as much control on the list as on the job stream that is being carried out. At the moment A file XSD for this type of archives does not exist.