ProgramDefinition

The ProgramDefinition rule defines a Program's entry fields, screen events and screen actions and associations of program actions to program activities.

ProgramDefinition: Elements and Attributes
Elements Attributes Parent Element Description Element / Attribute Values

<ProgramDefinition>

    This is the root element for the rule.  

<Fields>

  <ProgramDefinition>

Required:

See Fields Element under the Common Elements topic.

 

<Events>

  <ProgramDefinition>

Optional:

See <Events> element in the ActionEvents article under the Common Elements topic.

 

<Event>

  <Events>

Required, Repeatable:

See <Event> element in the ActionEvents article under the Common Elements topic.

 

<ScreenMath

  <ProgramDefinition>

Optional:

See <ScreenMath> element in the ActionEvents article under the Common Elements topic.

 

<Actions>

  <ProgramDefinition>

Optional:

See <Actions> element in the ActionEvents article under the Common Elements topic.

 

<QuerySet>

  <Actions>

Optional, Repeatable:

See <QuerySet> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <QuerySet>

Optional, Repeatable:

See <Action> element in the ActionEvents article under the Common Elements topic.

 

<Condition>

  <QuerySet>

Optional, Repeatable:

Within the <QuerySet> structure, see <Condition> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <Condition>

Required, Repeatable:

Within the <QuerySet> and <Condition> structure, see <Action> element in the ActionEvents article under the Common Elements topic.

 

<ElseIf>

  <Condition>

Optional, Repeatable:

Within the <QuerySet> and <Condition> structure, see <ElseIf> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <ElseIf>

Required, Repeatable:

Within the <QuerySet> and <ElseIf> structure, see <Action> element in the ActionEvents article under the Common Elements topic.

 

<Else>

  <Condition>

Optional:

Within the <QuerySet> and <Condition> structure, see <Else> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <Else>

Required, Repeatable:

Within the <QuerySet> and <Else> structure, see <Action> element in the ActionEvents article under the Common Elements topic.

 

<ActionSet>

  <Actions>

Optional, Repeatable:

See <ActionSet> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <ActionSet>

Optional, Repeatable:

See <Action> element in the ActionEvents article under the Common Elements topic.

 

<Condition>

  <ActionSet>

Optional, Repeatable:

See <Condition> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <Condition>

See "Common <Action> element structure in ProgramDefinition rule" structure described below for child attribute descriptions.

 

<ElseIf>

  <Condition>

Optional, Repeatable:

See <ElseIf> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <ElseIf>

See "Common <Action> element structure in ProgramDefinition rule" structure described below for child attribute descriptions.

 

<Else>

  <Condition>

Optional:

See <Else> element in the ActionEvents article under the Common Elements topic.

 

<Action>

  <Else>

See "Common <Action> element structure in ProgramDefinition rule" structure described below for child attribute descriptions.

 

<ProgramActions>

  <ProgramDefinition>

Required:

This element's structure provides associations of actions to transactions that will be spawned.  

 

<ProgramAction>

  <ProgramActions>

Required, Repeatable:

This element describes a single association of a program action to a transaction.  An activity defined by this transaction will be spawned when the action has been triggered by the screen.  This element is repeated to make additional associations of other actions to other transactions.

 

 

ACTION <ProgramAction>

Required:

This attribute's value provides the program action that is associated to a transaction and triggers a spawn.

  • Start

    • this value references the set-up transaction of the program

  • Run

    • this value references the recurring program transaction

  • Terminate

    • this value references the terminating program transaction

  • Change

    • this value references the program's change transaction

  • Reinstate

    • this value references the program transaction that removes a program from suspension

    • this value requires the <ReinstateTransaction> element

<Transaction>

  <ProgramAction>

Required:

This element provides the transaction name to spawn for the program action that contains it.

  • transaction name

<Fields>

  <ProgramAction>

Optional:

See the Fields Element under the Common Elements topic.  

This element's structure provides the spawned activity with the entry field data it needs to process successfully.  

 

<ReinstateTransaction>

  <ProgramAction>

Optional:

This element's structure associates the Reinstate ACTION with a transaction.  This rule can contain multiple <ProgramAction> structures for the Reinstate action since each of these can associate a different transaction by filtering on the program's status prior to suspension.

 

<ProgramPriorStatusCode>

  <ReinstateTransaction>

Required, Repeatable:

This element provides a single program status to filter by the program's status value that was persisted prior to suspension.  This element is repeated to associate a transaction for multiple prior program statuses.

  • code

    • valid value comes from AsCodeProgramStatus

<Transaction>

  <ReinstateTransaction>

Required:

This element provides the transaction name to spawn for the program action that contains it.

  • transaction name

Common <Action> element structure in ProgramDefinition rule

<Action>

 

<Condition>.

<ElseIf>,

<Else>

Required, Repeatable:

See <Action> element within the corresponding parent element's description in the ActionEvents article under the Common Elements topic.  This element in the article provides a description of the shared structure. 

Unique to this rule and within the parent element's structure, this element has elements, attribute and attribute values to add to the shared structure description.

 

 

ACTIONTYPE <Action>

Required:

This attribute configured within one of the "grand" parent elements has an additional attribute value.  This value is applicable only during an ONSUBMIT event.  It is ignored when configured within the context of other events.

  • OPERATION

 

RESULT <Action>

Required:

This attribute is applicable when ACTIONTYPE attribute value is OPERATION.  It is ignored when configured with other ACTIONTYPE attribute values.  When program changes are detected, the information that has changed should set-up a condition to issue one of the actions available to this attribute.

  • Rollback

    • shadow pending program activities

    • reverse active program activities

    • program status becomes PendingReady

  • DoNothing

    • no impact to the program or its activities

  • Recycle

    • recycle the last active program activity

  • ChangePending

    • make a change to the existing pending program activity 

  • Close

    • terminate the program

<Fields>

  <Action>

Optional:

See the Fields Element under the Common Elements topic.

This element provides a field structure that is applicable only when the RESULT attribute value is ChangePending or Close.  This structure maps program field values and screen math variables to an associated activity that will be spawned based on the <ProgramActions>.  Only <ProgramActions> of Terminate and Change spawn activities that may be defined with entry field values and are respectively associated to the Close and ChangePending RESULT values.

 

XML Schema

<ProgramDefinition>
    <Fields>
        <Field>...</Field>
        <Field>...</Field>
    </Fields>
    <Events>
        <Event TYPE="[ONLOAD | ONSUBMIT]">
            <ActionSet ID="[literal]"/>
            <ActionSet>...</ActionSet>
            <QuerySet ID="[literal]"/>
            <QuerySet>...</QuerySet>
            <Math ID="[literal]"/>
            <Math>...</Math>
        </Event>
        <Event TYPE="ONCHANGE" FIELD="[field]">
            <ActionSet ID="[literal]"/>
            <ActionSet>...</ActionSet>
            <QuerySet ID="[literal]"/>
            <QuerySet>...</QuerySet>
            <Math ID="[literal]"/>
            <Math>...</Math>
        </Event>
        <Event>. . .</Event>
    </Events>
    <ScreenMath>
        <Math ID="[literal]" GLOBAL="[No | Yes]">
            <MathVariables>
                <MathVariable>...</MathVariable>
                <MathVariable>...</MathVariable>
            </MathVariables>
        </Math>
        <Math>...</Math>
    </ScreenMath>
    <Actions>
        <QuerySet ID="[literal]">
            <Action ACTIONTYPE="SQLQUERY" FIELD="[field]">[sql]</Action>
            <Action ACTIONTYPE="SQLQUERY" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]">[sql]</Action>
            <Action ACTIONTYPE="MATHCOLLECTION">[variable]</Action>
            <Action ACTIONTYPE="MATHCOLLECTION" INDEX="[integer]">[variable]</Action>
            <Action>...</Action>
            <Condition IF="[conditional]">
                <Action>...</Action>
                <Action>...</Action>
                <ElseIf IF="[conditional]">
                    <Action>...</Action>
                    <Action>...</Action>
                </ElseIf>
                <ElseIf>...</ElseIf>
                <Else>
                    <Action>...</Action>
                    <Action>...</Action>
                </Else>
            </Condition>
            <Condition>...</Condition>
        </QuerySet>
        <QuerySet>...</QuerySet>
        <ActionSet ID="[literal]">
            <Action ACTIONTYPE="ASSIGN" FIELD="[field]">[variable | field]</Action>
            <Action ACTIONTYPE="ASSIGN" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]">[variable | field]</Action>
            <Action ACTIONTYPE="[ERROR | WARNING]">[message]</Action>
            <Action ACTIONTYPE="[ERROR | WARNING]" FIELD="[field]">[message]</Action>
            <Action ACTIONTYPE="[ERROR | WARNING]" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]">[message]</Action>
            <Action ACTIONTYPE="[HIDE | SHOW | DISABLE | ENABLE]" FIELD="[field]"/>
            <Action ACTIONTYPE="[HIDE | SHOW | DISABLE | ENABLE]" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]"/>
            <Action ACTIONTYPE="[DISABLEALL | ENABLEALL]"/>
            <Action>...</Action>
            <Condition IF="[conditional]">
                <Action ACTIONTYPE="OPERATION" RESULT="[Rollback | DoNothing | Recycle]"/>
                <Action ACTIONTYPE="OPERATION" RESULT="[ChangePending | Close]">
                    <Fields>
                        <Field>...</Field>
                        <Field>...</Field>
                    </Fields>
                </Action>
                <Action ACTIONTYPE="ASSIGN" FIELD="[field]">[variable | field]</Action>
                <Action ACTIONTYPE="ASSIGN" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]">[variable | field]</Action>
                <Action ACTIONTYPE="[ERROR | WARNING]">[message]</Action>
                <Action ACTIONTYPE="[ERROR | WARNING]" FIELD="[field]">[message]</Action>
                <Action ACTIONTYPE="[ERROR | WARNING]" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]">[message]</Action>
                <Action ACTIONTYPE="[HIDE | SHOW | DISABLE | ENABLE]" FIELD="[field]"/>
                <Action ACTIONTYPE="[HIDE | SHOW | DISABLE | ENABLE]" FIELD="[field]" INDEX="[integer]" MULTIFIELD="[group name]"/>
                <Action ACTIONTYPE="[DISABLEALL | ENABLEALL]"/>
                <Action>...</Action>
                <ElseIf IF="[conditional]">
                    <Action>...</Action>
                    <Action>...</Action>
                </ElseIf>
                <ElseIf>...</ElseIf>
                <Else>
                    <Action>...</Action>
                    <Action>...</Action>
                </Else>
            </Condition>
            <Condition>...</Condition>
        </ActionSet>
        <ActionSet>...</ActionSet>
    </Actions>
    <ProgramActions>
        <ProgramAction ACTION="[Start | Run | Terminate | Change]">
            <Transaction>[transaction name]</Transaction>
            <Fields>
                <Field>...</Field>
                <Field>...</Field>
            </Fields>
        </ProgramAction>
        <ProgramAction>...</ProgramAction>
        <ProgramAction ACTION="Reinstate">
            <ReinstateTransaction>
                <ProgramPriorStatusCode>...</ProgramPriorStatusCode>
                <ProgramPriorStatusCode>...</ProgramPriorStatusCode>
                <Transaction>[transaction name]</Transaction>
            </ReinstateTransaction>
            <ReinstateTransaction>...</ReinstateTransaction>
        </ProgramAction>
        <ProgramAction ACTION="Reinstate">...</ProgramAction>
    </ProgramActions>
</ProgramDefinition>

XML Example

<ProgramDefinition>
    <Fields>
        <Field>
            <Name>ClientName</Name>
            <Display>ClientName</Display>
            <DataType>Client</DataType>
        </Field>
        <Field>
            <Name>ProgramFrequency</Name>
            <Display>Program Frequency</Display>
            <DataType>Combo</DataType>
            <Query TYPE="SQL">SELECT AsCode.CodeValue, AsCode.ShortDescription FROM AsCode WHERE AsCode.CodeName = 'AsCodeMode'</Query>
        </Field>
        <Field>
            <Name>ProgramAmount</Name>
            <Display>Program Amount</Display>
            <DataType>Money</DataType>
        </Field>
        <Field>
            <Name>NextScheduledDate</Name>
            <Display>Next Scheduled Date</Display>
            <DataType>Date</DataType>
            <Disabled>Yes</Disabled>
        </Field>
    </Fields>
    <Events>
        <Event TYPE="ONSUBMIT">
            <Math ID="ProgramScreenMath"></Math>
            <ActionSet ID="FieldVerification"></ActionSet>
        </Event>
    </Events>
    <ScreenMath>
        <Math ID="ProgramScreenMath" GLOBAL="No">
            <MathVariables>
                <MathVariable VARIABLENAME="ProgramGUIDMV" TYPE="EXPRESSION" DATATYPE="TEXT">ProgramGUID</MathVariable>
                <MathVariable VARIABLENAME="ProgramEndDateMV" TYPE="SQL" DATATYPE="DATE">SELECT EndDate FROM AsProgram WHERE ProgramGUID = '[ProgramGUIDMV]'</MathVariable>
            </MathVariables>
        </Math>
    </ScreenMath>
    <Actions>
        <ActionSet ID="FieldVerification">
            <Condition IF="IsEmpty(EffectiveDate)">
                <Action ACTIONTYPE="ERROR">Effective Date requires a value.</Action>
            </Condition>
            <Condition IF="IsEmpty(StartDate)">
                <Action ACTIONTYPE="ERROR">Start Date requires a value.</Action>
            </Condition>
            <Condition IF="IsEmpty(EndDate)">
                <Action ACTIONTYPE="ERROR">End Date requires a value.</Action>
            </Condition>
            <Condition IF="Not IsEmpty(StartDate) And Not IsEmpty(EndDate) And StartDate >= EndDate">
                <Action ACTIONTYPE="ERROR">Program Start Date must be less than Program End Date.</Action>
            </Condition>
            <Condition IF="StatusCode='05' AND EndDate < ProgramScreenMath:ProgramEndDateMV">
                <Action ACTIONTYPE="OPERATION" RESULT="Rollback"></Action>
            </Condition>
        </ActionSet>
    </Actions>
    <ProgramActions>
        <ProgramAction ACTION="Start">
            <Transaction>SetUpProgram</Transaction>
            <Fields>
                <Field>
                    <From>StartDate</From>
                    <To>StartDate</To>
                    <DataType>Date</DataType>
                </Field>
                <Field>
                    <From>ProgramFrequency</From>
                    <To>ProgramFrequency</To>
                    <DataType>Text</DataType>
                </Field>
                <Field>
                    <From>ProgramAmount</From>
                    <To>ProgramAmount</To>
                    <DataType>Money</DataType>
                </Field>
            </Fields>
        </ProgramAction>
        <ProgramAction ACTION="Run">
            <Transaction>PolicyProgramAScheduledActivity</Transaction>
            <Fields>
                <Field>
                    <From>StartDate</From>
                    <To>StartDate</To>
                    <DataType>Date</DataType>
                </Field>
                <Field>
                    <From>ProgramFrequency</From>
                    <To>ProgramFrequency</To>
                    <DataType>Text</DataType>
                </Field>
                <Field>
                    <From>ProgramAmount</From>
                    <To>ProgramAmount</To>
                    <DataType>Money</DataType>
                </Field>
            </Fields>
        </ProgramAction>
        <ProgramAction ACTION="Terminate">
            <Transaction>TerminateProgram</Transaction>
        </ProgramAction>
        <ProgramAction ACTION="Reinstate">
            <ReinstateTransaction>
                <ProgramPriorStatusCode>04</ProgramPriorStatusCode>
                <ProgramPriorStatusCode>03</ProgramPriorStatusCode>
                <Transaction>ReinstateProgramSkip</Transaction>
            </ReinstateTransaction>
        </ProgramAction>
        <ProgramAction ACTION="Reinstate">
            <ReinstateTransaction>
                <ProgramPriorStatusCode>05</ProgramPriorStatusCode>
                <Transaction>ReinstateProgramNonSkip</Transaction>
            </ReinstateTransaction>
        </ProgramAction>
    </ProgramActions>
</ProgramDefinition>