You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by "Kravtsov, Eugene" <EK...@luxoft.com> on 2013/03/13 15:44:52 UTC

Parameterized year, month and day for workflow

Hi everyone,

I'm trying to do FS action (in Oozie workflow) like:

<mkdir path='/my/application/folder/${YEAR}/${MONTH}/${DAY}/data'/>

Where ${YEAR}, ${MONTH}, ${DAY} current year, month number and day in month.
Could you please pont me how to do this in a right way?
Are there any EL expressions suitable for that?


Thank you,
  Eugene.

PS:
Sorry if asking already answered question - I was not able to find answer yet.


________________________________
This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

Re: Parameterized year, month and day for workflow

Posted by Mona Chitnis <ch...@yahoo-inc.com>.
Hi Eugene,

Your workflow will be able to get such parametrized values only if it is
started by an Oozie 'coordinator'. Then the values are resolved based on
the coordinator's frequency.

Refer docs:
http://oozie.apache.org/docs/3.3.1/CoordinatorFunctionalSpec.html#a6.8._Par
ameterization_of_Coordinator_Application


You will need to pass from your coordinator's <action> tag some
<configuration> properties like the following:
<configuration>
            <property>
              <name>mytime</name>
              <value>${coord:formatTime(coord:nominalTime(),
'yyyy-MM-dd')}</value>
            </property>
         </configuration>


By specifying a date format of your choice, you will have the fields -
year, month and day available to you as string ${myTime}.

--
Mona

On 3/13/13 7:44 AM, "Kravtsov, Eugene" <EK...@luxoft.com> wrote:

>Hi everyone,
>
>I'm trying to do FS action (in Oozie workflow) like:
>
><mkdir path='/my/application/folder/${YEAR}/${MONTH}/${DAY}/data'/>
>
>Where ${YEAR}, ${MONTH}, ${DAY} current year, month number and day in
>month.
>Could you please pont me how to do this in a right way?
>Are there any EL expressions suitable for that?
>
>
>Thank you,
>  Eugene.
>
>PS:
>Sorry if asking already answered question - I was not able to find answer
>yet.
>
>
>________________________________
>This e-mail and any attachment(s) are intended only for the recipient(s)
>named above and others who have been specifically authorized to receive
>them. They may contain confidential information. If you are not the
>intended recipient, please do not read this email or its attachment(s).
>Furthermore, you are hereby notified that any dissemination, distribution
>or copying of this e-mail and any attachment(s) is strictly prohibited.
>If you have received this e-mail in error, please immediately notify the
>sender by replying to this e-mail and then delete this e-mail and any
>attachment(s) or copies thereof from your system. Thank you.