Create a Final Execution Engine Step

To mark an execution engine plan as complete you need to create a final step. In the step configuration this is marked as 'End State' and this tells the product that this process has finished exercising (executing?).

To define this step, follow the same process as creating your task step:

  • Define a step
  • Link the step to a function in the EE Plan
  • Declaree the function in the EE plan
  • Call the function in the EE plan

Defining a Step

  1. In the plan editor go to the steps area and click on the plus button.
  2. A new step section opens.

Linking the Step to a Function

  1. Once you have created the step in the steps section of the plan editor you next need to link it to a function.
  2. First you need to create the function in your plan.
  3. After the main function (the }; indicates the end of the function) insert a new function.
  4. The snippets manager contains a snippet to do this 'Step - New Execution Engine Snippet'
  5. To add the snippet,, click on the snippets bar at the bottom of the plan editor. Type in step into the search bar.
  6. Insert the Step - New Execution Engine Step snippet by pressing the  button next to the snippet.
  7. The following snippet is pasted into your plan
    var systemName = function(ev, ctx, log) {
    // Code
    };
  8. Replace the systemName placeholder with the system name of your new step. You do not need to add anything else here.

  9. You have now added you function into the plan.

Declare the Function in the EE Plan

  1. Having added your step function, you need to 'declare it'. This is simply adding it to a list of functions that appear in the plan.
  2. Scroll to the bottom of the plan editor.
  3. You will see a section entitles 'Return {'
  4. This is where all of the functions that are available are listed.
  5. After main: main add a comma then a new line with your function name in the same format - so it reads
    main: main,
    createSimpleTask1: createSimpleTask1,
    endProcess: endProcess

Note that each time you add a new function you must add a comma after the one before it in the list.

Calling the New Step from the EE Plan

  1. Now that you have created your step, function, and declared the function we need to actually call the function to make sure it executes.
  2. In our sample plan we are going to call the function after we have saved our task in the createSampleTask1 function.
  3. You can use the snippet manager to get a snippet to do this. Type 'step' into the snippets area and you will see a snippet of 'Step - Call step (function). Use the insert button to put this into your plan
    // Call Step
    trigger.SubProcess("stepname").Now();
  4. Change the 'stepname' to your function name.
    // Call Step
    trigger.SubProcess("endProcess").Now();

You have now created a new step. Your main function should now look something like this.