Creating New User & Broadway Jobs

Jobs are defined in the Fabric Studio and can be saved to a project file and be deployed to the Fabric Server. A Job can be a Java function or a simple command.

How Do I Create a New User Job using Java code?

Step 1

Go to the Project Tree > Logical Units > LU > Java > src > com > k2view > src > cdbms> usercode> lu and right click New Java File to display the Java Editor window. Name the new file and click Save

Step 2

Write the User Job function

//writing into a file;

while (test<5 && !isAborted()){
    test=test+1;
    sleep(10000);
    inSecTime=test*10; // value returned by user job function
    FileWriter myWriter = new FileWriter("job_test4.txt",true);
    myWriter.write("Test Number: "+ test +"::->" + 10*test + " seconds have passed since ...");
    myWriter.close();
    }

How Do I Create a Broadway Job using the BroadwayJob Actor ?

The BroadwayJob actor provides the ability to trigger a Fabric Job that will in turn execute another Broadway flow once or multiple times depending upon the configuration of the job.

To use this capability, simply select the actor from the Add Actors To Stage menu in the Broadway Flow panel, as illustrated below:

The following parameters are to be filled in the properties tab:

  • Name: name of the flow to be triggered by this actor.
  • UID: unique ID for this job.

Note that both name and UID can either be chosen by the user, attributed automatically by Fabric, or parsed from a previous actor.

  • Schedule: the execution frequency of the job, which can be either one of the following:

    • Immediate
    • Interval
    • Date/Time
    • CRON schedule
  • Affinity: this sets which node/DC name IP address is to be used to run the Broadway job.

  • Params: This refers to the arguments that can be parsed to the Broadway flow. For example, multiple parameters can be parsed as a key/value object from an external link.

Please refer to this section in order to learn how to setup the schedule type and the affinity appropriately.

Previous

Creating New User & Broadway Jobs

Jobs are defined in the Fabric Studio and can be saved to a project file and be deployed to the Fabric Server. A Job can be a Java function or a simple command.

How Do I Create a New User Job using Java code?

Step 1

Go to the Project Tree > Logical Units > LU > Java > src > com > k2view > src > cdbms> usercode> lu and right click New Java File to display the Java Editor window. Name the new file and click Save

Step 2

Write the User Job function

//writing into a file;

while (test<5 && !isAborted()){
    test=test+1;
    sleep(10000);
    inSecTime=test*10; // value returned by user job function
    FileWriter myWriter = new FileWriter("job_test4.txt",true);
    myWriter.write("Test Number: "+ test +"::->" + 10*test + " seconds have passed since ...");
    myWriter.close();
    }

How Do I Create a Broadway Job using the BroadwayJob Actor ?

The BroadwayJob actor provides the ability to trigger a Fabric Job that will in turn execute another Broadway flow once or multiple times depending upon the configuration of the job.

To use this capability, simply select the actor from the Add Actors To Stage menu in the Broadway Flow panel, as illustrated below:

The following parameters are to be filled in the properties tab:

  • Name: name of the flow to be triggered by this actor.
  • UID: unique ID for this job.

Note that both name and UID can either be chosen by the user, attributed automatically by Fabric, or parsed from a previous actor.

  • Schedule: the execution frequency of the job, which can be either one of the following:

    • Immediate
    • Interval
    • Date/Time
    • CRON schedule
  • Affinity: this sets which node/DC name IP address is to be used to run the Broadway job.

  • Params: This refers to the arguments that can be parsed to the Broadway flow. For example, multiple parameters can be parsed as a key/value object from an external link.

Please refer to this section in order to learn how to setup the schedule type and the affinity appropriately.

Previous