You can create DMScript Procedures and invoke them "directly" without the need to perform a deployment. You can use this to create test scripts so that you can get used to DMScript syntax and the capabilities of the language without the need to instigate a deployment.


To do this, perform the following steps:


Create your Custom DMScript Function or Procedure

  1. Select the "Flows" menu option along the top of the DeployHub Web User Interface.


  1. Select the "Functions and Procedures" tab on the explorer pane (tree view) on the left- hand side.
  2. Right-Click on the Domain where you want to create your Procedure.
  3. Select "New Procedure in this Domain" (or New Function if you want to create a Function).
  4. A pop-up box appears. Enter the name for your Procedure. For "kind" select "DMScript Procedure in Database" (or "DMScript Function in Database" if creating a Function). Pick a "Category" in which you want the Procedure/Function to appear in the action editor. You can type a new category name here to create a new category.
  5. Click OK to create the new Procedure/Function. The summary page will be displayed.
  6. Select the "Body" tab to select the DMScript body. This will be empty initially.
  7. Click the pencil icon in the top-right of the body pane to open the editor.
  8. Enter your DMScript into the editor. When you have finished editing the script, click OK. If there any syntax errors, these will be highlighted and the editor will stay open. Only if the DMScript is syntactically correct will it be saved and the dialog will close.


Add your Custom Function or Procedure to your Workflow

  1. Click on the "Actions" tab on the explorer pane (tree view) on the left hand side.
  2. Right-Click on the same Domain where you created the Procedure/Function.
  3. Select "New Action in this Domain".
  4. A pop-up box appears. Enter the name of an action. This action will be used to call the Procedure/Function you just created.
  5. Click OK to create the new action. The summary page will be displayed.
  6. Select the "Workflow" tab to select the Action Workflow. This will be empty initially.
  7. In the "activities" pane on the right-hand side of the Workflow editor, locate the Function/Procedure you created earlier. You may need to open the category in which you created the Function/Procedure.
  8. Drag the Procedure/Function on to the Workflow pane.
  9. When you drop the Procedure/Function a pop-up box will open asking you to give the activity a name and a summary. You can choose to put a name in here or not. If you don't give a new name the activity will be given the same name as the Procedure/Function. Just click OK to save the activity.
  10. The action will now consist of a single flow from the "Start" of the workflow to the Procedure/Function you created earlier.


Add the Function or Procedure as a Task for the Domain

  1. Click on the "Domains" menu option along the top of the interface.
  2. Ensure the "Domains" tab is selected on the Explorer Pane (Tree View) on the left- hand side.
  3. Select the same Domain in which you created the action and Procedure (or one of its sub-domains).
  4. Click on the "Tasks" tab on the main panel. This will show all the tasks that are available in the selected domain.
  5. Right click on a blank area in the "Tasks in this Domain" panel (i.e.: do not right-click an existing task).
  6. A pop-up menu will be displayed. Select "Add Run Action Task".
  7. A new task will be created. Click the pencil icon in the top right to edit the task details.
  8. Give the task a new name if required. In the "Action to Run" drop-down, select the action you created above.
  9. Ensure the "Show Output" checkbox is selected.
  10. Click OK to save the task.


Add Permissions to Your New Task

  1. Drag "Everyone" (or an appropriate user group) from the "Available Groups" panel to the "Group Access" panel. This will ensure that the task can be executed.


You can now invoke the DMScript from different contexts:

  • If you right-click on a Component and run the task, the selected Component is pushed onto the stack. You can access the selected Component via the $Component object.
  • If you right-click on an Application and run the task, the selected Application is pushed onto the stack. You can access the selected Application via the $Application object.