Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
package inventoryplugin.entity;

import net.java.ao.Entity;
import net.java.ao.Implementation;
import net.java.ao.OneToMany;
import net.java.ao.Preload;
import net.java.ao.schema.Indexed;

@Preload
@Implementation(JipFormImpl.class)
public interface JipForm extends Entity {
   @Indexed
   String getFormName();
   @Indexed
   void setFormName(String name);
   
   int getSortOrder();
   void setSortOrder(int value);
   
   @OneToMany
   public JipFormAttribute[] getFormAttributes(); 
   
   @OneToMany
   public JipInventory[] getInventories();
}

AipUtils

Utility functions to use during the post function execution.

Code Block
languagejava
package inventoryplugin.workflow.function.tools;

import inventoryplugin.entity.JipInventory;
import inventoryplugin.entity.JipInventoryItem;

import java.util.List;

public interface AipUtils {
    /**
     * Get asset attribute by name
     * @param asset - current asset JipInventory object
     * @param attributeName - name of the attribute name to look for
     * @return attribute instance of JipInventoryItem type
     */
    JipInventoryItem getAssetAttributeByName(JipInventory asset, String attributeName);

    /**
     * Get asset attribute by id
     * @param asset - current asset JipInventory object
     * @param attributeId - name of the attribute id to look for
     * @return attribute instance of JipInventoryItem type
     */
    JipInventoryItem getAssetAttributeById(JipInventory asset, Integer attributeId);

    /**
     * Get attribute value as string by name
     * @param asset - current asset JipInventory object
     * @param attributeName - name of the attribute name to look for
     * @return attribute value as String
     */
    String getAttributeValueAsStringByName(JipInventory asset, String attributeName);

    /**
     * Get attribute value as string by id
     * @param asset - current asset JipInventory object
     * @param attributeId - name of the attribute id to look for
     * @return attribute value as String
     */
    String getAttributeValueAsStringById(JipInventory asset, Integer attributeId);

    /**
     * get multi attribute value as List by name
     * @param asset - current asset JipInventory object
     * @param attributeName - name of the attribute name to look for
     * @return List of String
     */
    List<String> getMultiAttributeValueAsListByName(JipInventory asset, String attributeName);

    /**
     * get multi attribute value as List by name
     * @param asset - current asset JipInventory object
     * @param attributeId - name of the attribute id to look for
     * @return List of String
     */
    List<String> getMultiAttributeValueAsListById(JipInventory asset, Integer attributeId);
}