I have a MySQL table called Product which has columns id, orderDate and received

I have a MySQL table called Product which has columns id, orderDate and receivedDate (plus others). OrderDate gets set within the main flow, which then needs to pause until the product has been received - ie receivedDate is not null.

The receivedDate gets set by a Related Action.

How can I get my main flow to detect that receivedDate has been set, and then continue?

I tried creating a rule called 'IsProductReceived' that contains a queryEntity to return true if the receivedDate is not null, otherwise returns false. This works as expected when I test it in isolation.

I put this rule into the expression of a Rule Event. When I execute the Rule Event, I get an error "ERROR:EVAL:@reason=index".

Am I attempting to do this in the right way and have some error in my rule, or am I using the wrong method to do this?

OriginalPostID-147702

OriginalPostID-147702

  Discussion posts and replies are publicly visible

Parents
  • @paule Hi, here goes my answers for your questions and please do let me know if you have any follow up questions:

    Am I attempting to do this in the right way and have some error in my rule, or am I using the wrong method to do this?:

    To the best of my knowledge, a rule event can be used to monitor global constants and process variables. Documentation at https://forum.appian.com/suite/help/7.9/Rule_Event.html under 'Configuring a Rule Event' says that 'With an expression, you can use a Rule Event to monitor global constants and process variables. Each time a global constant or process variable is changed, the rule is reevaluated.'


    How can I get my main flow to detect that receivedDate has been set, and then continue?:

    There are several ways of doing and one of them is as follows:

    Main flow:
    Step - 1: Create a boolean variable called 'isProductReceived' in the process and configure it to false initially. Use the same variable in the rule event and trigger the event only when the 'isProductReceived' is set to true. (Infact you could test for a null value on the Products.ReceivedDate variable itself instead of creating an boolean variable)
    Step - 2: Configure a receive message event in the process and configure it in such a way that the receive message event sets the isProductReceived to true, and queries the Product variable (in order to reflect the latest value of receivedDate) in the subsequent node.

    Related action:
    Step - 1: Upon completion of setting the receivedDate and the relavant database updates in the related action, configure a send message event and use it in sending the message to the main flow.
Reply
  • @paule Hi, here goes my answers for your questions and please do let me know if you have any follow up questions:

    Am I attempting to do this in the right way and have some error in my rule, or am I using the wrong method to do this?:

    To the best of my knowledge, a rule event can be used to monitor global constants and process variables. Documentation at https://forum.appian.com/suite/help/7.9/Rule_Event.html under 'Configuring a Rule Event' says that 'With an expression, you can use a Rule Event to monitor global constants and process variables. Each time a global constant or process variable is changed, the rule is reevaluated.'


    How can I get my main flow to detect that receivedDate has been set, and then continue?:

    There are several ways of doing and one of them is as follows:

    Main flow:
    Step - 1: Create a boolean variable called 'isProductReceived' in the process and configure it to false initially. Use the same variable in the rule event and trigger the event only when the 'isProductReceived' is set to true. (Infact you could test for a null value on the Products.ReceivedDate variable itself instead of creating an boolean variable)
    Step - 2: Configure a receive message event in the process and configure it in such a way that the receive message event sets the isProductReceived to true, and queries the Product variable (in order to reflect the latest value of receivedDate) in the subsequent node.

    Related action:
    Step - 1: Upon completion of setting the receivedDate and the relavant database updates in the related action, configure a send message event and use it in sending the message to the main flow.
Children
No Data