*/
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);