Interface ICaseActivityService

All Known Subinterfaces:
ICaseService

public interface ICaseActivityService
  • Field Details

    • MAX_RATING

      static final int MAX_RATING
      Maximum rating for case activity
      See Also:
    • MIN_RATING

      static final int MIN_RATING
      Minimum rating for case activity
      See Also:
  • Method Details

    • getActivatableCaseActivities

      @Deprecated List<CaseActivityDefinition> getActivatableCaseActivities(IBPMContext context, CaseIdentifier caseIdentifier) throws CaseServiceException
      Deprecated.
      Get the list of activatable case activities
       
       IBPMContext context  = ..;
       CaseIdentifier caseIdentifier  = ..;
       ICaseService caseService = ..;
       List<CaseActivityDefinition> activities = caseService.getActivatableCaseActivities(context, caseIdentifier);
      
       for (CaseActivityDefinition activity:activities) {
            String definitionId = activity.getDefinitionId();
            String displayName = activity.getDisplayName();
            String required = activity.getIsRequired();
            String isRepeatable = activity.getIsRepeatable();
            int rating = activity.getInstanceRating();
       }
      
       
       
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      Returns:
      a List value
      Throws:
      CaseServiceException - if an error occurs
    • getCaseActivities

      List<CaseActivityDefinition> getCaseActivities(IBPMContext context, CaseIdentifier caseIdentifier, ICaseConstants.ActivityFilterType filter, String orderBy, ICaseConstants.ActivitySortOrder sortOrder, List<ICaseConstants.ActivityOptionalInfo> optionalInfo, String additionalJPQLWhereClause) throws CaseServiceException
      Get the list of available, unavailable, running, completed or faulted activities
       
         import java.util.List;
         import oracle.bpm.casemgmt.caseactivity.model.CaseActivityDefinition;
         import oracle.bpm.casemgmt.persistence.model.ICaseConstants;
         import oracle.bpm.casemgmt.persistence.model.ICaseConstants.ActivitySortOrder;
         import oracle.bpm.casemgmt.persistence.model.ICaseConstants.ActivitySortColumn;
         import oracle.bpm.casemgmt.persistence.model.ICaseConstants.ActivityFilterType;
         import oracle.bpm.casemgmt.persistence.model.ICaseConstants.ActivityOptionalInfo;
      
         ICaseService caseService = ..;
         IBPMContext  context  = ..;
         CaseIdentifier caseIdentifier =  ..;
      
         // AVAILABLE activities sorted by instance rating in descending order
         List<CaseActivityDefinition> activities = caseService.getCaseActivities(context, caseIdentifier,
                                              ActivityFilterType.AVAILABLE,
                                              ActivitySortColumn.INSTANCE_RATING.toString(),
                                              ActivitySortOrder.DESCENDING, null, null);
      
         //UNAVAILABLE activities sorted using JPQL order by for activity name in descending order.
         String orderBy = "activityDefinition.name DESC";
         List<ActivityOptionalInfo> optionalInfo = new ArrayList<ActivityOptionalInfo>();
         //get process or task documentation.
         optionalInfo.add(ActivityOptionalInfo.DOCUMENTATION);
         //get human task assignees. Only for human task based activities and this works only for filter RUNNING, COMPLETED, FAULTED
         optionalInfo.add(ActivityOptionalInfo.ASSIGNEES);
      
         List<CaseActivityDefinition> activities = caseService.getCaseActivities(context, caseIdentifier,
                                              ActivityFilterType.UNAVAILABLE,
                                              orderBy,
                                              null, optionalInfo, null);
      
         //To get RUNNING activities ordered by started_date
         orderBy = "caseEvent.started_date";
         List<CaseActivityDefinition> activities = caseService.getCaseActivities(context, caseIdentifier,
                                              ActivityFilterType.RUNNING,
                                              orderBy,
                                              null, optionalInfo, null);
      
         //To get COMPLETED required activities
         String additionalJPQLWhereClause = "activityDefinition.isRequired = 'Y'";
      
         List<CaseActivityDefinition> activities = caseService.getCaseActivities(context, caseIdentifier,
                                              ActivityFilterType.COMPLETED,
                                              null,
                                              null, null, additionalJPQLWhereClause);
      
         * for (CaseActivityDefinition activity:activities) {
            String definitionId = activity.getDefinitionId();
            String displayName = activity.getDisplayName();
            String required = activity.getIsRequired();
            String isRepeatable = activity.getIsRepeatable();
            int rating = activity.getInstanceRating();
            List<DocumentationType> documentations = activity.getDocumentations();
            List<DocumentationType> usecaseDocumentations = activity.getUseCaseDocumentations();
            String state = activity.getState();
            TaskInfo taskInfo = activity.getTaskInfo(); // For running, completed, faulted human task activities.
      
       }
      
      
      
      
      
       
       
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      filter - a ICaseConstants.ActivityFilterType value
      orderBy - JPQL order by or a ICaseConstants.ActivitySortColumn value
      sortOrder - a ICaseConstants.ActivitySortOrder value
      optionalInfo - a List<ICaseConstants.ActivityOptionalInfo> value
      additionalJPQLWhereClause - a String value
      Returns:
      a List value
      Throws:
      CaseServiceException - if an error occurs
    • initiateCaseActivity

      boolean initiateCaseActivity(IBPMContext context, CaseIdentifier caseIdentifier, String caseActivityDefinitionId, Map<String,Object> payload, Comment comment) throws CaseServiceException
      Initiate a case activity.
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      caseActivityDefinitionId - a String value. This is the same as CaseActivityDefinition.getDefinitionId
      payload - a Map<String, Object> value. This information is optional. For case activities that map case data to data initiating case activity, this is not needed. When there are case activities which require use to provide data for initiation, this data is required. For initiating activities that are implemented using BPMN or Human Task, the type of Object is expected to be an XML Node
      comment - a Comment value
      Returns:
      a boolean value
      Throws:
      CaseServiceException - if an error occurs
    • registerCaseActivity

      void registerCaseActivity(IBPMContext context, CaseActivity caseActivity) throws CaseServiceException
      Register a case activity
      Parameters:
      context - an IBPMContext value
      caseActivity - a CaseActivity value
      Throws:
      CaseServiceException - if an error occurs
    • unregisterCaseActivity

      void unregisterCaseActivity(IBPMContext context, String caseActivityDefinitionId) throws CaseServiceException
      Unregister a case activity
      Parameters:
      context - an IBPMContext value
      caseActivityDefinitionId - a String value
      Throws:
      CaseServiceException - if an error occurs
    • rateActivityDefinition

      @Deprecated void rateActivityDefinition(IBPMContext context, String caseActivityDefinitionId, int rating) throws CaseServiceException
      Deprecated.
      Rate a case activity. This rating will apply to this case activity across all instances
      Parameters:
      context - an IBPMContext value
      caseActivityDefinitionId - a String value. This is the same as CaseActivityDefinition.getDefinitionId
      rating - an int value. Expected to be between 1 and 5. -1 indicates no rating available.
      Throws:
      CaseServiceException - if an error occurs
    • rateActivityInstance

      @Deprecated void rateActivityInstance(IBPMContext context, CaseIdentifier caseIdentifier, String caseActivityDefinitionId, int rating) throws CaseServiceException
      Deprecated.
      Rate a case activity for a particular instance of a case
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      caseActivityDefinitionId - a String value
      rating - an int value. Expected to be between 1 and 5. -1 indicates no rating available.
      Throws:
      CaseServiceException - if an error occurs
    • addWorkItem

      boolean addWorkItem(IBPMContext context, CaseIdentifier caseIdentifier, String caseActivityDefinitionId) throws CaseServiceException
      Make any unavailable activity available in library. Unavailable activities are conditional and manual activities that are not activated through rules.
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      caseActivityDefinitionId - a String value. This is the same as CaseActivityDefinition.getDefinitionId
      Returns:
      a boolean value
      Throws:
      CaseServiceException - if an error occurs
    • markActivityRelevance

      void markActivityRelevance(IBPMContext context, CaseIdentifier caseIdentifier, String caseActivityDefinitionId, ICaseConstants.ActivityRelevance relevance) throws CaseServiceException
      Mark relevance of a case activity for a particular instance of a case
      Parameters:
      context - an IBPMContext value
      caseIdentifier - a CaseIdentifier value
      caseActivityDefinitionId - a String value
      relevance - an ICaseConstants.ActivityRelevance value. To represent no relevance associated to the activity , use NONE.
      Throws:
      CaseServiceException - if an error occurs