Hello, I need to use Data's Java to insert a value into a variable, but when I use the "executeDataActions" method, if I save or make changes elsewhere, it deletes what I did and "remounts" the object without my code. Does anyone know which method I can use so that Orchestration Design does not delete my Java code from Data?
com.avaya.sce.runtime.Data
Collapse
X
-
If you add your own code to a Servlet node, you should overwrite: public void servletImplementation(SCESession mySession) The code generator will never touch that method. For other nodes, you can also add your own code if you override: public void requestBegin(SCESession mySession) If you add your own code to constructors or you add variables to the class, then you should put your code OUTSIDE of the tags: //{{START:CLASS: //}}END:CLASS: These tags are used by the code generator and it will overwrite any content in there. If you put your own code before/after these tags, then your code will be preserved.
-
-
Nice! Thanks for your suggestion!
But I need a method that is executed after the public boolean executeDataActions(com.avaya.sce.runtimecommon.SCE Session mySession) throws Exception {
So that it doesn't overwrite my variable! What I want to ensure is that the variable is saved with the correct value, since I am working in blocks!
Comment
-
-
I asked that question of Avaya Ada (Avaya's generative AI chatbot) - I don't have experience with Orchestration Design, so I don't know if the answer is right - I'll let you decide. Here's what Ada said - hope this helps:
In Avaya Orchestration Designer, when you need to ensure that a variable retains its value after the `executeDataActions` method is called, you should consider using the `public void requestEnd(SCESession mySession)` method. This method is called after `executeDataActions` and can be used to set or modify session variables before the response is sent back to the caller or before transitioning to the next element in the call flow.
Here's an example of how you might use `requestEnd`:
```java
public void requestEnd(SCESession mySession) {
// Your code here to set or modify variables
// For example, to set a variable:
mySession.getVariableField(IProjectVariables.MY_VA RIABLE).setValue("My Value");
}
```
By placing your code in the `requestEnd` method, you can ensure that your variable modifications are preserved after `executeDataActions` has been executed. Remember to place your custom code outside of the generated code markers (`//{{START:CLASS:... //}}END:CLASS:`) to prevent it from being overwritten by the code generator.
Please refer to the Avaya Aura® Orchestration Designer Developer's Guide for more detailed information on working with session variables and customizing the behavior of your application.Russ Brookes | Avaya, KCS Leader | +1 613.771.7590 | [email protected] | NA Eastern Time Zone
Comment
-
Comment