Skip to Content
avatar image
Former Member

workflow trigger using calculated value

My BO object type is Zobject. I have included a method and written a program in the workflow for calculating number of days. I have checked the same in the program. The values are perfectly appearring in the calculation method. I am not storing this in my ztable. Hence used a method for calculated.

Without storing , i want my workflow to trigger a mail based on the condition that if number of days is above 30.

How to achieve this. please help.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 17, 2010 at 11:46 AM

    Hi,

    start your workflow, do the calculate step, this will return the number of days when it has reached 30, then use that value in the requested start tab of a step.

    Kind regards, Rob Dielemans

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You can use a "container operation" to get the date you want the task triggered on. You can simply call the method/attribute in the container operation. Put the date into a local container variable. Then, in the task you want sent after x number of days, put the date in the "requested start" date field (which was calculated earlier in the container operation). If the date is already in a BOR attribute, you can use that variable directly in the "requested start" date field instead of using a container operation.

  • avatar image
    Former Member
    Sep 17, 2010 at 09:10 AM

    There are several ways to do that. When you reach the value 30, is the workflow already started (by some other events, to do something else) and you want it to send an email? Or you want to start a new workflow that sends the mail when the value is reached?

    Cheers,

    Patrick

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I see two solutions

      Either you write a program that will be scheduled periodically and raise an event to start the workflow when the value reaches 30

      Either you start the workflow at creation of your object, and you put a condition in your sendmail step so that the sendmail will remain in status "in preparation" until condition is reached (conditions are then checked by one of the standard wf jobs, cfr SWU3). Note that do this you cannot use the standard "sendmail" step because that one does not show the "conditions" tab. Rather use a normal step with SELFITEM.SENDTASKDESCRIPTION. It will behave eactly like a sendmail step.

      Cheers,

      Patrick

  • Sep 18, 2010 at 04:27 PM

    Hello,

    Number of wha days is 30? Number of days since the workflow started? SInce something was created?

    You have to think about: what action should start the workflow?

    I would lean towards Rob's suggestion, if it fits your scenario. Keep it simple.

    regards

    Rick Bakker

    Hanabi Technology

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 20, 2010 at 06:48 AM

    Hi PS,

    several ways to achieve your requirement.

    Do you want to send just a mail to the user, which has some text/workitem?

    This could be acheieved in 2 ways

    a) Since you have created a Zmethod to calculate the days, add a code where you check if crossed 30 days,

    If yes, use FM SO_NEW_DOCUMENT_SEND_API1 which can send text mail to the person you want.

    b) Since you have created Zmethod...store that days in a container (Using macros like SWC_SET_ELEMENT), once thru binding pass this container value to your WF container. Once this WF container is filled with this value, you can use a Condition Step in your WF definition which would check for this value, if > 30 add a Send Mail Step after this Step in your WF definition.

    Hope it helps.

    Aditya

    Edited by: Aditya Varrier on Sep 20, 2010 12:18 PM

    Add comment
    10|10000 characters needed characters exceeded