Related Topics
Form Scripts
Form scripts can be used for both Forms created with the Online Form Designer and custom forms created as .ASCX files.
To develop Form Scripts inside Visual Studio, use the fully functional Visual Studio project installed with the product, which is bundled into a ZIP archive named bpVS.zip. This ZIP file is located in the c:\Program Files\BP Logix\Process Director\ directory by default. You can copy this utility to any computer that runs Visual Studio 2013 or higher. Cloud customers can download the plugin from the Downloads section of the BP Logix support site.
Refer to the sample files eform_*.ascx, as well as the SamplePage.aspx file referenced in the Custom ASPX Pages section of the documentation, below.
Scripts for Forms created with the Online Form Designer should be placed into a separate .ASCX document in the Content List. Here is the structure for this type of script:
<%@ Control Language="C#" AutoEventWireup="false"
Inherits="BPLogix.WorkflowDirector.SDK.bpFormASCX" %>
<script runat="server">
// Events...
</script>
<script>
// Insert client-side JavaScript code and functions here...
</script>
Scripts for .ASCX Forms are typically placed in the same file as the .ASCX source form. Here is the structure for this type of form:
<%@ Control Language="C#" AutoEventWireup="false"
Inherits="BPLogix.WorkflowDirector.SDK.bpFormASCX" %>
// Actual Form contents...
<script runat="server">
// Events...
</script>
<script>
// Insert client-side JavaScript code and functions here...
</script>
Form Script Events #
In both cases, the APIs and events available are the same. All events will be called with the following environment:
LOCAL VARIABLE |
DESCRIPTION |
---|---|
|
Reference to the current Form instance object |
|
Optional instance of the current User object |
|
Instance of the current Partition object |
|
Optional instance of the current Workflow object(Deprecated) |
|
Optional instance of the current WorkflowStep object(Deprecated) |
|
Optional instance of the current WorkflowStepUser object (Deprecated) |
|
Optional instance of the current Project object |
|
Optional instance of the current ProjectActivity object |
|
Optional instance of the current ProjectActivityUser object |
|
The bp environment |
|
The class that holds information about the event that generated postback |
|
The type of event
|
|
The name of the control that initiated the postback |
|
The actual FormControl of the control that initiated the postback |
|
The array row number of event, or 0 if event was not caused inside array. |
The Form life cycle has the following event callbacks:
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="BPLogix.WorkflowDirector.SDK.bpFormASCX" %>
<script runat="server">
// These methods are optionally overridden to allow custom script
// to be inserted into the Form life-cycle.
// Called 1 time per form instance to initialize form fields
protected override void BP_FormInitialize()
{
}
// Called first time in ViewState that form is displayed
protected override void BP_ViewStateInit()
{
}
// Called for every event control and complete button
protected override void BP_Event(bp.EventType pEventType,
string pEventName)
{
}
// Called prior to processing rules
protected override void BP_Rules()
{
}
// Called after processing rules
protected override void BP_Rules_Post()
{
}
// Called prior to completing before internal validation
protected override void BP_Validation()
{
}
// Called prior to completing after internal validation
protected override void BP_Validation_Post()
{
}
// Called prior to saving form data and closing form
protected override void BP_Completed()
{
}
// Called just prior to displaying a form
protected override void BP_Display()
{
}
</script>
These methods are optionally overridden to allow custom script to be inserted into the Form life-cycle:
EVENT |
DESCRIPTION |
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Called 1 time per form instance to initialize form fields |
||||||||||||||||
|
Called first time in ViewState that form is displayed |
||||||||||||||||
See sample above for example. |
Called for every event control and complete button
|
||||||||||||||||
|
Called prior to processing rules |
||||||||||||||||
|
Called after processing rules |
||||||||||||||||
|
Called prior to completing before internal validation |
||||||||||||||||
|
Called prior to completing after internal validation |
||||||||||||||||
|
Called prior to saving form data and closing form |
||||||||||||||||
|
Called just prior to displaying a form |
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.