Categories
Best Practices Bizagi Tips and Tricks

Working with Tables in Bizagi

Content

  1. Editable table with row validation
  2. Filter dropdown values to exclude already selected ones

Editable table with row validation

Table Functionality

Table functionality in Bizagi

Add a new row using the ‘+’ button

Add a new row to the table in Bizagi

Row validation

Display a warning message using the Bizagi widget called HTML Viewer (Beta).

Row validation in Bizagi
Working with tables in bizagi

Actions & Validations

Actions and Validations in Bizagi
/*
Name: Valeriu Bosneaga
Desc: Clean input data
Date: 24 March 2023
*/
var sRuleName = "TSH_CleanShiftRatesCollection";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");

var bMultipleShitRates = <bMultipleShitRates>;
if (bMultipleShitRates == false)
{
	<cHolidayShiftRate> = null;
	<cNocturnalShiftRate> = null;
	<cWeekendShiftRate> = null;
}

LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
Actions and Validations in Bizagi
/*
Name: Valeriu Bosneaga
Desc: Add a new row to the Specialty Shift Rate table
Date: 24 March 2023
*/
var sRuleName = "TSH_AddRowSpecialtyShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
Me.Context.newCollectionItem("kmLPTermSheet.xmTSHSpecialtyShiftRates");
LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
Actions and Validations in Bizagi

Cell Editable

Cell Editable in Bizagi
/*
Name: Valeriu Bosneaga
Desc: An Expression to validate whether Shift Rate Fields are editable or not
Date: 24 March 2023
*/
var sRuleName = "TSH_EditableDailyShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var editable = false;
var multipleShiftRate = <bMultipleShitRates>;

if(!CHelper.IsNull(multipleShiftRate)){
		editable = true;
}
LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
editable;

Panels visibility

Panel visibility rule in Bizagi
/*
Name: Valeriu Bosneaga
Desc: Panel visibility rule
Date: 24 March 2023
*/
var sRuleName = "TSH_VisPanelsCallRequirements";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var bVisible = false;
var bEmergencyRoomCallC = <bEmergencyRoomCallC>;
if (bEmergencyRoomCallC)
{
	bVisible = true;
}

LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
bVisible;
Panel visibility rule in Bizagi
/*
Name: Valeriu Bosneaga
Desc: Panel visibility rule
Date: 24 March 2023
*/
var sRuleName = "TSH_VisPanelAlertShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");

var visible = true;
var sHTML = <kmLPTermSheet.kmTSHLabelAlert.sAlertShiftRate>;
if(CHelper.IsEmpty(sHTML))
{
	visible = false;
}

LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
visible;

Filter dropdown values to exclude already selected ones

Filter dropdown values to exclude selected ones
Combo properties

The filter is applied to the Title dropdown.

Combo filter
/*
Name: Valeriu Bosneaga
Desc: Show the Titles that were not selected privously
Date: 05 June 2023
*/
var sRuleName = "TSH_FilterTitleMedicalDirectorship";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var sFilter = null;
var oMedicalDiretorships = CHelper.GetValueAsCollection(<mTSH_Compensation.xmTSHMedicalDirectorships>);
if (oMedicalDiretorships.size() > 0)
{
	for (var i = 0; i<oMedicalDiretorships.size(); i++)
	{
		var oMedicalDiretorship = oMedicalDiretorships.get(i);
		var iTitleId = oMedicalDiretorship.getXPath("kpLPMedicalDirectorship.Id");
		if (!CHelper.IsNull(iTitleId))
		{
			if (CHelper.IsEmpty(sFilter))
			{
				sFilter = "Id != "+ iTitleId;
			}
			else
			{
				sFilter += " AND Id != "+ iTitleId;
			}
		}
	}
}

LPT.Global_Trace(Me,"1",sRuleName,"sFilter: "+ sFilter);
LPT.Global_Trace(Me,"1",sRuleName,"END  ---------------------------------");
sFilter;