E9.2 Using Dates In Orchestrator Studio

ConfigRig

ConfigRig

Member
Hello all,

PSA: I'm not SUPER techy so please be patient with me.
I've been requested to create an orchestration during sales order entry that utilizes a RULE based on item flash message, branch/plant, and the requested date fields.

Customer Request:
If the item used within the sales order has an item flash message of "LT" (lead time required), the requested date is <= today + 14 days, and is in branch/plant 10 then the orchestration will send out a message informing the user to adjust the order's requested date based on lead time requirements for that particular item. We would like the user to be alerted immediately during the order entry process as opposed to being alerted after the sales order is submitted.

Current Orchestration Setup:

ORCH.PNG
Input:
INPUT.PNG

Rule:
RULE.PNG
Data Request:

DR.PNG


Current Issue:
I thought the date parameter of "Request Date <= Today Plus 14 Days" in the data request (above) would be enough to get the orchestration to utilize the requested date field properly and return a status of success during testing but unfortunately that's not the case. So I've attempted to add the date parameter of "RequestedDate <= dateToday" (below)
1675960557844.png
within the rule but have had no success. When inputting the date parameter into the rule the orchestration just keeps returning a status of fail during testing.

Question 1.) Is there a way, without using groovy script, to add a complex date rule like "today plus 14 days" within the rule?
Question 2.) Are there specific ways/formats/types you must use in order to use a date in a rule successfully?
Question 3.) How can I get this orchestration to utilize my complex rule and work properly?
Question 4.) Do you think there is a better way to alert the user during sales order entry of the lead time violation other than this orchestration?

Once I get this orchestration to work properly then I can use a form extension with in the sales order detail revisions application to implement this orchestration/alert.
Any information you all can give will be much appreciated! I am very interested in learning how to properly use different date parameters in rules/orchestrations.
Also, feel free to give out suggestions even if they steer me away from using this orchestration.
Hopefully this was generally straight forward and not confusing.

Thank you!
 
Question 1.) Is there a way, without using groovy script, to add a complex date rule like "today plus 14 days" within the rule?
Question 2.) Are there specific ways/formats/types you must use in order to use a date in a rule successfully?
Question 3.) How can I get this orchestration to utilize my complex rule and work properly?
Question 4.) Do you think there is a better way to alert the user during sales order entry of the lead time violation other than this orchestration?
1) Not in my experience. I think that if you're on 9.2.5.2 you're restricted to doing Date calcs using scripting. I have a date formatter/offset groovy script you're welcome to, as I'll be distributing it at conference this year anyway

2) Change the datatype of the date part of the rule to "Date", on the far left column. Use the output of the date offset groovy as input to the rule

3) You will need to test your orch with simulated values that you'd be getting via form extension later on. You could try just hooking it up now and seeing how the values come in-- it might be better/quicker

4) I'm (and you too if your sig is correct) on a version without logic extensions; so I think I'd recommend that you trigger an exception within your orchestration if your requirements aren't satisfied to continue on the form. Then on your form extension you tell it to disable form on orch error. It's a bit kludgey without some customization work on the form itself.

Triggering exception to fail an orch is much easier than I'd have thought. Another groovy script, where you can specify the exception message in the orch component input:
Code:
import com.oracle.e1.common.OrchestrationAttributes;
HashMap<String, Object> main(OrchestrationAttributes orchAttr, HashMap inputMap)
{
  HashMap<String, Object> returnMap = new HashMap<String, Object>();

    def exceptionMessage = (String)inputMap.get("exceptionMessage");
    throw new Exception(exceptionMessage);

    return returnMap;
}
 

Attachments

  • HC_CRGR_RtnDatePart_R1.zip
    1.3 KB · Views: 60
Back
Top