Child pages
  • Jobs-as-Code

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

The term "jobs Jobs-as code-Code" denotes the a capability of maintaining application jobs/ workflows/, workloads, and jobs as software artifacts that can be managed using existing version control and deployment toolchains. Today most workload automation tools maintain their definitions and executions in proprietary tools and formats that are not amenable to standard development and deployment practice. Some examples of common workflows include file transfers and validation, report generation and distribution, and ETL data collection and execution.

Flux has supported jobs as code Jobs-As-Code since its inception in 2000. Being 100% Java, Flux integrates into a development organization's version control and deployment toolchains. This facilitates the development, testing, and deployment of applications and systems requiring support for complex workflows and workload automation. Using Flux's Java API and REST API developers can include the rules and workflows used to schedule and direct their batch applications such as payment processing, bill of lading and manifest preparation, and customer billing, These Jobs-as-Code workflows define the timing, sequence, error and exception handling, and distribution of work across your computing resources.


Code Block
public class ProcessRunAProcess {

  public ProcessRunAProcess () throws Exception {
    Engine flux = Factory.makeInstance().makeEngine();
    FlowChart job = EngineHelper.makeFlowChart("/Native Process Job");
    TimerTrigger timerTrigger= job.makeTimerTrigger("Start at 12:35");
    timerTrigger.setTimeExpression("0 0 35 12");
    ProcessAction processAction = job.makeProcessAction("Run Notepad");
    processAction.setCommand("notepad.exe");  // Set the command to execute
    ConsoleAction consoleAction = job.makeConsoleAction("Announce Completion");
    timerTrigger.addFlow(processAction);  // Flow from the timer to the process
    processAction.addFlow(consoleAction);  // Flow from the process to the console action
    flux.put(job);  // Add the Process job to the engine for execution.
    flux.start();  // Start the Flux engine to run this job, and any other jobs added to the Flux engine
    Thread.sleep(5000);  // Give the engine a chance to run the job and execute the nativenamed process, shell or batch script
    flux.dispose();    // Release resources.
  } // constructor

   * A simple way to run this example.
  public static void main(String[] args) throws Exception {
    new ProcessRunAProcess ();
  } // main()

} // class ProcessRunAProcess 

The above code illustrates a simple sequential workflow. Through the Flux API one can create sophisticated workflows that initiate parallel flows, split and join on tasks, wait on events, and distribute work to remote agents or network nodes (via SSH commands) for processing. 

Flux can be embedded into applications as a Java jar file or run standalone to provide sophisticated workflow and workload automated facilities to Development software development staff, while facilitating Developmentdevelopment's delivery of a hardened and production ready application to the Operations staff.