Java Code Examples for ims.rules.types.RulesEngineFieldType

The following are top voted examples for showing how to use ims.rules.types.RulesEngineFieldType. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void createCellsByType(RulesEngineField identifier, DynamicGridCell cell)
{
	int nextCollAvaible = clearRightCells((Integer) cell.getColumn().getIdentifier(), cell.getRow());
	RulesEngineFieldType type = identifier.getType();

	DynamicGridRow row = cell.getRow();
	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();
	int count = vo.getNumberOfColumns();

	DynamicGridColumn coll = null;
	if (nextCollAvaible != 0)
	{
		coll = getColByIndex(nextCollAvaible);
		if (coll == null)
		{
			coll = createColumn("", nextCollAvaible);
		}
	}
	else
	{
		count++;
		coll = getColByIndex(count);
		if (coll == null)
		{
			coll = createColumn("", count);
		}
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	count++;

	DynamicGridCell conditionValueCell = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION);
	for (int j = 0; j < type.getComparators().length; j++)
	{
		if (checkRowForAnyCollection(cell))
		{
			if (type.getComparators()[j].equals(RuleValueComparator.NOTEQUALS))
				continue;
		}

		DynamicGridCellItem item = conditionValueCell.getItems().newItem(type.getComparators()[j]);
		item.setIdentifier(type.getComparators()[j]);
		conditionValueCell.setValue(type.getComparators()[j]);
		conditionValueCell.setIdentifier(type.getComparators()[j]);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	conditionValueCell.setAutoPostBack(true);
	count++;

	DynamicGridColumn colll = getColByIndex(count);
	DynamicGridCell cellValue = null;

	if (colll == null)
	{
		colll = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	createCellByType(identifier, cell, type, colll, cellValue);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void createCellByType(RulesEngineField identifier, DynamicGridCell cell, RulesEngineFieldType type, DynamicGridColumn coll, DynamicGridCell cellValue)
{
	if (type.equals(RulesEngineFieldType.STRING))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.INTEGER))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DECIMAL))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DECIMAL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATETIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATETIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.PARTIALDATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.PARTIALDATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.BOOLEAN))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);

		cellValue.getItems().newItem("True");
		cellValue.getItems().get(0).setIdentifier(Boolean.TRUE);
		cellValue.getItems().newItem("False");
		cellValue.getItems().get(1).setIdentifier(Boolean.FALSE);

		cellValue.setWidth(160);
		cellValue.setReadOnly(false);

	}
	else if (type.equals(RulesEngineFieldType.TIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.LOOKUP))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		int lookupId = identifier.getTypeLookupId();
		LookupInstanceCollection collection = domain.getLookupTypeInstance(lookupId);
		for (int j = 0; j < collection.size(); j++)
		{
			cellValue.getItems().newItem(collection.getIndex(j).getText());
			cellValue.getItems().get(j).setIdentifier(collection.getIndex(j));
		}
	}
	else
	{
		throw new CodingRuntimeException("Unknow cell type");
	}

	cellValue.setWidth(160);
	cellValue.setReadOnly(false);
}
 
Example 3
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void createCellsByType(RulesEngineField identifier, DynamicGridCell cell)
{
	int nextCollAvaible = clearRightCells((Integer) cell.getColumn().getIdentifier(), cell.getRow());
	RulesEngineFieldType type = identifier.getType();

	DynamicGridRow row = cell.getRow();
	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();
	int count = vo.getNumberOfColumns();

	DynamicGridColumn coll = null;
	if (nextCollAvaible != 0)
	{
		coll = getColByIndex(nextCollAvaible);
		if (coll == null)
		{
			coll = createColumn("", nextCollAvaible);
		}
	}
	else
	{
		count++;
		coll = getColByIndex(count);
		if (coll == null)
		{
			coll = createColumn("", count);
		}
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	count++;

	DynamicGridCell conditionValueCell = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION);
	for (int j = 0; j < type.getComparators().length; j++)
	{
		if (checkRowForAnyCollection(cell))
		{
			if (type.getComparators()[j].equals(RuleValueComparator.NOTEQUALS))
				continue;
		}

		DynamicGridCellItem item = conditionValueCell.getItems().newItem(type.getComparators()[j]);
		item.setIdentifier(type.getComparators()[j]);
		conditionValueCell.setValue(type.getComparators()[j]);
		conditionValueCell.setIdentifier(type.getComparators()[j]);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	conditionValueCell.setAutoPostBack(true);
	count++;

	DynamicGridColumn colll = getColByIndex(count);
	DynamicGridCell cellValue = null;

	if (colll == null)
	{
		colll = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	createCellByType(identifier, cell, type, colll, cellValue);
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void createCellByType(RulesEngineField identifier, DynamicGridCell cell, RulesEngineFieldType type, DynamicGridColumn coll, DynamicGridCell cellValue)
{
	if (type.equals(RulesEngineFieldType.STRING))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.INTEGER))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DECIMAL))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DECIMAL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATETIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATETIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.PARTIALDATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.PARTIALDATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.BOOLEAN))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);

		cellValue.getItems().newItem("True");
		cellValue.getItems().get(0).setIdentifier(Boolean.TRUE);
		cellValue.getItems().newItem("False");
		cellValue.getItems().get(1).setIdentifier(Boolean.FALSE);

		cellValue.setWidth(160);
		cellValue.setReadOnly(false);

	}
	else if (type.equals(RulesEngineFieldType.TIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.LOOKUP))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		int lookupId = identifier.getTypeLookupId();
		LookupInstanceCollection collection = domain.getLookupTypeInstance(lookupId);
		for (int j = 0; j < collection.size(); j++)
		{
			cellValue.getItems().newItem(collection.getIndex(j).getText());
			cellValue.getItems().get(j).setIdentifier(collection.getIndex(j));
		}
	}
	else
	{
		throw new CodingRuntimeException("Unknow cell type");
	}

	cellValue.setWidth(160);
	cellValue.setReadOnly(false);
}
 
Example 5
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void createCellsByType(RulesEngineField identifier, DynamicGridCell cell)
{
	int nextCollAvaible = clearRightCells((Integer) cell.getColumn().getIdentifier(), cell.getRow());
	RulesEngineFieldType type = identifier.getType();

	DynamicGridRow row = cell.getRow();
	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();
	int count = vo.getNumberOfColumns();

	DynamicGridColumn coll = null;
	if (nextCollAvaible != 0)
	{
		coll = getColByIndex(nextCollAvaible);
		if (coll == null)
		{
			coll = createColumn("", nextCollAvaible);
		}
	}
	else
	{
		count++;
		coll = getColByIndex(count);
		if (coll == null)
		{
			coll = createColumn("", count);
		}
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	count++;

	DynamicGridCell conditionValueCell = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION);
	for (int j = 0; j < type.getComparators().length; j++)
	{
		if (checkRowForAnyCollection(cell))
		{
			if (type.getComparators()[j].equals(RuleValueComparator.NOTEQUALS))
				continue;
		}

		DynamicGridCellItem item = conditionValueCell.getItems().newItem(type.getComparators()[j]);
		item.setIdentifier(type.getComparators()[j]);
		conditionValueCell.setValue(type.getComparators()[j]);
		conditionValueCell.setIdentifier(type.getComparators()[j]);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	conditionValueCell.setAutoPostBack(true);
	count++;

	DynamicGridColumn colll = getColByIndex(count);
	DynamicGridCell cellValue = null;

	if (colll == null)
	{
		colll = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	createCellByType(identifier, cell, type, colll, cellValue);
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void createCellByType(RulesEngineField identifier, DynamicGridCell cell, RulesEngineFieldType type, DynamicGridColumn coll, DynamicGridCell cellValue)
{
	if (type.equals(RulesEngineFieldType.STRING))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.INTEGER))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DECIMAL))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DECIMAL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATETIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATETIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.PARTIALDATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.PARTIALDATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.BOOLEAN))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);

		cellValue.getItems().newItem("True");
		cellValue.getItems().get(0).setIdentifier(Boolean.TRUE);
		cellValue.getItems().newItem("False");
		cellValue.getItems().get(1).setIdentifier(Boolean.FALSE);

		cellValue.setWidth(160);
		cellValue.setReadOnly(false);

	}
	else if (type.equals(RulesEngineFieldType.TIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.LOOKUP))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		int lookupId = identifier.getTypeLookupId();
		LookupInstanceCollection collection = domain.getLookupTypeInstance(lookupId);
		for (int j = 0; j < collection.size(); j++)
		{
			cellValue.getItems().newItem(collection.getIndex(j).getText());
			cellValue.getItems().get(j).setIdentifier(collection.getIndex(j));
		}
	}
	else
	{
		throw new CodingRuntimeException("Unknow cell type");
	}

	cellValue.setWidth(160);
	cellValue.setReadOnly(false);
}
 
Example 7
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void createCellsByType(RulesEngineField identifier, DynamicGridCell cell)
{
	int nextCollAvaible = clearRightCells((Integer) cell.getColumn().getIdentifier(), cell.getRow());
	RulesEngineFieldType type = identifier.getType();

	DynamicGridRow row = cell.getRow();
	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();
	int count = vo.getNumberOfColumns();

	DynamicGridColumn coll = null;
	if (nextCollAvaible != 0)
	{
		coll = getColByIndex(nextCollAvaible);
		if (coll == null)
		{
			coll = createColumn("", nextCollAvaible);
		}
	}
	else
	{
		count++;
		coll = getColByIndex(count);
		if (coll == null)
		{
			coll = createColumn("", count);
		}
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	count++;

	DynamicGridCell conditionValueCell = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION);
	for (int j = 0; j < type.getComparators().length; j++)
	{
		if (checkRowForAnyCollection(cell))
		{
			if (type.getComparators()[j].equals(RuleValueComparator.NOTEQUALS))
				continue;
		}

		DynamicGridCellItem item = conditionValueCell.getItems().newItem(type.getComparators()[j]);
		item.setIdentifier(type.getComparators()[j]);
		conditionValueCell.setValue(type.getComparators()[j]);
		conditionValueCell.setIdentifier(type.getComparators()[j]);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	conditionValueCell.setAutoPostBack(true);
	count++;

	DynamicGridColumn colll = getColByIndex(count);
	DynamicGridCell cellValue = null;

	if (colll == null)
	{
		colll = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	createCellByType(identifier, cell, type, colll, cellValue);
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void createCellByType(RulesEngineField identifier, DynamicGridCell cell, RulesEngineFieldType type, DynamicGridColumn coll, DynamicGridCell cellValue)
{
	if (type.equals(RulesEngineFieldType.STRING))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.INTEGER))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DECIMAL))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DECIMAL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.DATETIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.DATETIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.PARTIALDATE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.PARTIALDATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.BOOLEAN))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);

		cellValue.getItems().newItem("True");
		cellValue.getItems().get(0).setIdentifier(Boolean.TRUE);
		cellValue.getItems().newItem("False");
		cellValue.getItems().get(1).setIdentifier(Boolean.FALSE);

		cellValue.setWidth(160);
		cellValue.setReadOnly(false);

	}
	else if (type.equals(RulesEngineFieldType.TIME))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.ENTITY_CODE))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.INT, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	}
	else if (type.equals(RulesEngineFieldType.LOOKUP))
	{
		cellValue = cell.getRow().getCells().newCell(coll, DynamicCellType.ENUMERATION, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		int lookupId = identifier.getTypeLookupId();
		LookupInstanceCollection collection = domain.getLookupTypeInstance(lookupId);
		for (int j = 0; j < collection.size(); j++)
		{
			cellValue.getItems().newItem(collection.getIndex(j).getText());
			cellValue.getItems().get(j).setIdentifier(collection.getIndex(j));
		}
	}
	else
	{
		throw new CodingRuntimeException("Unknow cell type");
	}

	cellValue.setWidth(160);
	cellValue.setReadOnly(false);
}