Exemple #1
0
    def _validate_entity(self, dep_update, step):
        entity_keys = utils.get_entity_keys(step.entity_id)
        if len(entity_keys) < RELATIONSHIP_ENTITY_LEN:
            return

        _, source_node_id, relationships, source_relationship_index = \
            entity_keys[:RELATIONSHIP_ENTITY_LEN]

        target_relationship_index = entity_keys[RELATIONSHIP_ENTITY_LEN] \
            if len(entity_keys) > RELATIONSHIP_ENTITY_LEN else None

        # assert the index is indeed readable
        source_relationship_index = \
            utils.parse_index(source_relationship_index)
        target_relationship_index = \
            utils.parse_index(target_relationship_index)

        if not (source_relationship_index or target_relationship_index):
            return

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        source_node_id=source_node_id,
                        relationships=relationships,
                        source_relationship_index=source_relationship_index,
                        target_relationship_index=target_relationship_index)
    def _validate_entity(self, dep_update, step):
        entity_keys = utils.get_entity_keys(step.entity_id)
        if len(entity_keys) < RELATIONSHIP_ENTITY_LEN:
            return

        _, source_node_id, relationships, source_relationship_index = \
            entity_keys[:RELATIONSHIP_ENTITY_LEN]

        target_relationship_index = entity_keys[RELATIONSHIP_ENTITY_LEN] \
            if len(entity_keys) > RELATIONSHIP_ENTITY_LEN else None

        # assert the index is indeed readable
        source_relationship_index = \
            utils.parse_index(source_relationship_index)
        target_relationship_index = \
            utils.parse_index(target_relationship_index)

        if not (source_relationship_index or target_relationship_index):
            return

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        source_node_id=source_node_id,
                        relationships=relationships,
                        source_relationship_index=source_relationship_index,
                        target_relationship_index=target_relationship_index)
 def _validate_entity(self, dep_update, step):
     entity_keys = utils.get_entity_keys(step.entity_id)
     if len(entity_keys) != NODE_ENTITY_LEN:
         return
     _, node_id = entity_keys
     validate = self._validation_mapper[step.action]
     return validate(step.entity_id,
                     step.entity_type,
                     dep_update=dep_update,
                     node_id=node_id)
    def _validate_entity(self, dep_update, step):
        entity_keys = utils.get_entity_keys(step.entity_id)
        if len(entity_keys) != NODE_ENTITY_LEN:
            return
        _, node_id = entity_keys

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        node_id=node_id)
 def _validate_entity(self, dep_update, step):
     output_keys = utils.get_entity_keys(step.entity_id)
     if len(output_keys) < OUTPUT_ENTITY_LEN:
         return
     outputs = output_keys[0]
     output_id = output_keys[1:]
     validate = self._validation_mapper[step.action]
     return validate(step.entity_id,
                     step.entity_type,
                     dep_update=dep_update,
                     output_id=output_id,
                     outputs=outputs)
 def _validate_entity(self, dep_update, step):
     workflow_keys = utils.get_entity_keys(step.entity_id)
     if len(workflow_keys) < WORKFLOW_ENTITY_LEN:
         return
     workflows = workflow_keys[0]
     workflow_id = workflow_keys[1:]
     validate = self._validation_mapper[step.action]
     return validate(step.entity_id,
                     step.entity_type,
                     dep_update=dep_update,
                     workflow_id=workflow_id,
                     workflows=workflows)
 def _validate_entity(self, dep_update, step):
     operation_keys = utils.get_entity_keys(step.entity_id)
     if len(operation_keys) < OPERATION_ENTITY_LEN:
         return
     _, node_id = operation_keys[:OPERATION_ENTITY_LEN]
     operation_id = operation_keys[OPERATION_ENTITY_LEN:]
     validate = self._validation_mapper[step.action]
     return validate(step.entity_id,
                     step.entity_type,
                     dep_update=dep_update,
                     node_id=node_id,
                     operation_id=operation_id)
 def _validate_entity(self, dep_update, step):
     property_keys = utils.get_entity_keys(step.entity_id)
     if len(property_keys) < PROPERTY_ENTITY_LEN:
         return
     _, node_id = property_keys[:PROPERTY_ENTITY_LEN]
     property_id = property_keys[PROPERTY_ENTITY_LEN:]
     validate = self._validation_mapper[step.action]
     return validate(step.entity_id,
                     step.entity_type,
                     dep_update=dep_update,
                     node_id=node_id,
                     property_id=property_id)
    def _validate_entity(self, dep_update, step):
        operation_keys = utils.get_entity_keys(step.entity_id)
        if len(operation_keys) < OPERATION_ENTITY_LEN:
            return

        _, node_id = operation_keys[:OPERATION_ENTITY_LEN]
        operation_id = operation_keys[OPERATION_ENTITY_LEN:]

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        node_id=node_id,
                        operation_id=operation_id)
    def _validate_entity(self, dep_update, step):
        property_keys = utils.get_entity_keys(step.entity_id)

        if len(property_keys) < PROPERTY_ENTITY_LEN:
            return
        _, node_id = property_keys[:PROPERTY_ENTITY_LEN]
        property_id = property_keys[PROPERTY_ENTITY_LEN:]

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        node_id=node_id,
                        property_id=property_id)
    def _validate_entity(self, dep_update, step):
        output_keys = utils.get_entity_keys(step.entity_id)

        if len(output_keys) < OUTPUT_ENTITY_LEN:
            return

        outputs = output_keys[0]
        output_id = output_keys[1:]

        validate = self._validation_mapper[step.action]
        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        output_id=output_id,
                        outputs=outputs)
    def _validate_entity(self, dep_update, step):
        workflow_keys = utils.get_entity_keys(step.entity_id)

        if len(workflow_keys) < WORKFLOW_ENTITY_LEN:
            return

        workflows = workflow_keys[0]
        workflow_id = workflow_keys[1:]

        validate = self._validation_mapper[step.action]

        return validate(step.entity_id,
                        step.entity_type,
                        dep_update=dep_update,
                        workflow_id=workflow_id,
                        workflows=workflows)