batchJob-ux

This module contains JavaScript implementations of core batchJob APIs.

Overview

If you wish to add support for configuring your JobStepFactory in the browser, perform the following steps.

Java Implementation

You must subclass BIUxJobStepFactory and to be register it as an Agent on the JobStep. The public method getJsInfo of this class should point to the JavaScript implementation of the JobStepFactory. Subclassed UxJobStepFactory implementations will be displayed in the NiagaraNetworkJob step list.

Example

Below code is only for reference, you must run slotomatic for the NiagaraType and please do not copy/paste.

Java Changes

@NiagaraType(
  agent = @AgentOn(
    types = "customModule:CustomJobStep"
  )
)
@NiagaraSingleton
public final class BUxCustomJobStepFactory 
  extends BSingleton 
  implements BIUxJobStepFactory 
{
  // ------------ WILL BE AUTOGENERATED WHEN YOU DO slotomatic DO NOT COPY: START ------------ +*/
  public static final BUxCustomJobStepFactory INSTANCE = new BUxCustomJobStepFactory();

  @Override
  public Type getType() { return TYPE; }
  public static final Type TYPE = Sys.loadType(BUxCustomJobStepFactory.class);

  // ------------ WILL BE AUTOGENERATED WHEN YOU DO slotomatic DO NOT COPY: END ------------ +*/

  private BUxCustomJobStepFactory()
  {
  }
  
  public JsInfo getJsInfo(Context cx)
  {
    return JS_INFO;
  }

  private static final JsInfo JS_INFO = JsInfo.make(
    BOrd.make("module://customModule/rc/CustomUxJobStepFactory.js"),
    BCustomModuleJsBuild.TYPE);
  
} 

module-include.xml changes

customModule/module-include.xml

<types>
  <type class="com.customModule.job.BUxCustomJobStepFactory" name="UxCustomJobStepFactory">
    <agent>
      <on type="customModule:CustomJobStep"/>
    </agent>
  </type>
</types>

Javascript

You must subclass the interface UxJobStepFactory to create your CustomJobStepFactory. Properties must have module and lex to derive displayName, description,
and icon for the job step factory, also, one must implement method makeStep to make the job step, and may implement method editStep to edit the job step.

Example

Javascript changes

class CustomJobStepFactory extends UxJobStepFactory {
  constructor(params) {
    super({
      module: 'customModule',
      lex: 'CustomJobStepFactory'
    });
    
    makeStep() {
      //make step code goes here.
    }
    
    editStep({step}) {
      //edit step code goes here.
    }
  }
}