Package org.apache.airavata.persistance.registry.jpa.model

Examples of org.apache.airavata.persistance.registry.jpa.model.Published_Workflow


        em.getTransaction().begin();
        QueryGenerator generator = new QueryGenerator(PUBLISHED_WORKFLOW);
        generator.setParameter(PublishedWorkflowConstants.GATEWAY_NAME, keys[0]);
        generator.setParameter(PublishedWorkflowConstants.PUBLISH_WORKFLOW_NAME, keys[1]);
        Query q = generator.selectQuery(em);
        Published_Workflow publishedWorkflow = (Published_Workflow)q.getSingleResult();
        PublishWorkflowResource publishWorkflowResource = (PublishWorkflowResource)
                Utils.getResource(ResourceType.PUBLISHED_WORKFLOW, publishedWorkflow);
        em.getTransaction().commit();
        em.close();
        list.add(publishWorkflowResource);
View Full Code Here


    /**
     * save published workflow to the database
     */
    public void save() {
        EntityManager em = ResourceUtils.getEntityManager();
        Published_Workflow existingWF = em.find(Published_Workflow.class, new Published_Workflow_PK(gateway.getGatewayName(), name));
        em.close();

        em = ResourceUtils.getEntityManager();
        em.getTransaction().begin();
        Published_Workflow publishedWorkflow = new Published_Workflow();
        publishedWorkflow.setPublish_workflow_name(getName());
        publishedWorkflow.setPublished_date(publishedDate);
        publishedWorkflow.setVersion(version);
        byte[] bytes = content.getBytes();
        publishedWorkflow.setWorkflow_content(bytes);
        Gateway gateway = new Gateway();
        gateway.setGateway_name(this.gateway.getGatewayName());
        publishedWorkflow.setGateway(gateway);
        Users user = new Users();
        user.setUser_name(createdUser);
        publishedWorkflow.setUser(user);
        if(existingWF != null){
            existingWF.setUser(user);
            existingWF.setPublished_date(publishedDate);
            existingWF.setWorkflow_content(bytes);
            existingWF.setVersion(version);
View Full Code Here

     */
    public void save() throws RegistryException{
        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            Published_Workflow existingWF = em.find(Published_Workflow.class, new Published_Workflow_PK(gateway.getGatewayName(), name));
            em.close();

            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            Published_Workflow publishedWorkflow = new Published_Workflow();
            publishedWorkflow.setPublish_workflow_name(getName());
            publishedWorkflow.setPublished_date(publishedDate);
            publishedWorkflow.setVersion(version);
            byte[] bytes = content.getBytes();
            publishedWorkflow.setWorkflow_content(bytes);
            Gateway existingGateway = em.find(Gateway.class, gateway.getGatewayName());
            publishedWorkflow.setGateway(existingGateway);
            publishedWorkflow.setGateway_name(existingGateway.getGateway_name());
            Users user = em.find(Users.class, createdUser);
            publishedWorkflow.setUser(user);
            if (existingWF != null) {
                existingWF.setUser(user);
                existingWF.setGateway(existingGateway);
                existingWF.setGateway_name(existingGateway.getGateway_name());
                existingWF.setPublished_date(publishedDate);
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.model.Published_Workflow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.