Interface ConnectorService
- All Known Implementing Classes:
ConnectorServiceDecorator,ConnectorServiceImpl
public interface ConnectorService
- Since:
- 6.0
- Author:
- Baptiste Mesta, Matthieu Chaffotte, Elias Ricken de Medeiros
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectorImplementation(Long processDefinitionId, String name, byte[] content) voiddisconnect(ConnectorResult result) evaluateInputParameters(String connectorId, Map<String, SExpression> parameters, SExpressionContext sExpressionContext, Map<String, Map<String, Serializable>> inputValues) executeConnector(long processDefinitionId, SConnectorInstance sConnectorInstance, org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor connectorImplementationDescriptor, ClassLoader classLoader, Map<String, Object> inputParameters) executeMultipleEvaluation(long processDefinitionId, String connectorDefinitionId, String connectorDefinitionVersion, Map<String, SExpression> connectorInputParameters, Map<String, Map<String, Serializable>> inputValues, ClassLoader classLoader, SExpressionContext sexpContext) Execute a connector instance by given connectorDefinitionId and connectorDefinitionVersionvoidexecuteOutputOperation(List<SOperation> outputs, SExpressionContext expressionContext, ConnectorResult result) org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptorgetConnectorImplementation(long processDefinitionId, String connectorId, String connectorVersion) Get connector implementation descriptor for specified connector in a process definition.org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptorgetConnectorImplementationDescriptor(long processDefinitionId, String connectorId, String version) getConnectorImplementations(long processDefinitionId, int from, int numberOfElements) List<org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor>getConnectorImplementations(long processDefinitionId, int fromIndex, int numberPerPage, String field, OrderByType order) Get a list of connector implementation descriptors for id specified process definition, the returned list is paginatedgetNumberOfConnectorImplementations(long processDefinitionId) booleanloadConnectors(SProcessDefinition sDefinition) Load connectors for given process definition and tenant, connectors will be stored in cache after loadingvoidremoveConnectorImplementations(long processDefinitionId) voidsetConnectorImplementation(SProcessDefinition sProcessDefinition, String connectorId, String connectorVersion, byte[] connectorImplementationArchive) Set connector implementation for id and version specified connector.
-
Field Details
-
TO_BE_EXECUTED
- See Also:
-
DONE
- See Also:
-
FAILED
- See Also:
-
SKIPPED
- See Also:
-
TO_RE_EXECUTE
- See Also:
-
-
Method Details
-
executeMultipleEvaluation
ConnectorResult executeMultipleEvaluation(long processDefinitionId, String connectorDefinitionId, String connectorDefinitionVersion, Map<String, SExpression> connectorInputParameters, Map<String, throws SConnectorExceptionMap<String, Serializable>> inputValues, ClassLoader classLoader, SExpressionContext sexpContext) Execute a connector instance by given connectorDefinitionId and connectorDefinitionVersion- Parameters:
processDefinitionId- The identifier of process definitionconnectorDefinitionId- The identifier of connector definitionconnectorDefinitionVersion- The version of connector definitionconnectorInputParameters- The input of connectorinputValues- The input values of connectorclassLoader- The class loader used to load and run connectorsexpContext- The expression context- Returns:
- The output after connector executing
- Throws:
SConnectorException- Error thrown if has exceptions during the connector executing
-
loadConnectors
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, String connectorId, 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 toconnectorId- Id of connector definition.connectorVersion- Version of connector definitionconnectorImplementationArchive- zip byte array containing the connector implementation information- Throws:
SConnectorException- Error thrown if has exceptions during the connector implementation settingSInvalidConnectorImplementationException
-
getConnectorImplementations
List<org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor> getConnectorImplementations(long processDefinitionId, int fromIndex, int numberPerPage, 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 definitionfromIndex- Start index of connector recordnumberPerPage- Number of connectors we want to get. Maximum number of connectors returned.field- The field that the result ordered byorder- 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
org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor getConnectorImplementation(long processDefinitionId, String connectorId, String connectorVersion) throws SConnectorException Get connector implementation descriptor for specified connector in a process definition.- Parameters:
processDefinitionId- Identifier of process definitionconnectorId- id of connector definitionconnectorVersion- version of connector definition- Returns:
- connector implementation descriptor object
- Throws:
SConnectorException- Error thrown if has exceptions during the connector implementation get
-
evaluateInputParameters
Map<String,Object> evaluateInputParameters(String connectorId, Map<String, SExpression> parameters, SExpressionContext sExpressionContext, Map<String, throws SExpressionTypeUnknownException, SExpressionEvaluationException, SExpressionDependencyMissingException, SInvalidExpressionExceptionMap<String, Serializable>> inputValues) - Parameters:
parameters-sExpressionContext-inputValues-- Returns:
- Throws:
SExpressionTypeUnknownExceptionSExpressionEvaluationExceptionSExpressionDependencyMissingExceptionSInvalidExpressionException
-
getConnectorImplementationDescriptor
org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor getConnectorImplementationDescriptor(long processDefinitionId, String connectorId, String version) throws SConnectorException - Throws:
SConnectorException
-
executeOutputOperation
void executeOutputOperation(List<SOperation> outputs, SExpressionContext expressionContext, ConnectorResult result) throws SConnectorException - Parameters:
outputs-expressionContext-result-- Throws:
SConnectorException
-
executeConnector
CompletableFuture<ConnectorResult> executeConnector(long processDefinitionId, SConnectorInstance sConnectorInstance, org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor connectorImplementationDescriptor, ClassLoader classLoader, Map<String, Object> inputParameters) throws SConnectorException- Parameters:
processDefinitionId-sConnectorInstance-connectorImplementationDescriptor-classLoader-inputParameters-- Returns:
- the result of the connector execution
- Throws:
SConnectorException
-
disconnect
- Parameters:
result-- Throws:
SConnectorException
-
getNumberOfConnectorImplementations
- Parameters:
processDefinitionId- the id of the process definition- Returns:
- the number of connector implementation for this process definition
- Throws:
SConnectorException
-
getConnectorImplementations
List<SBARResource> getConnectorImplementations(long processDefinitionId, int from, int numberOfElements) throws SBonitaReadException - Throws:
SBonitaReadException
-
addConnectorImplementation
void addConnectorImplementation(Long processDefinitionId, String name, byte[] content) throws SRecorderException - Throws:
SRecorderException
-
removeConnectorImplementations
void removeConnectorImplementations(long processDefinitionId) throws SBonitaReadException, SRecorderException
-