All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.ideabuffer.process.api.model.node.ProcessDefinitionModel Maven / Gradle / Ivy

There is a newer version: 1.1.16
Show newest version
package cn.ideabuffer.process.api.model.node;

import cn.ideabuffer.process.api.model.Model;
import cn.ideabuffer.process.api.model.ModelBuilderFactory;
import cn.ideabuffer.process.api.model.builder.NodeModelBuilder;
import cn.ideabuffer.process.core.Node;
import cn.ideabuffer.process.core.ProcessDefinition;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sangjian.sj
 * @date 2020/06/25
 */
public class ProcessDefinitionModel extends Model {

    private List nodes;



    public ProcessDefinitionModel(@NotNull R resource) {
        super(resource);
    }

    public List getNodes() {
        return nodes;
    }

    public void setNodes(List nodes) {
        this.nodes = nodes;
    }

    @Override
    public void init() {
        super.init();
        Node[] arr = resource.getNodes();
        if (arr.length == 0) {
            return;
        }
        this.nodes = new ArrayList<>(arr.length);
        ModelBuilderFactory factory = ModelBuilderFactory.getInstance();
        for (int i = 0; i < arr.length; i++) {
            nodes.add(factory.>getModelBuilder(arr[i]).build(arr[i]));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy