Java Code Examples for ims.rules.types.RulesEngineEntity

The following are top voted examples for showing how to use ims.rules.types.RulesEngineEntity. 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: RulesPriorityEditorImpl.java   Source Code and License 6 votes vote down vote up
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
	if (entity == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
	criteria.equal("this.rootEntity", entity.getId());
	criteria.equal("this.active", true);
	
	List rules = criteria.find();
	Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));
	
	return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
 
Example 2
Project: openMAXIMS   File: RulesPriorityEditorImpl.java   Source Code and License 6 votes vote down vote up
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
	if (entity == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
	criteria.equal("this.rootEntity", entity.getId());
	criteria.equal("this.active", true);
	
	List rules = criteria.find();
	Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));
	
	return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
 
Example 3
Project: openMAXIMS   File: RulesPriorityEditorImpl.java   Source Code and License 6 votes vote down vote up
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
	if (entity == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
	criteria.equal("this.rootEntity", entity.getId());
	criteria.equal("this.active", true);
	
	List rules = criteria.find();
	Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));
	
	return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
 
Example 4
Project: openmaxims-linux   File: RulesPriorityEditorImpl.java   Source Code and License 6 votes vote down vote up
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
	if (entity == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
	criteria.equal("this.rootEntity", entity.getId());
	criteria.equal("this.active", true);
	
	List rules = criteria.find();
	Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));
	
	return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void populateRootEntities()
{
	// Clear the combobox
	form.cmbEntity().clear();

	// Get all public entities
	List<RulesEngineEntity> entities = Entities.getInstance().getAllPublicEntities();

	// Populate the combobox
	for (int i = 0; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void setRulesEntities()
{
	// Clear combobox
	form.cmbEntity().clear();
	
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();
	
	for (int i = 0 ; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSearchCriteria(boolean isActive, String name, String rulesEngineEntityID, Integer categoryID) 
{
	form.chkActiveOnly().setValue(isActive);
	form.txtRuleName().setValue(name);
	
	if (rulesEngineEntityID != null)
	{
		List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();		
		for (int i = 0 ; i < entities.size(); i++)
		{
			if (rulesEngineEntityID.equals(entities.get(i).getId()))
			{
				form.cmbEntity().setValue(entities.get(i));
				break;
			}
		}
	}
	
	if (categoryID != null)
	{
		for (int i = 0; i < form.treRootEntity().getNodes().size(); i++) 
		{
			if (form.treRootEntity().getNodes().get(i).getValue() instanceof BusinessRuleCategory &&
					((BusinessRuleCategory)form.treRootEntity().getNodes().get(i).getValue()).getID() == categoryID)
			{
				form.treRootEntity().setValue(form.treRootEntity().getNodes().get(i).getValue());
				break;
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRootEntity()
{
	form.lyrRules().tabConditions().cmbRootEntity().clear();
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	Collections.sort(entities, new RulesEngineEntityComparator());

	for (int i = 0; i < entities.size(); i++)
	{
		form.lyrRules().tabConditions().cmbRootEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addEntityField()
{
	DynamicGridRow entityFieldInstanceRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow().getRows().newRow();
	entityFieldInstanceRow.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) entityFieldInstanceRow.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridCell valueCell = entityFieldInstanceRow.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	onDyngrdActionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRulesNotificationEntry(RuleValueConditionEntry entry, DynamicGridRow parentRow)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridColumn valueColl = getColByIndexForActionGrid(1);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", 1);
	}

	setRowIdentifier(row, 1, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	int count = row.getIdentifier() != null ? (row.getIdentifier() instanceof RuleConditionRowVo ? (((RuleConditionRowVo) row.getIdentifier()).getNumberOfColumns()) : 0) : 0;
	count++;
	try
	{
		addRuleNotificationCell(row, entry.getChild() != null ? entry.getChild() : entry, count);
	}
	catch (ParseException e)
	{
		e.printStackTrace();
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(RulesEngineEntity o1, RulesEngineEntity o2)
{
	if (o1.getName() == null || o2.getName() == null)
		return 0;
	
	return o1.getName().compareToIgnoreCase(o2.getName());
}
 
Example 12
Project: AvoinApotti   File: Entities.java   Source Code and License 5 votes vote down vote up
public List<RulesEngineEntity> getAllPublicEntities()
{
	List<RulesEngineEntity> all = getAllEntities();
	List<RulesEngineEntity> result = new ArrayList<RulesEngineEntity>();
		for(int x = 0; x < all.size(); x++)
		{
			if(all.get(x).isPublic())
			{
				result.add(all.get(x));
			}
		}
	return result;
}
 
Example 13
Project: AvoinApotti   File: Entities.java   Source Code and License 5 votes vote down vote up
public RulesEngineEntity getEntityById(String id)
{
	for(int x = 0; x < getAllEntities().size(); x++)
	{
		if(getAllEntities().get(x).getId().equals((id)))
			return getAllEntities().get(x);
	}

	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void populateRootEntities()
{
	// Clear the combobox
	form.cmbEntity().clear();

	// Get all public entities
	List<RulesEngineEntity> entities = Entities.getInstance().getAllPublicEntities();

	// Populate the combobox
	for (int i = 0; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void setRulesEntities()
{
	// Clear combobox
	form.cmbEntity().clear();
	
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();
	
	for (int i = 0 ; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
	
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSearchCriteria(boolean isActive, String name, String rulesEngineEntityID, Integer categoryID) 
{
	form.chkActiveOnly().setValue(isActive);
	form.txtRuleName().setValue(name);
	
	if (rulesEngineEntityID != null)
	{
		List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();		
		for (int i = 0 ; i < entities.size(); i++)
		{
			if (rulesEngineEntityID.equals(entities.get(i).getId()))
			{
				form.cmbEntity().setValue(entities.get(i));
				break;
			}
		}
	}
	
	if (categoryID != null)
	{
		for (int i = 0; i < form.treRootEntity().getNodes().size(); i++) 
		{
			if (form.treRootEntity().getNodes().get(i).getValue() instanceof BusinessRuleCategory &&
					((BusinessRuleCategory)form.treRootEntity().getNodes().get(i).getValue()).getID() == categoryID)
			{
				form.treRootEntity().setValue(form.treRootEntity().getNodes().get(i).getValue());
				break;
			}
		}
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRootEntity()
{
	form.lyrRules().tabConditions().cmbRootEntity().clear();
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	Collections.sort(entities, new RulesEngineEntityComparator());

	for (int i = 0; i < entities.size(); i++)
	{
		form.lyrRules().tabConditions().cmbRootEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addEntityField()
{
	DynamicGridRow entityFieldInstanceRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow().getRows().newRow();
	entityFieldInstanceRow.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) entityFieldInstanceRow.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridCell valueCell = entityFieldInstanceRow.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	onDyngrdActionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRulesNotificationEntry(RuleValueConditionEntry entry, DynamicGridRow parentRow)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridColumn valueColl = getColByIndexForActionGrid(1);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", 1);
	}

	setRowIdentifier(row, 1, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	int count = row.getIdentifier() != null ? (row.getIdentifier() instanceof RuleConditionRowVo ? (((RuleConditionRowVo) row.getIdentifier()).getNumberOfColumns()) : 0) : 0;
	count++;
	try
	{
		addRuleNotificationCell(row, entry.getChild() != null ? entry.getChild() : entry, count);
	}
	catch (ParseException e)
	{
		e.printStackTrace();
	}
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(RulesEngineEntity o1, RulesEngineEntity o2)
{
	if (o1.getName() == null || o2.getName() == null)
		return 0;
	
	return o1.getName().compareToIgnoreCase(o2.getName());
}
 
Example 21
Project: openMAXIMS   File: Entities.java   Source Code and License 5 votes vote down vote up
public List<RulesEngineEntity> getAllPublicEntities()
{
	List<RulesEngineEntity> all = getAllEntities();
	List<RulesEngineEntity> result = new ArrayList<RulesEngineEntity>();
		for(int x = 0; x < all.size(); x++)
		{
			if(all.get(x).isPublic())
			{
				result.add(all.get(x));
			}
		}
	return result;
}
 
Example 22
Project: openMAXIMS   File: Entities.java   Source Code and License 5 votes vote down vote up
public RulesEngineEntity getEntityById(String id)
{
	for(int x = 0; x < getAllEntities().size(); x++)
	{
		if(getAllEntities().get(x).getId().equals((id)))
			return getAllEntities().get(x);
	}

	return null;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void populateRootEntities()
{
	// Clear the combobox
	form.cmbEntity().clear();

	// Get all public entities
	List<RulesEngineEntity> entities = Entities.getInstance().getAllPublicEntities();

	// Populate the combobox
	for (int i = 0; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void setRulesEntities()
{
	// Clear combobox
	form.cmbEntity().clear();
	
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();
	
	for (int i = 0 ; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
	
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSearchCriteria(boolean isActive, String name, String rulesEngineEntityID, Integer categoryID) 
{
	form.chkActiveOnly().setValue(isActive);
	form.txtRuleName().setValue(name);
	
	if (rulesEngineEntityID != null)
	{
		List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();		
		for (int i = 0 ; i < entities.size(); i++)
		{
			if (rulesEngineEntityID.equals(entities.get(i).getId()))
			{
				form.cmbEntity().setValue(entities.get(i));
				break;
			}
		}
	}
	
	if (categoryID != null)
	{
		for (int i = 0; i < form.treRootEntity().getNodes().size(); i++) 
		{
			if (form.treRootEntity().getNodes().get(i).getValue() instanceof BusinessRuleCategory &&
					((BusinessRuleCategory)form.treRootEntity().getNodes().get(i).getValue()).getID() == categoryID)
			{
				form.treRootEntity().setValue(form.treRootEntity().getNodes().get(i).getValue());
				break;
			}
		}
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRootEntity()
{
	form.lyrRules().tabConditions().cmbRootEntity().clear();
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	Collections.sort(entities, new RulesEngineEntityComparator());

	for (int i = 0; i < entities.size(); i++)
	{
		form.lyrRules().tabConditions().cmbRootEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addEntityField()
{
	DynamicGridRow entityFieldInstanceRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow().getRows().newRow();
	entityFieldInstanceRow.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) entityFieldInstanceRow.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridCell valueCell = entityFieldInstanceRow.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	onDyngrdActionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRulesNotificationEntry(RuleValueConditionEntry entry, DynamicGridRow parentRow)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridColumn valueColl = getColByIndexForActionGrid(1);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", 1);
	}

	setRowIdentifier(row, 1, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	int count = row.getIdentifier() != null ? (row.getIdentifier() instanceof RuleConditionRowVo ? (((RuleConditionRowVo) row.getIdentifier()).getNumberOfColumns()) : 0) : 0;
	count++;
	try
	{
		addRuleNotificationCell(row, entry.getChild() != null ? entry.getChild() : entry, count);
	}
	catch (ParseException e)
	{
		e.printStackTrace();
	}
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(RulesEngineEntity o1, RulesEngineEntity o2)
{
	if (o1.getName() == null || o2.getName() == null)
		return 0;
	
	return o1.getName().compareToIgnoreCase(o2.getName());
}
 
Example 30
Project: openMAXIMS   File: Entities.java   Source Code and License 5 votes vote down vote up
public List<RulesEngineEntity> getAllPublicEntities()
{
	List<RulesEngineEntity> all = getAllEntities();
	List<RulesEngineEntity> result = new ArrayList<RulesEngineEntity>();
		for(int x = 0; x < all.size(); x++)
		{
			if(all.get(x).isPublic())
			{
				result.add(all.get(x));
			}
		}
	return result;
}
 
Example 31
Project: openMAXIMS   File: Entities.java   Source Code and License 5 votes vote down vote up
public RulesEngineEntity getEntityById(String id)
{
	for(int x = 0; x < getAllEntities().size(); x++)
	{
		if(getAllEntities().get(x).getId().equals((id)))
			return getAllEntities().get(x);
	}

	return null;
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void populateRootEntities()
{
	// Clear the combobox
	form.cmbEntity().clear();

	// Get all public entities
	List<RulesEngineEntity> entities = Entities.getInstance().getAllPublicEntities();

	// Populate the combobox
	for (int i = 0; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void setRulesEntities()
{
	// Clear combobox
	form.cmbEntity().clear();
	
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();
	
	for (int i = 0 ; i < entities.size(); i++)
	{
		form.cmbEntity().newRow(entities.get(i), entities.get(i).getName());
	}
	
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSearchCriteria(boolean isActive, String name, String rulesEngineEntityID, Integer categoryID) 
{
	form.chkActiveOnly().setValue(isActive);
	form.txtRuleName().setValue(name);
	
	if (rulesEngineEntityID != null)
	{
		List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();		
		for (int i = 0 ; i < entities.size(); i++)
		{
			if (rulesEngineEntityID.equals(entities.get(i).getId()))
			{
				form.cmbEntity().setValue(entities.get(i));
				break;
			}
		}
	}
	
	if (categoryID != null)
	{
		for (int i = 0; i < form.treRootEntity().getNodes().size(); i++) 
		{
			if (form.treRootEntity().getNodes().get(i).getValue() instanceof BusinessRuleCategory &&
					((BusinessRuleCategory)form.treRootEntity().getNodes().get(i).getValue()).getID() == categoryID)
			{
				form.treRootEntity().setValue(form.treRootEntity().getNodes().get(i).getValue());
				break;
			}
		}
	}
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRootEntity()
{
	form.lyrRules().tabConditions().cmbRootEntity().clear();
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	Collections.sort(entities, new RulesEngineEntityComparator());

	for (int i = 0; i < entities.size(); i++)
	{
		form.lyrRules().tabConditions().cmbRootEntity().newRow(entities.get(i), entities.get(i).getName());
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addEntityField()
{
	DynamicGridRow entityFieldInstanceRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow().getRows().newRow();
	entityFieldInstanceRow.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) entityFieldInstanceRow.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridCell valueCell = entityFieldInstanceRow.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	onDyngrdActionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRulesNotificationEntry(RuleValueConditionEntry entry, DynamicGridRow parentRow)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridColumn valueColl = getColByIndexForActionGrid(1);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", 1);
	}

	setRowIdentifier(row, 1, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	int count = row.getIdentifier() != null ? (row.getIdentifier() instanceof RuleConditionRowVo ? (((RuleConditionRowVo) row.getIdentifier()).getNumberOfColumns()) : 0) : 0;
	count++;
	try
	{
		addRuleNotificationCell(row, entry.getChild() != null ? entry.getChild() : entry, count);
	}
	catch (ParseException e)
	{
		e.printStackTrace();
	}
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(RulesEngineEntity o1, RulesEngineEntity o2)
{
	if (o1.getName() == null || o2.getName() == null)
		return 0;
	
	return o1.getName().compareToIgnoreCase(o2.getName());
}
 
Example 39
Project: openmaxims-linux   File: Entities.java   Source Code and License 5 votes vote down vote up
public List<RulesEngineEntity> getAllPublicEntities()
{
	List<RulesEngineEntity> all = getAllEntities();
	List<RulesEngineEntity> result = new ArrayList<RulesEngineEntity>();
		for(int x = 0; x < all.size(); x++)
		{
			if(all.get(x).isPublic())
			{
				result.add(all.get(x));
			}
		}
	return result;
}
 
Example 40
Project: openmaxims-linux   File: Entities.java   Source Code and License 5 votes vote down vote up
public RulesEngineEntity getEntityById(String id)
{
	for(int x = 0; x < getAllEntities().size(); x++)
	{
		if(getAllEntities().get(x).getId().equals((id)))
			return getAllEntities().get(x);
	}

	return null;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 42
Project: AvoinApotti   File: Entities.java   Source Code and License 4 votes vote down vote up
private List<RulesEngineEntity> getAllEntities()
{
	if(entities != null)
		return entities;
	entities = new ArrayList<RulesEngineEntity>();

	new InstructionsforDischaiNurse(entities);
	new MedicationOnAdmissionandChanges(entities);
	new Diagnosis(entities);
	new MedicationConfig(entities);
	new DiagnosisCurrentStatus(entities);
	new InvestigationIndex(entities);
	new Investigation(entities);
	new DocumentStatus(entities);
	new PatientDocument(entities);
	new AuthoringInformation(entities);
	new ICPConfiguration(entities);
	new Test(entities);
	new testcoll(entities);
	new TestColl2(entities);
	new PatientReferral(entities);
	new SystemLog(entities);
	new PatientICPPhase(entities);
	new PatientICPStage(entities);
	new PatientICP(entities);
	new PatientICPActionStatus(entities);
	new PatientICPAction(entities);
	new PatientCareContext(entities);
	new PatientEpisodeofCare(entities);
	new PatientCareSpell(entities);
	new Plastics(entities);
	new TTAMedications(entities);
	new Patient(entities);
	new IntraOperativeCareRecord(entities);
	new ClinicalImagingResult(entities);
	new OrderDetails(entities);
	new PathologyResult(entities);
	new PatientInvestigation(entities);
	new ClinicalInformation(entities);
	new InvestigationStatus(entities);
	new NeoNatal(entities);
	new Name(entities);
	new ICPActionConfiguration(entities);
	new ICPStageConfiguration(entities);
	new ICPPhaseConfiguration(entities);
	new TTAandPharmacy(entities);
	new ReferralCurrentStatus(entities);
	new ConsultantOutpatientAppointmentOutcome(entities);
	new OutpatientPreAssessment(entities);
	new NursingandAnaesthetistOutcome(entities);
	new MemberofStaff(entities);
	new Nurse(entities);
	new HealthCareProfessional(entities);
	new DischargeSummaryPACUandWard(entities);
	new FuturePlan(entities);
	new DischargeDetails(entities);
	new ReadytoLeave(entities);
	new Procedure(entities);
	new TaxonomyMapping(entities);
	new PatientDiagnosis(entities);
	new PatientProcedure(entities);

	return entities;
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 44
Project: openMAXIMS   File: Entities.java   Source Code and License 4 votes vote down vote up
private List<RulesEngineEntity> getAllEntities()
{
	if(entities != null)
		return entities;
	entities = new ArrayList<RulesEngineEntity>();

	new InstructionsforDischaiNurse(entities);
	new MedicationOnAdmissionandChanges(entities);
	new Diagnosis(entities);
	new MedicationConfig(entities);
	new TaxonomyMapping(entities);
	new DiagnosisCurrentStatus(entities);
	new InvestigationIndex(entities);
	new DocumentStatus(entities);
	new PatientDocument(entities);
	new AuthoringInformation(entities);
	new ICPConfiguration(entities);
	new Test(entities);
	new testcoll(entities);
	new TestColl2(entities);
	new PatientReferral(entities);
	new SystemLog(entities);
	new PatientICPPhase(entities);
	new PatientICPStage(entities);
	new PatientICP(entities);
	new PatientICPActionStatus(entities);
	new PatientICPAction(entities);
	new PatientCareContext(entities);
	new PatientEpisodeofCare(entities);
	new PatientCareSpell(entities);
	new Plastics(entities);
	new TTAMedications(entities);
	new TTAandPharmacy(entities);
	new Patient(entities);
	new IntraOperativeCareRecord(entities);
	new Investigation(entities);
	new ClinicalImagingResult(entities);
	new OrderDetails(entities);
	new PathologyResult(entities);
	new PatientInvestigation(entities);
	new ClinicalInformation(entities);
	new InvestigationStatus(entities);
	new NeoNatal(entities);
	new Name(entities);
	new ICPActionConfiguration(entities);
	new ICPStageConfiguration(entities);
	new ICPPhaseConfiguration(entities);
	new ReferralCurrentStatus(entities);
	new ConsultantOutpatientAppointmentOutcome(entities);
	new OutpatientPreAssessment(entities);
	new NursingandAnaesthetistOutcome(entities);
	new MemberofStaff(entities);
	new Nurse(entities);
	new HealthCareProfessional(entities);
	new DischargeSummaryPACUandWard(entities);
	new FuturePlan(entities);
	new DischargeDetails(entities);
	new ReadytoLeave(entities);
	new Procedure(entities);
	new TaxonomyMapping(entities);
	new PatientDiagnosis(entities);
	new PatientProcedure(entities);

	return entities;
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 46
Project: openMAXIMS   File: Entities.java   Source Code and License 4 votes vote down vote up
private List<RulesEngineEntity> getAllEntities()
{
	if(entities != null)
		return entities;
	entities = new ArrayList<RulesEngineEntity>();

	new InstructionsforDischaiNurse(entities);
	new MedicationOnAdmissionandChanges(entities);
	new Diagnosis(entities);
	new MedicationConfig(entities);
	new DiagnosisCurrentStatus(entities);
	new InvestigationIndex(entities);
	new Investigation(entities);
	new DocumentStatus(entities);
	new PatientDocument(entities);
	new AuthoringInformation(entities);
	new ICPConfiguration(entities);
	new Test(entities);
	new testcoll(entities);
	new TestColl2(entities);
	new PatientReferral(entities);
	new SystemLog(entities);
	new PatientICPPhase(entities);
	new PatientICPStage(entities);
	new PatientICP(entities);
	new PatientICPActionStatus(entities);
	new PatientICPAction(entities);
	new PatientCareContext(entities);
	new PatientEpisodeofCare(entities);
	new PatientCareSpell(entities);
	new Plastics(entities);
	new TTAMedications(entities);
	new Patient(entities);
	new IntraOperativeCareRecord(entities);
	new ClinicalImagingResult(entities);
	new OrderDetails(entities);
	new PathologyResult(entities);
	new PatientInvestigation(entities);
	new ClinicalInformation(entities);
	new InvestigationStatus(entities);
	new NeoNatal(entities);
	new Name(entities);
	new ICPActionConfiguration(entities);
	new ICPStageConfiguration(entities);
	new ICPPhaseConfiguration(entities);
	new TTAandPharmacy(entities);
	new ReferralCurrentStatus(entities);
	new ConsultantOutpatientAppointmentOutcome(entities);
	new OutpatientPreAssessment(entities);
	new NursingandAnaesthetistOutcome(entities);
	new MemberofStaff(entities);
	new Nurse(entities);
	new HealthCareProfessional(entities);
	new DischargeSummaryPACUandWard(entities);
	new FuturePlan(entities);
	new DischargeDetails(entities);
	new ReadytoLeave(entities);
	new Procedure(entities);
	new TaxonomyMapping(entities);
	new PatientDiagnosis(entities);
	new PatientProcedure(entities);

	return entities;
}
 
Example 47
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 48
Project: openmaxims-linux   File: Entities.java   Source Code and License 4 votes vote down vote up
private List<RulesEngineEntity> getAllEntities()
{
	if(entities != null)
		return entities;
	entities = new ArrayList<RulesEngineEntity>();

	new InstructionsforDischaiNurse(entities);
	new MedicationOnAdmissionandChanges(entities);
	new Diagnosis(entities);
	new MedicationConfig(entities);
	new DiagnosisCurrentStatus(entities);
	new InvestigationIndex(entities);
	new Investigation(entities);
	new DocumentStatus(entities);
	new PatientDocument(entities);
	new AuthoringInformation(entities);
	new ICPConfiguration(entities);
	new Test(entities);
	new testcoll(entities);
	new TestColl2(entities);
	new PatientReferral(entities);
	new SystemLog(entities);
	new PatientICPPhase(entities);
	new PatientICPStage(entities);
	new PatientICP(entities);
	new PatientICPActionStatus(entities);
	new PatientICPAction(entities);
	new PatientCareContext(entities);
	new PatientEpisodeofCare(entities);
	new PatientCareSpell(entities);
	new Plastics(entities);
	new TTAMedications(entities);
	new Patient(entities);
	new IntraOperativeCareRecord(entities);
	new ClinicalImagingResult(entities);
	new OrderDetails(entities);
	new PathologyResult(entities);
	new PatientInvestigation(entities);
	new ClinicalInformation(entities);
	new InvestigationStatus(entities);
	new NeoNatal(entities);
	new Name(entities);
	new ICPActionConfiguration(entities);
	new ICPStageConfiguration(entities);
	new ICPPhaseConfiguration(entities);
	new TTAandPharmacy(entities);
	new ReferralCurrentStatus(entities);
	new ConsultantOutpatientAppointmentOutcome(entities);
	new OutpatientPreAssessment(entities);
	new NursingandAnaesthetistOutcome(entities);
	new MemberofStaff(entities);
	new Nurse(entities);
	new HealthCareProfessional(entities);
	new DischargeSummaryPACUandWard(entities);
	new FuturePlan(entities);
	new DischargeDetails(entities);
	new ReadytoLeave(entities);
	new Procedure(entities);
	new TaxonomyMapping(entities);
	new PatientDiagnosis(entities);
	new PatientProcedure(entities);

	return entities;
}