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!
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.
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() );
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.
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??
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.