Enhancing Progress Bar Capabilities
TallyPrime Release 5.0 introduces an enhanced progress bar feature that provides detailed information about various operations. With this update, the progress bars now show different types of information, highlighting the activity being performed and the progress made.
In addition, we are introducing new TDL capabilities with this enhancement, which are detailed in the upcoming sections.
Definition – Progress Bar
The Progress Bar definition provides application developers with the capability to set Activity Name, Context, Process Name, Progress Indication and stages for the progress bar window.
Syntax:
[Progress Bar : <Progress Bar Name>]
Example:
[Progress Bar : TSPL Smp Progess Bar]
Attribute – Activity Name
The Activity Name attribute is utilized to specify the activity name to be shown to the user in the progress bar. This is a mandatory attribute.
Syntax:
[Progress Bar : <Progress Bar Name>]
ProgressBar Activity Name: <Activity Name>
where,
<Activity Name> is the name of the Progress Bar.
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Attribute – Context
The Context attribute is utilized to specify the context to be shown in the progress bar.
Syntax:
[Progress Bar : <Progress Bar Name>]
Context: <Context Name>
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name: Stock Item Creation (400 Nos)
Context : Item Master
Attribute – SubContext
The SubContext attribute is utilized to specify the subcontext to be shown in the progress bar.
Syntax:
[Progress Bar : <Progress Bar Name>]
SubContext: <Subcontext Name>
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Context : Item Master
SubContext : Creating Item Masters
Attribute – Process Name
The Process Name attribute is utilized to specify the process name to be shown in the progress bar.
Syntax:
[Progress Bar : <Progress Bar Name>]
Process Name : <Process Name>
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Context : Item Master
Subcontext : Creating Item Masters
Total count : 100
Stages : Batch-1 (0 – 100), Batch-2 (101 – 200), Batch-3 (201 – 300),+
Batch-4(301 – 400)
ProcessName : “Creating Summary”
Attribute – Progress Indication
The Progress Indication attribute is utilized to specify the progress indication to be shown in the progress bar.
Syntax:
[Progress Bar : <Progress Bar Name>]
Progress Indication : <Progress Indication Name>
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Context : Item Master
SubContext : Creating Item Masters
Total count : 100
Stages : Batch-1 (0 – 100), Batch-2 (101 – 200), Batch-3 (201 – 300), +
Batch-4(301 – 400)
ProcessName : “Creating Summary”
Progress Indication : $$Sprintf:”%s %s”:(“Created :”):##StkItemcount
Attribute – Total Count
The Total Count attribute is utilized to specify the total number of items being processed. This is a mandatory attribute, if the count is not known it can be set to 0.
Syntax:
[Progress Bar : <Progress Bar Name>]
Total Count : <Total steps count>
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Context : Item Master
Subcontext : Creating Item Masters
Total count : 100.
Attribute – Stages
The Stages attribute is utilized to specify the list of stages in the progress, minimum two stages must be specified for stages to be drawn in the progress window.
Syntax:
[Progress Bar : <Progress Bar Name>]
Stages : <Stage 1 Label>, <Stage 2 Label>, <Stage 3 Label>……….
Example:
[Progress Bar : TSPL Smp Progess Bar]
Activity name : Stock Item Creation (400 Nos)
Context : Item Master
Subcontext : Creating Item Masters
Total count : 100
Stages : Batch-1 (0 – 100), Batch-2 (101 – 200), Batch-3 (201 – 300), +
Batch-4(301 – 400)
Attribute – Use
The Use attribute is utilized in a definition to reuse an existing definition.
Syntax:
[Progress Bar : <Progress Bar Name>]
Use : <Definition Name>
Action – InitializeProgressBar
The InitializeProgressBar action provides application developers with the capability to initialize the progress bar object and set all stages & relevant texts by executing a ProgressBar definition mentioned in the parameter.
Syntax:
[Function : <Function Name>]
Action : InitializeProgressBar : <Definition Name>
Example:
[Function: TSPL Progress Bar]
Parameter : NumOfObjects : Number: 100
Variable : Counter : Number
Variable : StkItemcount : Number: 0
Returns : Number
Local Formula: StockitemName : “StockItem” + ($$String:##StkItemcount)
10: Initialize ProgressBar : TSPL Smp Progess Bar
Action – ProgressBarUpdateActivityName
The ProgressBarUpdateActivityName action provides application developers with updating activity name to be displayed in progress bar window.
Syntax:
[Function : <Function Name>]
Action : ProgressBarUpdateActivityName: <Activity Name>
Action – ProgressBarUpdateContext
The ProgressBarUpdateContext action provides application developers with updating Context name to be displayed in progress bar window.
Syntax:
[Function : <Function Name>]
Action : ProgressBarUpdateContext: <Update Context Name>
Action – ProgressBarUpdateSubcontext
The ProgressBarUpdateSubcontext action provides application developers with updating Sub Context name to be displayed in progress bar window.
Syntax:
[Function : <Function Name>]
Action : ProgressBarUpdateSubcontext: <Update Sub Context Name>
Action – ProgressBarUpdateProcessName
The ProgressBarUpdateProcessName action provides application developers with updating Process Name to be displayed in progress bar window.
Syntax:
[Function : <Function Name>]
Action :ProgressBarUpdateProcessName: <Update Process Name>
Action – ProgressBarUpdateProgressIndication
The ProgressBarUpdateProgressIndication action provides application developers with updating Progress indication to be displayed in progress bar window.
Syntax:
[Function : <Function Name>]
Action :ProgressBarUpdateProgressIndication: <Update Progress Indication Name>
Example:
[Function: TSPL Progress Bar]
Parameter : NumOfObjects : Number: 100
Variable : Counter : Number
Variable : StkItemcount : Number: 0
Returns : Number
Local Formula: StockitemName : “StockItem” + ($$String:##StkItemcount)
10: Initialize ProgressBar : TSPL Smp Progess Bar
20: FOR RANGE : vStageCount : Number : 1 : 4
30: ProgressBar Set Active Stage : ##vStageCount
50: While : ##Counter < ##NumOfObjects
60: If : $$IsEmpty:$Name:Stockitem:@StockitemName
70: New Object : Stockitem
80: Else
90: New Object : Stockitem : @StockitemName
100: End If
110: Set Value : Name : @StockitemName
120: Set Value : BaseUnits : “Nos”
130: Save Target
140: Increment : Counter
150: Increment : StkItemcount
160: ProgressBar Set ItemsDone : ##Counter
170: ProgressBar Update Progress Indication : $$Sprintf:”%s %s”:(“Created”):##StkItemcount
Action -ProgressBarUpdateTotalCount
The ProgressBarUpdateTotalCount action provides application developers with updating the total number of steps/total Items involved in the task.
Syntax:
[Function : <Function Name>]
Action :ProgressBarUpdateTotalCount: <Update Total Count>
Action -ProgressBarSetItemsDone
The ProgressBarSetItemsDone action provides application developers to set the total number of Item Count/steps completed to reflect on progress bar window.
Syntax:
[Function : <Function Name>]
Action :ProgressBarSetItemsDone: <Set Items Done Count>
Example:
[Function: TSPL Progress Bar]
Parameter: NumOfObjects : Number: 100
Variable : Counter : Number
Variable : StkItemcount : Number: 0
Returns : Number
Local Formula: StockitemName : “StockItem” + ($$String:##StkItemcount)
10: Initialize ProgressBar : TSPL Smp Progess Bar
20: FOR RANGE : vStageCount : Number : 1 : 4
30: ProgressBar Set Active Stage : ##vStageCount
50: While : ##Counter < ##NumOfObjects
60: If : $$IsEmpty:$Name:Stockitem:@StockitemName
70: New Object : Stockitem
80: Else
90: New Object : Stockitem : @StockitemName
100: End If
110: Set Value : Name : @StockitemName
120: Set Value : BaseUnits : “Nos”
130: Save Target
140: Increment : Counter
150: Increment : StkItemcount
160: ProgressBar Set ItemsDone : ##Counter
Action -ProgressBarSetActiveStage
The ProgressBarSetActiveStage action provides application developers to set active stage.
Syntax:
[Function : <Function Name>]
Action :ProgressBarSetActiveStage: <Set Active Stage Number>
Example:
[Function: TSPL Progress Bar]
Parameter : NumOfObjects : Number: 100
Variable : Counter : Number
Variable : StkItemcount : Number: 0
Returns : Number
Local Formula: StockitemName : “StockItem” + ($$String:##StkItemcount)
10: Initialize ProgressBar : TSPL Smp Progess Bar
20: FOR RANGE : vStageCount : Number : 1 : 4
30: ProgressBar Set Active Stage : ##vStageCount
Action -FinalizeProgressBar
The FinalizeProgressBar action provides application developers to end the progress and release the resource, when a task is completed.
Syntax:
[Function : <Function Name>]
Action :FinalizeProgressBar
Example:
[Function: TSPL Progress Bar]
Parameter : NumOfObjects : Number: 100
Variable : Counter : Number
Variable : StkItemcount : Number: 0
Returns : Number
Local Formula: StockitemName : “StockItem” + ($$String:##StkItemcount)1
10: Initialize ProgressBar : TSPL Smp Progess Bar
20: FOR RANGE : vStageCount : Number : 1 : 4
30: ProgressBar Set Active Stage : ##vStageCount
50: While : ##Counter < ##NumOfObjects
60: If : $$IsEmpty:$Name:Stockitem:@StockitemName
70: New Object : Stockitem
80: Else
90: New Object : Stockitem : @StockitemName
100: End If
110: Set Value : Name : @StockitemName
120: Set Value : BaseUnits : “Nos”
130: Save Target
140: Increment : Counter
150: Increment : StkItemcount
160: ProgressBar Set ItemsDone : ##Counter
170: ProgressBar Update Progress Indication : $$Sprintf:”%s %s”:(“Created”):##StkItemcount
180: End While
190: Increment : vStageCount
200: Set : Counter : 0
210: End For
220: Finalize ProgressBar
Interoperability Error Messages
These occur when the consumer uses actions from different frames interoperably. For example the user initiated the progress bar using StartProgress, but later calls ProgressBarSetItemsDone to update progress bar.
Action | Error Message |
EndProgress | Progress bar was initialized using new frame – please use corresponding actions like InitializeProgressBar, ProgressBarUpdateProcessName and ProgressBarSetItemsDone |
ProgressBarUpdateActivityName | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateContext, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarUpdateContext | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateSubcontext, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarUpdateSubcontext | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateProcessName, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarUpdateProcessName | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateProgressIndication, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarUpdateProgressIndication | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateActivityName, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarUpdateTotalCount | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarSetItemsDone, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarSetItemDone | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateTotalCount, and FinalizeProgressBar; or continue using actions within the old frame |
ProgressBarSetActiveStage | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateActivityName, and FinalizeProgressBar; or continue using actions within the old frame |
FinalizeProgressBar | Progress bar was initialized using old frame – considering switching to the new frame with actions such as InitializeProgressBar, ProgressBarUpdateActivityName, and FinalizeProgressBar; or continue using actions within the old frame |