Class FlowableUserRequestHandler

    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • dataBinder

        protected final org.apache.syncope.core.provisioning.api.data.UserDataBinder dataBinder
      • adminUser

        protected final String adminUser
      • userDAO

        protected final org.apache.syncope.core.persistence.api.dao.UserDAO userDAO
      • entityFactory

        protected final org.apache.syncope.core.persistence.api.entity.EntityFactory entityFactory
    • Constructor Detail

      • FlowableUserRequestHandler

        public FlowableUserRequestHandler​(org.apache.syncope.core.provisioning.api.data.UserDataBinder dataBinder,
                                          String adminUser,
                                          DomainProcessEngine engine,
                                          org.apache.syncope.core.persistence.api.dao.UserDAO userDAO,
                                          org.apache.syncope.core.persistence.api.entity.EntityFactory entityFactory)
    • Method Detail

      • createProcessInstanceQuery

        protected StringBuilder createProcessInstanceQuery​(String userKey)
      • countProcessInstances

        protected int countProcessInstances​(StringBuilder processInstanceQuery)
      • getUserRequest

        protected UserRequest getUserRequest​(org.flowable.engine.runtime.ProcessInstance procInst)
      • getUserRequests

        @Transactional(readOnly=true)
        public org.apache.commons.lang3.tuple.Pair<Integer,​List<UserRequest>> getUserRequests​(String userKey,
                                                                                                    int page,
                                                                                                    int size,
                                                                                                    List<org.apache.syncope.core.persistence.api.dao.search.OrderByClause> orderByClauses)
        Description copied from interface: UserRequestHandler
        Get the running user requests matching the provided parameters.
        Specified by:
        getUserRequests in interface UserRequestHandler
        Parameters:
        userKey - user key (optional)
        page - result page
        size - items per page
        orderByClauses - sort conditions
        Returns:
        total number of user requests, list of user requests matching the provided parameters
      • lazyLoad

        protected org.apache.syncope.core.persistence.api.entity.user.User lazyLoad​(org.apache.syncope.core.persistence.api.entity.user.User user)
      • start

        public UserRequest start​(String bpmnProcess,
                                 org.apache.syncope.core.persistence.api.entity.user.User user,
                                 WorkflowTaskExecInput inputVariables)
        Description copied from interface: UserRequestHandler
        Starts a new user request, for the given BPMN process and user.
        Specified by:
        start in interface UserRequestHandler
        Parameters:
        bpmnProcess - BPMN process
        user - user
        inputVariables - variables
        Returns:
        data about the started request service, including execution id
      • parse

        public org.apache.commons.lang3.tuple.Pair<org.flowable.engine.runtime.ProcessInstance,​String> parse​(String executionId)
        Description copied from interface: UserRequestHandler
        Parses the given execution id to find matching user request and owner.
        Specified by:
        parse in interface UserRequestHandler
        Parameters:
        executionId - execution id
        Returns:
        matching user request and owner
      • cancel

        public void cancel​(org.flowable.engine.runtime.ProcessInstance procInst,
                           String reason)
        Description copied from interface: UserRequestHandler
        Cancel a running user request.
        Specified by:
        cancel in interface UserRequestHandler
        Parameters:
        procInst - process instance for user request
        reason - reason to cancel the user request
      • cancelByProcessDefinition

        public void cancelByProcessDefinition​(String processDefinitionId)
        Description copied from interface: UserRequestHandler
        Cancel all running user requests for the given process definition id.
        Specified by:
        cancelByProcessDefinition in interface UserRequestHandler
        Parameters:
        processDefinitionId - process definition id
      • cancelByUser

        public void cancelByUser​(org.apache.syncope.core.provisioning.api.event.AnyLifecycleEvent<org.apache.syncope.core.persistence.api.entity.Any<?>> event)
        Description copied from interface: UserRequestHandler
        Cancel all running user requests for the user in the given delete event.
        Specified by:
        cancelByUser in interface UserRequestHandler
        Parameters:
        event - delete event
      • fromFlowableFormType

        protected static UserRequestFormPropertyType fromFlowableFormType​(org.flowable.engine.form.FormType flowableFormType)
      • getForm

        protected UserRequestForm getForm​(org.flowable.task.api.Task task)
      • getForm

        protected UserRequestForm getForm​(org.flowable.task.api.Task task,
                                          org.flowable.engine.form.TaskFormData fd)
      • getForm

        protected UserRequestForm getForm​(org.flowable.task.api.history.HistoricTaskInstance task)
      • getUserKey

        protected String getUserKey​(String procInstId)
      • getHistoricFormTO

        protected UserRequestForm getHistoricFormTO​(String procInstId,
                                                    String taskId,
                                                    String formKey,
                                                    List<org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity> props)
      • getForms

        @Transactional(readOnly=true)
        public org.apache.commons.lang3.tuple.Pair<Integer,​List<UserRequestForm>> getForms​(String userKey,
                                                                                                 int page,
                                                                                                 int size,
                                                                                                 List<org.apache.syncope.core.persistence.api.dao.search.OrderByClause> ob)
        Description copied from interface: UserRequestHandler
        Get the forms matching the provided parameters.
        Specified by:
        getForms in interface UserRequestHandler
        Parameters:
        userKey - user key (optional)
        page - result page
        size - items per page
        ob - sort conditions
        Returns:
        total number of forms, list of forms matching the provided parameters
      • getForms

        protected org.apache.commons.lang3.tuple.Pair<Integer,​List<UserRequestForm>> getForms​(org.flowable.task.api.TaskQuery query,
                                                                                                    int page,
                                                                                                    int size,
                                                                                                    List<org.apache.syncope.core.persistence.api.dao.search.OrderByClause> orderByClauses)
      • parseTask

        protected org.apache.commons.lang3.tuple.Pair<org.flowable.task.api.Task,​org.flowable.engine.form.TaskFormData> parseTask​(String taskId)
      • getTask

        protected org.flowable.task.api.Task getTask​(String taskId)
                                              throws org.apache.syncope.core.persistence.api.dao.NotFoundException
        Throws:
        org.apache.syncope.core.persistence.api.dao.NotFoundException
      • getHistoricVariable

        protected <T> T getHistoricVariable​(List<org.flowable.variable.api.history.HistoricVariableInstance> historicVariables,
                                            String name,
                                            Class<T> valueRef)
      • submitForm

        public org.apache.syncope.core.provisioning.api.UserWorkflowResult<org.apache.syncope.common.lib.request.UserUR> submitForm​(UserRequestForm form)
        Description copied from interface: UserRequestHandler
        Submit a form.
        Specified by:
        submitForm in interface UserRequestHandler
        Parameters:
        form - to be submitted
        Returns:
        user updated by this form submit