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

io.automatiko.engine.addons.persistence.AbstractProcessInstancesFactory Maven / Gradle / Ivy

There is a newer version: 0.38.0
Show newest version
package io.automatiko.engine.addons.persistence;

import java.util.Optional;

import com.datastax.oss.driver.api.core.CqlSession;

import io.automatiko.engine.addons.persistence.cassandra.CassandraProcessInstances;
import io.automatiko.engine.api.Model;
import io.automatiko.engine.api.workflow.Process;
import io.automatiko.engine.api.workflow.ProcessInstancesFactory;

/**
 * This class must always have exact FQCN as
 * io.automatiko.engine.addons.persistence.AbstractProcessInstancesFactory
 *
 */
public abstract class AbstractProcessInstancesFactory implements ProcessInstancesFactory {

    protected CqlSession cqlSession;

    protected Optional createKeyspace;

    protected Optional createTables;

    protected Optional keyspace;

    public AbstractProcessInstancesFactory() {
    }

    public AbstractProcessInstancesFactory(CqlSession cqlSession, Optional createKeyspace,
            Optional createTables, Optional keyspace) {
        this.cqlSession = cqlSession;
        this.createKeyspace = createKeyspace;
        this.createTables = createTables;
        this.keyspace = keyspace;
    }

    @SuppressWarnings("unchecked")
    public CassandraProcessInstances createProcessInstances(Process process) {
        return new CassandraProcessInstances((Process) process, cqlSession, codec(),
                transactionLogStore(), auditor(), createKeyspace, createTables, keyspace);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy