//GET for an Integer
//For this to work you MUST use "java.lang.Long" when declaring your variable in the Work Flow NOT INT
//Declares a ibaHolder of type IBAHolder and sets it equal to IBAHolder of the PBO from the function refreshAttributeContainer
wt.iba.value.IBAHolder ibaHolder=wt.iba.value.service.IBAValueHelper.service.refreshAttributeContainer((wt.iba.value.IBAHolder)primaryBusinessObject, null, null, null); 

//Declares a DefService of type StandardIBADefinitionService and sets it to StandardIBADefinitionService function
wt.iba.definition.service.StandardIBADefinitionService defService=new wt.iba.definition.service.StandardIBADefinitionService();

//Declares a attributeContainer of type DefaultAttributeContainer and gets the container with the function getAttributeContainer()
wt.iba.value.DefaultAttributeContainer attributeContainer=(wt.iba.value.DefaultAttributeContainer)ibaHolder.getAttributeContainer();

//Try Block used to catch a blank Int 
try
{
//Defines a attributeDefinition of type AttributeDefDefaultView that gets the variable in question (logical name in type/atribute manager. This case "IntNum"
wt.iba.definition.litedefinition.AttributeDefDefaultView attributeDefinition=defService.getAttributeDefDefaultViewByPath("IntNum");
System.out.println("Size:"+attributeContainer.getAttributeValues(attributeDefinition).length);

//Declares attValue of type IntegerValueDefaultView (Integer, change for diff values) and sets it equal to the getAttributeValues function
wt.iba.value.litevalue.IntegerValueDefaultView attValue= (wt.iba.value.litevalue.IntegerValueDefaultView)attributeContainer.getAttributeValues(attributeDefinition)[0];

//Sets the IntNum = to previously defined attvalue. !!NOTE:MUST USE getValue() NOT isValue() for Integer
IntNum=attValue.getValue();
System.out.println("IntNum");

 }
 catch (Exception e)
 {
   System.out.println("Error getting attribute value,"+e.getMessage());
 }




//SET a Integer
//Declares a ibaHolder of type IBAHolder and sets it equal to IBAHolder of the PBO from the function refreshAttributeContainer
wt.iba.value.IBAHolder ibaHolder=wt.iba.value.service.IBAValueHelper.service.refreshAttributeContainer((wt.iba.value.IBAHolder)primaryBusinessObject, null, null, null);
 
//Declares a DefService of type StandardIBADefinitionService and sets it to StandardIBADefinitionService function
wt.iba.definition.service.StandardIBADefinitionService defService=new wt.iba.definition.service.StandardIBADefinitionService();

//Declares a attributeContainer of type DefaultAttributeContainer and gets the container with the function getAttributeContainer()
wt.iba.value.DefaultAttributeContainer attributeContainer=(wt.iba.value.DefaultAttributeContainer)ibaHolder.getAttributeContainer();

//Try Block used to catch a blank Integer
try 
{
wt.iba.definition.litedefinition.AttributeDefDefaultView attributeDefinition=defService.getAttributeDefDefaultViewByPath("IntNum");
System.out.println("Size:"+attributeContainer.getAttributeValues(attributeDefinition).length);

wt.iba.value.litevalue.IntegerValueDefaultView attValue= (wt.iba.value.litevalue.IntegerValueDefaultView)attributeContainer.getAttributeValues(attributeDefinition)[0];
System.out.println("Setting value to "+ IntNum);

attValue.setValue(IntNum);

//Updates the Attributevalue (refresh to check for more) 
attributeContainer.updateAttributeValue(attValue);
System.out.println("Value is now "+ attValue.getValue());

//Saves it to the PBO without this, user will not see an update on the screen
wt.fc.PersistenceHelper.manager.save(primaryBusinessObject);

}
catch (Exception e)
{
  System.out.println("Error getting attribute value,"+e.getMessage());
}