Interface ConnectorService

    • Method Detail

      • executeMultipleEvaluation

        ConnectorResult executeMultipleEvaluation​(long processDefinitionId,
                                                  java.lang.String connectorDefinitionId,
                                                  java.lang.String connectorDefinitionVersion,
                                                  java.util.Map<java.lang.String,​SExpression> connectorInputParameters,
                                                  java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.io.Serializable>> inputValues,
                                                  java.lang.ClassLoader classLoader,
                                                  SExpressionContext sexpContext)
                                           throws SConnectorException
        Execute a connector instance by given connectorDefinitionId and connectorDefinitionVersion
        Parameters:
        processDefinitionId - The identifier of process definition
        connectorDefinitionId - The identifier of connector definition
        connectorDefinitionVersion - The version of connector definition
        connectorInputParameters - The input of connector
        inputValues - The input values of connector
        classLoader - The class loader used to load and run connector
        sexpContext - The expression context
        Returns:
        The output after connector executing
        Throws:
        SConnectorException - Error thrown if has exceptions during the connector executing
      • loadConnectors

        boolean loadConnectors​(SProcessDefinition sDefinition)
                        throws SConnectorException
        Load connectors for given process definition and tenant, connectors will be stored in cache after loading
        Parameters:
        sDefinition - The process definition
        Returns:
        true if all connectors found have all them dependencies resolved and are correctly loaded
        Throws:
        SConnectorException - Error thrown if has exceptions during the connector loading
      • setConnectorImplementation

        void setConnectorImplementation​(SProcessDefinition sProcessDefinition,
                                        java.lang.String connectorId,
                                        java.lang.String connectorVersion,
                                        byte[] connectorImplementationArchive)
                                 throws SConnectorException,
                                        SInvalidConnectorImplementationException
        Set connector implementation for id and version specified connector. Store all connector related files if they are not existed and replace the old implementation with the new one in file system. Delete former and load current connectors in cache.
        Parameters:
        sProcessDefinition - The process definition which the connector belongs to
        connectorId - Id of connector definition.
        connectorVersion - Version of connector definition
        connectorImplementationArchive - zip byte array containing the connector implementation information
        Throws:
        SConnectorException - Error thrown if has exceptions during the connector implementation setting
        SInvalidConnectorImplementationException
      • getConnectorImplementations

        java.util.List<SConnectorImplementationDescriptor> getConnectorImplementations​(long processDefinitionId,
                                                                                       int fromIndex,
                                                                                       int numberPerPage,
                                                                                       java.lang.String field,
                                                                                       OrderByType order)
                                                                                throws SConnectorException
        Get a list of connector implementation descriptors for id specified process definition, the returned list is paginated
        Parameters:
        processDefinitionId - Identifier of process definition
        fromIndex - Start index of connector record
        numberPerPage - Number of connectors we want to get. Maximum number of connectors returned.
        field - The field that the result ordered by
        order - The order, ACS or DESC
        Returns:
        A list of all satisfied connector implementation descriptor objects
        Throws:
        SConnectorException - Error thrown if has exceptions during the connector implementations retrieve
      • getConnectorImplementation

        SConnectorImplementationDescriptor getConnectorImplementation​(long processDefinitionId,
                                                                      java.lang.String connectorId,
                                                                      java.lang.String connectorVersion)
                                                               throws SConnectorException
        Get connector implementation descriptor for specified connector in a process definition.
        Parameters:
        processDefinitionId - Identifier of process definition
        connectorId - id of connector definition
        connectorVersion - version of connector definition
        Returns:
        connector implementation descriptor object
        Throws:
        SConnectorException - Error thrown if has exceptions during the connector implementation get
      • executeConnector

        java.util.concurrent.CompletableFuture<ConnectorResult> executeConnector​(long processDefinitionId,
                                                                                 SConnectorInstance sConnectorInstance,
                                                                                 SConnectorImplementationDescriptor connectorImplementationDescriptor,
                                                                                 java.lang.ClassLoader classLoader,
                                                                                 java.util.Map<java.lang.String,​java.lang.Object> inputParameters)
                                                                          throws SConnectorException
        Parameters:
        processDefinitionId -
        sConnectorInstance -
        connectorImplementationDescriptor -
        classLoader -
        inputParameters -
        Returns:
        the result of the connector execution
        Throws:
        SConnectorException
      • getNumberOfConnectorImplementations

        java.lang.Long getNumberOfConnectorImplementations​(long processDefinitionId)
                                                    throws SConnectorException
        Parameters:
        processDefinitionId - the id of the process definition
        Returns:
        the number of connector implementation for this process definition
        Throws:
        SConnectorException
      • addConnectorImplementation

        void addConnectorImplementation​(java.lang.Long processDefinitionId,
                                        java.lang.String name,
                                        byte[] content)
                                 throws SRecorderException
        Throws:
        SRecorderException