Create an Execution Engine Step

When a plan is triggered the 'main' or first step will be invoked.

To add some actions into your plan you need to set up subsequent steps. This consists of the following:

  • Defining a step
  • Linking the step to a function in the EE Plan
  • Declaring the function in the EE plan
  • Calling 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 opens.

 

Step Description
System Name

This is the system name of the step and also the function name that shows in the ee plan.

There should be no spaces in the name.

Naming convention is firstword lower case then each subsequent word capitalised.

Example: createSampleTask1

Name

The name of the step.

Depending on configuration this may appear for users and will appear in diagnostic tools, so should be clearly and descriptively named.

Description A description of the function of the step
Optimal Path Is this the optimal 'happy' path for the work type
Entry Point

Is this the entry point for the plan.

This will automatically be set to On for the main function that is automatically created when the plan.

It is possible to have multiple entry points for the plan.

End State

Set to On for the final step on the process.

All plans should have a single end point, and you should ensure that this is called from all steps that may lead to it. If you don't, there will be numerous unfinished processes in the system.

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. Firstly, you 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 will be pasted into your plan
    var systemName = function(ev, ctx, log) {
    // Code
    };
  8. Replace the systemName placeholder with the system name of your new step.

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

Declare the Function in the EE Plan

  1. Once you have 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: mainadd a comma, then a new line with your function name in the same format - so it reads
    main: main,
    createSimpleTask1: createSimpleTask1

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, youe need to call the function to make sure it executes.
  2. In your sample plan you call the function as soon as the plan has triggered and you have the information from your event.
  3. In the main function, after you have retrieved the creator participant, you add a call to your new step.
  4. 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();
  5. Change the 'stepname' to your function name.
    // Call Step
    trigger.SubProcess("createSimpleTask1").Now();

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