Skip to content

Lifecycle

Lifecycle module provides utility functions for managing the lifecycle of the projects in the system

  • Module: platform/lifecycle
  • Definition: https://github.com/eclipse/dirigible/issues/233
  • Source: /platform/lifecycle.js
  • Status: stable
  • Group: platform

Basic Usage

import { bytes } from "sdk/io";
import { user } from "sdk/security";
import { workspace, lifecycle } from "sdk/platform";
import { response } from "sdk/http";

const currentUser = user.getName();
const workspaceName = "workspace";
const projectName = "project";

let myWorkspace = workspace.createWorkspace(workspaceName);
let myProject = myWorkspace.createProject(projectName);
let myFile = myProject.createFile("file.js");
myFile.setContent(bytes.textToByteArray("console.log('Hello World!');"));

let publishResult = lifecycle.publish(currentUser, workspaceName, projectName);

response.println("publishResult: " + publishResult)

Functions


Function Description Returns
publish(user, workspace, project) Publish project from the workspace, the project parameter is optional boolean
unpublish(user, workspace, project) Unpublish project from the workspace, the project parameter is optional boolean