Search in sources :

Example 81 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project Activiti by Activiti.

the class ClassDelegate method execute.

// Activity Behavior
public void execute(ActivityExecution execution) throws Exception {
    boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);
    if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {
        if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
            ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());
            if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME)) {
                String overrideClassName = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME).asText();
                if (StringUtils.isNotEmpty(overrideClassName) && overrideClassName.equals(className) == false) {
                    className = overrideClassName;
                    activityBehaviorInstance = null;
                }
            }
        }
        if (activityBehaviorInstance == null) {
            activityBehaviorInstance = getActivityBehaviorInstance(execution);
        }
        try {
            activityBehaviorInstance.execute(execution);
        } catch (BpmnError error) {
            ErrorPropagation.propagateError(error, execution);
        } catch (Exception e) {
            if (!ErrorPropagation.mapException(e, execution, mapExceptions)) {
                throw e;
            }
        }
    }
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ActivitiException(org.activiti.engine.ActivitiException) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) InvocationTargetException(java.lang.reflect.InvocationTargetException) BpmnError(org.activiti.engine.delegate.BpmnError)

Example 82 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project metacat by Netflix.

the class MetadataV1Resource method getDataMetadata.

/**
     * {@inheritDoc}
     */
@Override
public DataMetadataDto getDataMetadata(final DataMetadataGetRequestDto metadataGetRequestDto) {
    return requestWrapper.processRequest("getDataMetadata", () -> {
        DataMetadataDto result = null;
        if (metadataGetRequestDto.getUri() != null) {
            final Optional<ObjectNode> o = userMetadataService.getDataMetadata(metadataGetRequestDto.getUri());
            if (o.isPresent()) {
                result = new DataMetadataDto();
                result.setDataMetadata(o.get());
                result.setUri(metadataGetRequestDto.getUri());
            }
        }
        return result;
    });
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) DataMetadataDto(com.netflix.metacat.common.dto.DataMetadataDto)

Example 83 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project metacat by Netflix.

the class BaseUserMetadataService method populateMetadata.

/**
     * Populate the given metadata.
     *
     * @param holder metadata
     */
@Override
public void populateMetadata(final HasMetadata holder) {
    Optional<ObjectNode> metadata = Optional.empty();
    if (holder instanceof HasDataMetadata) {
        final HasDataMetadata dataDto = (HasDataMetadata) holder;
        if (dataDto.isDataExternal()) {
            metadata = getDataMetadata(dataDto.getDataUri());
        }
    }
    Optional<ObjectNode> definitionMetadata = Optional.empty();
    if (holder instanceof HasDefinitionMetadata) {
        final HasDefinitionMetadata definitionDto = (HasDefinitionMetadata) holder;
        definitionMetadata = getDefinitionMetadata(definitionDto.getDefinitionName());
    }
    populateMetadata(holder, definitionMetadata.orElse(null), metadata.orElse(null));
}
Also used : HasDataMetadata(com.netflix.metacat.common.dto.HasDataMetadata) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) HasDefinitionMetadata(com.netflix.metacat.common.dto.HasDefinitionMetadata)

Example 84 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project heron by twitter.

the class MarathonScheduler method getLabels.

protected ObjectNode getLabels(ObjectMapper mapper) {
    ObjectNode labelNode = mapper.createObjectNode();
    labelNode.put(MarathonConstants.ENVIRONMENT, Context.environ(config));
    return labelNode;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Example 85 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project heron by twitter.

the class MarathonScheduler method getPorts.

protected ArrayNode getPorts(ObjectMapper mapper) {
    ArrayNode ports = mapper.createArrayNode();
    for (String portName : MarathonConstants.PORT_NAMES) {
        ObjectNode port = mapper.createObjectNode();
        port.put(MarathonConstants.PORT, 0);
        port.put(MarathonConstants.PROTOCOL, MarathonConstants.TCP);
        port.put(MarathonConstants.PORT_NAME, portName);
        ports.add(port);
    }
    return ports;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2446 JsonNode (com.fasterxml.jackson.databind.JsonNode)556 Test (org.junit.Test)556 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)509 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)370 IOException (java.io.IOException)214 ArrayList (java.util.ArrayList)119 HashMap (java.util.HashMap)107 Map (java.util.Map)106 List (java.util.List)96 StringEntity (org.apache.http.entity.StringEntity)94 Deployment (org.activiti.engine.test.Deployment)85 Test (org.testng.annotations.Test)81 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)69 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)65 HttpPost (org.apache.http.client.methods.HttpPost)57 AbstractRpcLwM2MIntegrationTest (org.thingsboard.server.transport.lwm2m.rpc.AbstractRpcLwM2MIntegrationTest)54 TextNode (com.fasterxml.jackson.databind.node.TextNode)52 File (java.io.File)51 Task (org.activiti.engine.task.Task)51