Search in sources :

Example 1 with ApplicationNodeImpl

use of org.apache.airavata.workflow.core.dag.nodes.ApplicationNodeImpl in project airavata by apache.

the class JsonWorkflowParser method readApplication.

private ApplicationNode readApplication(JsonReader jsonReader) throws IOException, ParserException {
    jsonReader.beginObject();
    NodeModel nodeModel = new NodeModel();
    ComponentStatus status = new ComponentStatus();
    status.setState(ComponentState.CREATED);
    status.setReason("Created");
    nodeModel.setStatus(status);
    ApplicationNode applicationNode = new ApplicationNodeImpl(nodeModel);
    String name;
    while (jsonReader.hasNext()) {
        name = jsonReader.nextName();
        if (name.equals(APPLICATION_ID)) {
            nodeModel.setApplicationId(jsonReader.nextString());
        } else if (name.equals(NAME)) {
            nodeModel.setName(jsonReader.nextString());
        } else if (name.equals(DESCRIPTION)) {
            nodeModel.setDescription(jsonReader.nextString());
        } else if (name.equals(APPTYPE)) {
            jsonReader.skipValue();
        } else if (name.equals(INPUTS)) {
            applicationNode.addInputPorts(readApplicationInputs(jsonReader));
        } else if (name.equals(OUTPUTS)) {
            applicationNode.addOutPorts(readApplicationOutputs(jsonReader));
        } else if (name.equals(POSITION)) {
            readPosition(jsonReader);
        } else if (name.equals(NODE_ID)) {
            nodeModel.setNodeId(jsonReader.nextString());
        } else if (name.equals(PARALLEL_EXECUTION)) {
            jsonReader.skipValue();
        } else if (name.equals(PROPERTIES)) {
            readProperties(jsonReader);
        }
    }
    jsonReader.endObject();
    return applicationNode;
}
Also used : NodeModel(org.apache.airavata.model.NodeModel) ComponentStatus(org.apache.airavata.model.ComponentStatus) ApplicationNodeImpl(org.apache.airavata.workflow.core.dag.nodes.ApplicationNodeImpl) ApplicationNode(org.apache.airavata.workflow.core.dag.nodes.ApplicationNode)

Aggregations

ComponentStatus (org.apache.airavata.model.ComponentStatus)1 NodeModel (org.apache.airavata.model.NodeModel)1 ApplicationNode (org.apache.airavata.workflow.core.dag.nodes.ApplicationNode)1 ApplicationNodeImpl (org.apache.airavata.workflow.core.dag.nodes.ApplicationNodeImpl)1