Page Rules
Dynamic management of form page display.
Overview
Page rules allow you to control which page of a form is displayed based on:
- The mode (creation, edition, reading, printing)
- The workflow step
- Custom conditions
Display Modes
public enum FormPageMode : short
{
All = 0, // Tous les modes
Reading = 1, // Lecture seule
Edition = 2, // Édition
Creation = 3, // Création
Printing = 4, // Impression
Preview = 5 // Prévisualisation
}
Page Configuration
Accessing Configuration
In Process Studio:
- Open the form
- Forms menu → Page Distribution
- List of configured pages
Page Properties
public class FormularView
{
public string IdFormular { get; set; } // ID du formulaire
public string PageName { get; set; } // Nom de la page .aspx
public FormPageMode Mode { get; set; } // Mode d'affichage
public string ProcessName { get; set; } // Nom du workflow
public string ActivityName { get; set; } // Nom de l'étape
public int Priority { get; set; } // Priorité (ordre)
}
Display Rules
By Mode
Creation page:
Mode = FormPageMode.Creation
ProcessName = "*" // Tous les workflows
ActivityName = "*" // Toutes les étapes
Edition page:
Mode = FormPageMode.Edition
ProcessName = "*"
ActivityName = "*"
Reading page:
Mode = FormPageMode.Reading
ProcessName = "*"
ActivityName = "*"
By Workflow Step
Step-specific page:
Mode = FormPageMode.Edition
ProcessName = "Workflow_Validation"
ActivityName = "Etape_Approbation"
Priority = 1
End of workflow:
Mode = FormPageMode.Reading
ProcessName = "*"
ActivityName = "-Fin-" // Workflow terminé
Without workflow:
Mode = FormPageMode.All
ProcessName = "-Aucun-" // Pas de workflow actif
ActivityName = "-Aucun-"
Priority
The priority determines which page to display if multiple match:
- Priority 1: Displayed first
- Priority 2: If priority 1 not applicable
- etc.
Programmatic Management
Load Form Pages
var formDataSource = new FormularManagerWrapper(applicationProfile);
var formViews = formDataSource.GetFormularViews(idFormular);
var allViews = formViews.GetAllViews();
foreach (var view in allViews)
{
Console.WriteLine($"Page: {view.PageName}, Mode: {view.Mode}");
}
Add a Page
var newView = new FormularView(idFormular)
{
PageName = "Page_Validation.aspx",
Mode = FormPageMode.Edition,
ProcessName = "Workflow_Principal",
ActivityName = "Validation_Manager",
Priority = 1
};
formViews.AddFormularView(newView);
formDataSource.SaveFormularViews(formViews);
Remove a Page
formViews.RemoveFormularView(viewId);
formDataSource.SaveFormularViews(formViews);
Use Cases
Simplified Creation Page
Display only essential fields during creation:
Mode: Creation
Page: Page_Creation_Simple.aspx
Fields: Title, Type, Requester
Complete Edition Page
Display all fields in edition:
Mode: Edition
Page: Page_Edition_Complete.aspx
Fields: All form fields
Step-Specific Page
Different page for each validation step:
Step 1 (Drafting): Page_Redaction.aspx
Step 2 (Validation): Page_Validation.aspx
Step 3 (Approval): Page_Approbation.aspx
Print Page
Optimized layout for printing:
Mode: Printing
Page: Page_Print.aspx
Format: PDF, A4, no buttons
Best Practices
- Simplicity: Don't multiply pages unnecessarily
- Consistency: Maintain similar structure between pages
- Performance: Load only necessary components
- Testing: Verify all mode/workflow combinations
- Documentation: Document the logic of rules
References
Main Classes
FormularView: Page definitionFormularViewsHelper: Page managerFormPageMode: Mode enumeration
Tables
FormularViews: Page configuration