changing Parameters

FireholderFireholder Member Posts: 26 Contributor II
edited November 2018 in Help
Hi,
I'm trying  to modify my Parameters using Operator.setParameter(x,y), however I have encountered several problems.
When I change the values of some parameters and run the process, RM throws error, I suggest that change of some parameters prompt change in others. How can I know what is the bond between parameters?

br, Fire
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    there is no "if you change x it will change y". Some parameters depend on others, so y may be hidden while x is false, but in that case y would simply be ignored. You probably put an invalid value into them, like "hello" into a ParameterTypeInt (which of course only accepts integer values).

    Regards,
    Marco
  • FireholderFireholder Member Posts: 26 Contributor II
    Hi,
    I guess I misinterpreted my problem. What I really want to know is how are parameters of some operators interrelated.For instance, when I change parameter "send_mail" from "never" to "for_long_process" in operator Process (Root operator)  two other parameters,the "notification_email" and the "process_duration_for_mail", immediately appear.
    I have found something like parametertype.getDependency() but don't really understand how to use it,any suggestion?
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    I think you can try to ask every parameter of an operator via this code fragment if it should be shown everytime you change a parameter.
    I haven't done this myself before, so you will have to play around with this a bit.

    for (ParameterType type : operator.getParameterTypes()) {
          boolean showParam = true;
          for (ParameterCondition condition : type.getDependencyConditions()) {
                if(!condition.dependencyMet()) {
                        showParam = false;
                        break;
                }
                // your code
          }
    }
    Regards,
    Marco
Sign In or Register to comment.