Set Current Date Enterprise Integrator

Is there an easy way to set the current date for a date field within the enterprise integrator. Is there a way to assign a constant to a date field in order to have the current date/time entered into the field, or is this accomplished by creating a custom step (scripted operation or whatever you like) to create a field containing the current date.

I was hoping there was an easy solution, but I’m having my doubts!

Thanks in advance
Jason

Jason, depending on your needs, you can try either of these two options:

First, you can edit your component script and create a static variable for the current date. Then, within each of your component steps, you will be able to reference this variable as a constant. Note that when your component reaches the exit script, the object is destroyed. Therefore, each execution of your component will have its own date object.

The second option is to take any of your component’s input step Date objects and map them out to a variable. To get these Date objects, look inside of the _env folder in the Input Step folder within EI. This value will remain constant as your component executes and will be destroyed when your component completes.

The first option may be better for you because you can have complete control over the format of the Date object. The Date object in the Input Step folder is webMethods-generated and may not be suitable for your needs.

Here’s one way (in custom code). I needed a time-date stamp field.

BrokerDate bd = new BrokerDate();

GregorianCalendar gc = new GregorianCalendar();

bd.setJavaCalendar(gc);

out.CURRENT_DATETIME = bd;

access.println("CURRENT_DATETIME = " + bd.toString());

I’m outputting the field as a WM “date” object, from this custom code step. The above access.println comes out as follows:

CURRENT_DATETIME = 09/09/2002 10:28:12.430

HTH.

J.

For this task I create a scripted operation under Common Operations. It returns a broker date and it has one custom step with the following implementation

// get the current calendar Calendar cal = Calendar.getInstance();

// get a date object from calendar,
// use in constructor of broker date object
return new BrokerDate( cal.getTime() );

I tried to use the code but it says cannot find variable “access”.

Can somebody tell me “access” is object of which class??

Or do i need to import something??

Regards
Ashish

Are you really working with Enterprise Integrator? The access.println statement is just a debug statement. Comment it out and it will still work, but will not write to the console.

Mark

So you mean to say, that it is the same as System.out.println??
Can you tell me the basic use of access.println??
Does it write to console or some log??
Where can i find its documentation??

I have no idea what that line in a 4-year old code sample means. From the context, it appears to write to the console.

Once again, are you working with Enteprise Integrator or with some other tool?

Mark

I am working with webMethods 7.0

I am using System.out.println(); only.

Thanks for your concern. Purpose is solved now.
access.println was used in Wm4.6

So where does system.out.prinln() actually write to? Its not the server log

System.out

Typically, output is written to the console. Depending on how you’re running the JVM (e.g. command-line or as a Windows service), you may not have a viewable console.