Interface IWorkflowManager

    • Field Detail

      • ASSIGNED_TO_KEEP_SAME_VALUE

        static final java.lang.String ASSIGNED_TO_KEEP_SAME_VALUE
        The value used by some methods to indicate that the current assigned to value must be kept.
        See Also:
        Constant Field Values
    • Method Detail

      • register

        void register​(SessionConfig sessionConfig,
                      java.lang.String workflowConfigPath,
                      ITransaction transaction)
               throws PortalException
        Register a workflow.
        Parameters:
        sessionConfig - the user session information.
        workflowConfigPath - the path, relative to the definition directory, to the directory with the workflow's definition.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • updateRegister

        void updateRegister​(SessionConfig sessionConfig,
                            java.lang.String workflowId,
                            ITransaction transaction)
                     throws PortalException
        Updates the register of a workflow.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the workflow id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.0.5
      • unregister

        void unregister​(SessionConfig sessionConfig,
                        java.lang.String workflowId,
                        ITransaction transaction)
                 throws PortalException
        Removes a workflow from the register.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the workflow's identifier.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • getWorkflow

        WorkflowConfig getWorkflow​(SessionConfig sessionConfig,
                                   java.lang.String workflowId,
                                   ITransaction transaction)
                            throws PortalException
        Returns a workflow.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the workflow's identifier.
        transaction - the transaction for persistence access.
        Returns:
        the workflow.
        Throws:
        PortalException
      • getState

        WorkflowStateConfig getState​(SessionConfig sessionConfig,
                                     java.lang.String workflowId,
                                     java.lang.String stateId,
                                     ITransaction transaction)
                              throws PortalException
        Returns a workflow state.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the identifier of the state's workflow.
        stateId - the state's identifier.
        transaction - the transaction for persistence access.
        Returns:
        the state.
        Throws:
        PortalException
      • getTransition

        WorkflowTransitionConfig getTransition​(SessionConfig sessionConfig,
                                               java.lang.String workflowId,
                                               java.lang.String transitionId,
                                               ITransaction transaction)
                                        throws PortalException
        Returns a workflow transition.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the identifier of the state's workflow.
        transitionId - the transition's identifier.
        transaction - the transaction for persistence access.
        Returns:
        the transition.
        Throws:
        PortalException
      • getTransitionsByStateId

        java.util.List<WorkflowTransitionConfig> getTransitionsByStateId​(SessionConfig sessionConfig,
                                                                         java.lang.String workflowId,
                                                                         java.lang.String stateId,
                                                                         ITransaction transaction)
                                                                  throws PortalException
        Returns the transitions for a workflow state.
        Parameters:
        sessionConfig - the user session information.
        workflowId - the identifier of the state's workflow.
        stateId - the state's identifier.
        transaction - the transaction for persistence access.
        Returns:
        a list with the state's transitions.
        Throws:
        PortalException
      • getAccessibleTransitions

        java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions​(SessionConfig sessionConfig,
                                                                                ContentLocale contentLocale,
                                                                                ITransaction transaction)
                                                                         throws PortalException
        Returns the transitions that are accessible by the sessionConfig's user for a specified contentLocale.
        Parameters:
        sessionConfig - the user session information.
        contentLocale - the contentLocale.
        transaction - the transaction for persistence access.
        Returns:
        a collection with the transitions.
        Throws:
        PortalException
      • getAccessibleTransitions

        @Deprecated
        java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions​(SessionConfig sessionConfig,
                                                                                WorkflowStateConfig state,
                                                                                java.lang.String serviceInstanceId,
                                                                                boolean includeScopeAssignedTo,
                                                                                ITransaction transaction)
                                                                         throws PortalException
        Returns the transitions that are accessible by the sessionConfig's user, originating from a specific workflow state in the specified service instance.
        Parameters:
        sessionConfig - the user session information.
        state - the transition state origin.
        serviceInstanceId - the service instance identifier.
        includeScopeAssignedTo - if true, transitions that the user has permission to access only when the content is assigned to him are also included in the returned collection.
        transaction - the transaction for persistence access.
        Returns:
        a collection with the transitions.
        Throws:
        PortalException
      • getAccessibleStates

        @Deprecated
        java.util.Collection<WorkflowStateConfig> getAccessibleStates​(SessionConfig sessionConfig,
                                                                      java.lang.String serviceInstanceId,
                                                                      boolean includeScopeAll,
                                                                      boolean includeScopeAssignedTo,
                                                                      ITransaction transaction)
                                                               throws PortalException
        Returns a collection of workflow's accessible states.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the content service instance id.
        includeScopeAll - if the states with permission scope all are to be included.
        includeScopeAssignedTo - if the states with permission scope assigned to are to be included.
        transaction - the transaction for persistence access.
        Returns:
        a collection with the workflow's accessible states.
        Throws:
        PortalException
      • getAccessibleTransitions

        java.util.Collection<WorkflowTransitionConfig> getAccessibleTransitions​(SessionConfig sessionConfig,
                                                                                WorkflowStateConfig state,
                                                                                java.lang.String serviceInstanceId,
                                                                                java.util.EnumSet<TransitionScope> scopes,
                                                                                ITransaction transaction)
                                                                         throws PortalException
        Returns the transitions that are accessible by the sessionConfig's user, originating from a specific workflow state in the specified service instance.
        Parameters:
        sessionConfig - user session information.
        state - the transition state origin.
        serviceInstanceId - the content service instance id.
        scopes - transitions scopes that the user has permission to access TransitionScope}
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        6.0.2
      • getAccessibleStates

        java.util.Collection<WorkflowStateConfig> getAccessibleStates​(SessionConfig sessionConfig,
                                                                      java.lang.String serviceInstanceId,
                                                                      java.util.EnumSet<StateScope> scopes,
                                                                      ITransaction transaction)
                                                               throws PortalException
        Returns a collection of workflow's accessible states.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the content service instance id.
        scopes - states scope that the user has permission to access StateScope}
        transaction - the transaction for persistence access.
        Returns:
        a collection with the workflow's accessible states.
        Throws:
        PortalException
        Since:
        6.0.2
      • getServiceInstanceWorkflow

        WorkflowConfig getServiceInstanceWorkflow​(SessionConfig sessionConfig,
                                                  java.lang.String serviceInstanceId,
                                                  ITransaction transaction)
                                           throws PortalException
        Returns the workflow of a service instance.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance's id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • setServiceInstanceWorkflow

        void setServiceInstanceWorkflow​(SessionConfig sessionConfig,
                                        java.lang.String serviceInstanceId,
                                        java.lang.String workflowId,
                                        ITransaction transaction)
                                 throws PortalException
        Sets the workflow to be used in a service instance.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance's id.
        workflowId - the workflow's id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • destroyServiceInstanceWorkflow

        void destroyServiceInstanceWorkflow​(SessionConfig sessionConfig,
                                            java.lang.String serviceInstanceId,
                                            ITransaction transaction)
                                     throws PortalException
        Destroys the service instance workflow, so that the service instance can be correctly removed. This method should be called only prior to a service instance removal.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance's id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • deleteAllContentWorkflowMetaData

        void deleteAllContentWorkflowMetaData​(SessionConfig sessionConfig,
                                              java.lang.String serviceInstanceId,
                                              ITransaction transaction)
                                       throws PortalException
        Deletes all the workflow metadata that is assocated to a specified service instance.
        Parameters:
        sessionConfig - the user session information.
        serviceInstanceId - the service instance identifier.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.0.11
      • getAllWorkflows

        java.util.Collection<WorkflowConfig> getAllWorkflows​(SessionConfig sessionConfig,
                                                             ITransaction transaction)
                                                      throws PortalException
        Returns all registered workflows.
        Parameters:
        sessionConfig - the user session information.
        transaction - the transaction for persistence access.
        Returns:
        a collection with all registered workflows.
        Throws:
        PortalException
      • getWorkflowPermissions

        java.util.Collection<WorkflowPermission> getWorkflowPermissions​(SessionConfig sessionConfig,
                                                                        java.lang.String serviceInstanceId,
                                                                        ITransaction transaction)
                                                                 throws PortalException
        Returns the permissions set for a workflow in a service instance.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance's id.
        transaction - the transaction for persistence access.
        Returns:
        a WorkflowPermission collection.
        Throws:
        PortalException
      • setWorkflowPermissions

        void setWorkflowPermissions​(SessionConfig sessionConfig,
                                    java.lang.String serviceInstanceId,
                                    java.util.Collection<WorkflowPermission> permissions,
                                    ITransaction transaction)
                             throws PortalException
        Updates the workflow permissions in a service instance.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance's id.
        permissions - the set of permissions to be set in the service instance. All previous permissions will be deleted.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • getContentWorkflowMetaData

        ContentWorkflowMetaData getContentWorkflowMetaData​(SessionConfig sessionConfig,
                                                           ContentLocale contentLocale,
                                                           ITransaction transaction)
                                                    throws PortalException
        Returns the content workflow metadata for a content locale.
        Parameters:
        sessionConfig - user session information.
        contentLocale - the content locale-specific object.
        transaction - the transaction for persistence access.
        Returns:
        the content workflow metadata.
        Throws:
        PortalException
        Since:
        4.2.0
      • createNewContentWorkflowMetaData

        @Deprecated
        void createNewContentWorkflowMetaData​(SessionConfig sessionConfig,
                                              java.lang.String itemId,
                                              java.lang.String serviceInstanceId,
                                              java.lang.String sourceId,
                                              java.lang.String assignedTo,
                                              ITransaction transaction)
                                       throws PortalException
        Creates the content workflow metadata for a new content.
        Parameters:
        sessionConfig - user session information.
        itemId - the content's item id.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        assignedTo - the principal identifier to be assigned to.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • createNewContentWorkflowMetaData

        void createNewContentWorkflowMetaData​(SessionConfig sessionConfig,
                                              ContentLocale contentLocale,
                                              java.lang.String assignedTo,
                                              ITransaction transaction)
                                       throws PortalException
        Creates a new content workflow metadata for a content locale.
        Parameters:
        sessionConfig - user session information.
        contentLocale - the content locale.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        assignedTo - the principal identifier to be assigned to.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.2.0
      • deleteContentWorkflowMetaData

        @Deprecated
        void deleteContentWorkflowMetaData​(SessionConfig sessionConfig,
                                           java.lang.String itemId,
                                           java.lang.String serviceInstanceId,
                                           java.lang.String sourceId,
                                           ITransaction transaction)
                                    throws PortalException
        Deletes the content workflow metadata of the given content.
        Parameters:
        sessionConfig - user session information.
        itemId - the content's item id.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • deleteContentWorkflowMetaData

        void deleteContentWorkflowMetaData​(SessionConfig sessionConfig,
                                           ContentLocale contentLocale,
                                           ITransaction transaction)
                                    throws PortalException
        Deletes the content workflow metadata of the given content locale.
        Parameters:
        sessionConfig - user session information.
        contentLocale - the content locale.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.2.0
      • executeAction

        @Deprecated
        void executeAction​(SessionConfig sessionConfig,
                           java.lang.String itemId,
                           java.lang.String serviceInstanceId,
                           java.lang.String sourceId,
                           java.lang.String performedTransitionId,
                           java.lang.String newAssignedTo,
                           ITransaction transaction)
                    throws PortalException
        Executes an action on a content's workflow.
        Parameters:
        sessionConfig - user session information.
        itemId - the content's item id.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        performedTransitionId - the transition action performed. If null, no transition is performed.
        newAssignedTo - the new assigned to principal id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • executeAction

        void executeAction​(SessionConfig sessionConfig,
                           ContentLocale contentLocale,
                           java.lang.String performedTransitionId,
                           java.lang.String newAssignedTo,
                           ITransaction transaction)
                    throws PortalException
        Executes an action on a content's workflow.

        After the action is executed, this method sends a WorkflowActionExecutedEvent.

        Parameters:
        sessionConfig - user session information.
        contentLocale - the content locale specific object.
        performedTransitionId - the transition action performed. If null, no transition is performed.
        newAssignedTo - the new assigned to principal id.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.2.0
      • hasEditPermission

        @Deprecated
        boolean hasEditPermission​(SessionConfig sessionConfig,
                                  java.lang.String itemId,
                                  java.lang.String serviceInstanceId,
                                  java.lang.String sourceId,
                                  ITransaction transaction)
                           throws PortalException
        Returns true if the sessionConfig's user has edit permission to the specified item, according to the workflow's definition, state and assigned to.

        If there is no workflow, or no content workflow metadata, true is returned.

        Parameters:
        sessionConfig - user session information.
        itemId - the content's item id.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        transaction - the transaction for persistence access.
        Returns:
        true if the user has the permission, false otherwise.
        Throws:
        PortalException
      • hasEditPermission

        boolean hasEditPermission​(SessionConfig sessionConfig,
                                  ContentLocale contentLocale,
                                  ITransaction transaction)
                           throws PortalException
        Returns true if the sessionConfig's user has edit permission to the specified content, according to the workflow's definition, state and assigned to.

        If there is no workflow, or no content workflow metadata, true is returned.

        Parameters:
        sessionConfig - user session information.
        contentLocale - the content.
        transaction - the transaction for persistence access.
        Returns:
        true if the user has the permission, false otherwise.
        Throws:
        PortalException
      • getPossibleAssignedToForAction

        @Deprecated
        java.util.Collection<java.lang.String> getPossibleAssignedToForAction​(SessionConfig sessionConfig,
                                                                              java.lang.String itemId,
                                                                              java.lang.String serviceInstanceId,
                                                                              java.lang.String sourceId,
                                                                              java.lang.String transitionId,
                                                                              ITransaction transaction)
                                                                       throws PortalException
        Returns the possible assignedTo values for a workflow transition.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        transitionId - the workflow's transition id.
        transaction - the transaction for persistence access.
        Returns:
        a collection of principals ids that may be assigned to a content in the given workflow state.
        Throws:
        PortalException
      • getPossibleAssignedTo

        java.util.Collection<java.lang.String> getPossibleAssignedTo​(SessionConfig sessionConfig,
                                                                     java.lang.String serviceInstanceId,
                                                                     WorkflowStateConfig workflowState,
                                                                     ITransaction transaction)
                                                              throws PortalException
        Returns the possible assignedTo values for a workflow state.
        Parameters:
        sessionConfig - user session information.
        serviceInstanceId - the service instance identifier.
        workflowState - the workflow's state.
        transaction - the transaction for persistence access.
        Returns:
        a collection of principals identifiers that may be assigned to a content in the specified state.
        Throws:
        PortalException
        Since:
        4.2.0
      • contentMayBePublished

        @Deprecated
        boolean contentMayBePublished​(SessionConfig sessionConfig,
                                      java.lang.String itemId,
                                      java.lang.String serviceInstanceId,
                                      java.lang.String sourceId,
                                      ITransaction transaction)
                               throws PortalException
        Parameters:
        sessionConfig - user session information.
        itemId - the content's item id.
        serviceInstanceId - the content's service instance id.
        sourceId - the content's source id.
        transaction - the transaction for persistence access.
        Returns:
        true if the content may be published, according to its workflow state, false otherwise.
        Throws:
        PortalException
      • contentMayBePublished

        boolean contentMayBePublished​(SessionConfig sessionConfig,
                                      ContentLocale contentLocale,
                                      ITransaction transaction)
                               throws PortalException
        Indicates if a content version may be published according to its workflow state.
        Parameters:
        sessionConfig - user session information.
        contentLocale - the content version.
        transaction - the transaction for persistence access.
        Returns:
        true if it may be published, according to its workflow state, false otherwise.
        Throws:
        PortalException
        Since:
        4.2.0
      • autoArchivePublishedContent

        boolean autoArchivePublishedContent​(ContentLocale contentLocale,
                                            ITransaction transaction)
                                     throws PortalException
        Used for the automatic content archiving process. Performs a transition to a directly reachable archival state, if any.

        If the given content version is not in a published state or is already in an archived state or is not after its publishing period then nothing is done.

        Parameters:
        contentLocale - the content version.
        transaction - the transaction for persistence access.
        Returns:
        true if the content version was archived, or false if nothing was done.
        Throws:
        PortalException
        Since:
        4.2.0