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

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


        QueryGenerator queryGenerator = new QueryGenerator(USER_WORKFLOW);
        queryGenerator.setParameter(UserWorkflowConstants.GATEWAY_NAME, keys[0]);
        queryGenerator.setParameter(UserWorkflowConstants.OWNER, keys[1]);
        queryGenerator.setParameter(UserWorkflowConstants.TEMPLATE_NAME, keys[2]);
        Query q = queryGenerator.selectQuery(em);
        User_Workflow userWorkflow = (User_Workflow)q.getSingleResult();
        UserWorkflowResource userWorkflowResource = (UserWorkflowResource)Utils.getResource(
                ResourceType.USER_WORKFLOW, userWorkflow);
        em.getTransaction().commit();
        em.close();
        list.add(userWorkflowResource);
View Full Code Here


        throw new UnsupportedOperationException();
    }

    public void save() {
        EntityManager em = ResourceUtils.getEntityManager();
        User_Workflow existingWF = em.find(User_Workflow.class, new User_Workflow_PK(name, worker.getUser(), gateway.getGatewayName()));
        em.close();

        em = ResourceUtils.getEntityManager();
        em.getTransaction().begin();
        User_Workflow userWorkflow = new User_Workflow();
        userWorkflow.setTemplate_name(name);
        if(lastUpdateDate == null){
            java.util.Date date= new java.util.Date();
            lastUpdateDate = new Timestamp(date.getTime());
        }
        userWorkflow.setLast_updated_date(lastUpdateDate);
        byte[] bytes = content.getBytes();
        userWorkflow.setWorkflow_graph(bytes);
        userWorkflow.setGateway_name(this.gateway.getGatewayName());
        userWorkflow.setOwner(this.getWorker().getUser());
        userWorkflow.setPath(path);
        if(existingWF != null){
            existingWF.setGateway_name(this.gateway.getGatewayName());
            existingWF.setOwner(this.getWorker().getUser());
            existingWF.setTemplate_name(name);
            existingWF.setLast_updated_date(lastUpdateDate);
View Full Code Here

    public void save() throws RegistryException {
        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            User_Workflow existingWF = em.find(User_Workflow.class, new User_Workflow_PK(name, worker.getUser(), gateway.getGatewayName()));
            em.close();

            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            User_Workflow userWorkflow = new User_Workflow();
            userWorkflow.setTemplate_name(name);
            if (lastUpdateDate == null) {
                java.util.Date date = new java.util.Date();
                lastUpdateDate = new Timestamp(date.getTime());
            }
            userWorkflow.setLast_updated_date(lastUpdateDate);
            byte[] bytes = content.getBytes();
            userWorkflow.setWorkflow_graph(bytes);
            userWorkflow.setGateway_name(this.gateway.getGatewayName());
            userWorkflow.setOwner(this.getWorker().getUser());
            userWorkflow.setPath(path);
            if (existingWF != null) {
                existingWF.setGateway_name(this.gateway.getGatewayName());
                existingWF.setOwner(this.getWorker().getUser());
                existingWF.setTemplate_name(name);
                existingWF.setLast_updated_date(lastUpdateDate);
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.model.User_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.