<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">The usual (and only reasonable way) to
      "set" a variable in the LHS is to bind it to a Drools variable, <br>
      including things like:<br>
      <br>
      ...<br>
      $x : String() from /* expression here */<br>
      ...<br>
      <br>
      any usage of the "=" operator is generally suspicious.. <br>
      but I'm not sure I have understood your use case completely.. :)<br>
      <br>
      <br>
      <br>
      On 06/04/2013 05:59 PM, Stephen Masters wrote:<br>
    </div>
    <blockquote cite="mid:15BB52DC-E304-483F-9BA5-274897C59B8F@me.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <div>Thanks for the cheat idea Mike.&nbsp;I wasn't really expecting any
        help from the tooling itself. Just hoping that there might be
        some trickery within the DSL that I could try, to generate some
        code which would set up a variable for me.</div>
      <div><br>
      </div>
      <div>Unfortunately I do need to combine LHS sentences and multiple
        RHS sentences, so your idea isn't really an option in this case.
        :(</div>
      <div><br>
      </div>
      <div>As it is I have created a little enumeration in the RHS
        sentence, and it's not looking too bad. At least, with some
        selective wording, it doesn't look completely redundant!</div>
      <div><br>
      </div>
      <div>Steve</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <br>
      <div>
        <div>On 4 Jun 2013, at 16:33, Michael Anstis &lt;<a
            moz-do-not-send="true"
            href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;
          wrote:</div>
        <br class="Apple-interchange-newline">
        <blockquote type="cite">
          <div dir="ltr">
            <div>
              <div>
                <div>This would need to be provided by the tooling; I
                  don't think it's something that's even remotely
                  possible at runtime (unless you stored the field name
                  in a Fact and used reflection on the RHS).<br>
                  <br>
                </div>
                That said (and you're going to guess my next comment)
                this is not provided in the guided editors. Depending on
                how complex your DSLs are and whether users need to
                combine DSL Sentences; IDK if a "cheat" works:<br>
                <br>
              </div>
              [when]Do something with {field} and {value}=$f :
              Fact({field}=={value} then $f.{field} = {value}<br>
              <br>
            </div>
            I've not tried it; nor know whether it fits your
            requirements.. but a hack worth trying?<br>
          </div>
          <div class="gmail_extra"><br>
            <br>
            <div class="gmail_quote">On 3 June 2013 17:40,
              stephen.masters <span dir="ltr">&lt;<a
                  moz-do-not-send="true"
                  href="mailto:stephen.masters@me.com" target="_blank">stephen.masters@me.com</a>&gt;</span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div>
                  <div>Hi folks,</div>
                  <div><br>
                  </div>
                  <div>Is there a decent way to set a value in the LHS
                    of a rule so that it's available in the RHS?</div>
                  <div><br>
                  </div>
                  <div>Reason being I have a DSL driving the guided
                    rules editor which will pluck out the value of a
                    field, where the name of that field is driven by a
                    drop down menu enumeration.</div>
                  <div><br>
                  </div>
                  <div>A change I now have would be a lot easier if I
                    could assign a string to a variable in the LHS,
                    which could be read by the RHS. Otherwise I might
                    need to extend the RHS DSLs to include the same
                    enumeration as the LHS. Which looks a bit redundant
                    for a business user wondering why the need to write
                    the same thing twice.</div>
                  <div><br>
                  </div>
                  <div>Any thoughts?</div>
                  <div><br>
                  </div>
                  <div>Steve</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div>
                    <div style="font-size:75%;color:#575757">Sent from
                      Samsung Mobile</div>
                  </div>
                </div>
                <br>
                _______________________________________________<br>
                rules-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
                <a moz-do-not-send="true"
                  href="https://lists.jboss.org/mailman/listinfo/rules-users"
                  target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
              </blockquote>
            </div>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>