Class ItemFactory

java.lang.Object
com.easydesk.om.util.ItemFactory

public class ItemFactory extends Object
새로운 Item 을 등록한다. ItemFactory
Author:
Youngho Cho
  • Constructor Details

    • ItemFactory

      public ItemFactory(Item item)
      Item 에 대한 factory 를 생성한다.
      Parameters:
      item - 대상 Item
  • Method Details

    • getFactory

      public static ItemFactory getFactory(Item item)
      Item 에 대한 factory 를 구한다.
      Parameters:
      item - 대상 Item
      Returns:
      ItemFactory
    • setInitialAttributeValues

      public ActivitySet setInitialAttributeValues(ActivitySet activitySet, Attachment attachment, Map<Integer,AttributeValue> newValues, EasyDeskUser user) throws Exception
      Sets original AttributeValues for an new item based on a hashmap of attributeValues. This is data is saved to the database and the proper ActivitySet is also recorded.
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      attachment - item을 저장하기 이전에는 itemId 가 없기 때문에 입력시에는 activitySet 에 attachment 를 미리 저장할 수가 없다.
      newValues - { attributeId, AttributeValue } map
      user - current working user @todo activitySet.getCurrentActor() 로 대치한다.
      Returns:
      저장에 사용된 ActivitySet
      Throws:
      Exception - when the workflow has an error to report
    • doCheckInitialAttributeValueWorkflow

      public Object doCheckInitialAttributeValueWorkflow(Map<Integer,AttributeValue> newValues, EasyDeskUser actor, ActivitySet activitySet) throws Exception
      This method is used with the setInitialAttributeValues() method to Make sure that workflow is valid for the initial values of a new item. It will return a non-null String which is the workflow error message otherwise it will return null.
      Parameters:
      newValues - { attributeId, AttributeValue } map
      actor - 작업하는 사용자
      activitySet - 현재 처리중인 ActivitySet
      Returns:
      obj
      Throws:
      Exception - workflow 확인 중 오류가 발생한 경우
    • doCheckAttributeValueWorkflow

      public Object doCheckAttributeValueWorkflow(Map<Integer,AttributeValue> newAttVals, EasyDeskUser user) throws Exception
      This method is used with the setAttributeValues() method to Make sure that workflow is valid. It will return a constraint object which is the workflow blocking condition, error message otherwise it will return null
      Parameters:
      newAttVals - { attributeId, AttributeValue } map
      user - 작업하는 사용자
      Returns:
      constraint object if exists or null
      Throws:
      Exception - workflow 확인 중 오류가 발생한 경우
    • setAttributeValues

      public ActivitySet setAttributeValues(ActivitySet activitySet, Map<Integer,AttributeValue> newAttVals, EasyDeskUser user) throws Exception
      Sets AttributeValues for an item based on a hashmap of attribute values This is data is saved to the database and the proper ActivitySet is also recorded.
      Parameters:
      activitySet - ActivitySet instance
      newAttVals - A map of attribute Id's vs new AttributeValues
      user - User responsible for this activity
      Returns:
      ActivitySet object containing the changes made to the item
      Throws:
      Exception - when the workflow has an error to report
    • setAttributeValues

      protected ActivitySet setAttributeValues(ActivitySet activitySet, Map<Integer,AttributeValue> newAttVals, Attachment attachment, EasyDeskUser user) throws Exception
      Sets AttributeValues for an item based on a hashmap of attribute values This is data is saved to the database and the proper ActivitySet is also recorded.
      Parameters:
      activitySet - ActivitySet instance
      newAttVals - A map of attribute Id's vs new AttributeValues
      attachment - Attachment to the item
      user - User responsible for this activity
      Returns:
      ActivitySet object containing the changes made to the item
      Throws:
      Exception - when the workflow has an error to report
    • setAttributeValues

      protected ActivitySet setAttributeValues(ActivitySet activitySet, Map<Integer,AttributeValue> newAttVals, Attachment attachment, EasyDeskUser user, boolean isCorrelated) throws Exception
      Sets AttributeValues for an item based on a hashmap of attribute values This is data is saved to the database and the proper ActivitySet is also recorded.
      Parameters:
      activitySet - ActivitySet instance which already registered
      newAttVals - A map of attribute Id's vs new AttributeValues
      attachment - Attachment to the item
      user - User responsible for this activity
      isCorrelated - correlated 이면 workfiow 를 처리하지 않는다. @todo review the function
      Returns:
      ActivitySet object containing the changes made to the item
      Throws:
      Exception - when the workflow has an error to report
    • makePending

      protected boolean makePending(ActivitySet activitySet, Map<Integer,AttributeValue> newAttVals, Attachment attachment, EasyDeskUser user, boolean isCorrelated) throws Exception
      모든 Condition 을 확인해서 조건에 의하여 Blocking 이 되어 있는 경우 make pending or not check
      Parameters:
      activitySet - ActivitySet instance which already registered
      newAttVals - A map of attribute Id's vs new AttributeValues
      attachment - Attachment to the item
      user - User responsible for this activity
      isCorrelated - correlated 이면 workfiow 를 처리하지 않는다. @todo review the function
      Returns:
      makePending or not
      Throws:
      Exception - when the workflow has an error to report