Evaluated Expression

Having successfully used .txt files to store queries an then run using Evaluated Expression it seems to fall over when it comes to merging.  I am faced with the following error
Formula.Firewall: Query 'Merge2' (step 'EvaluatedExpression') is referencing Query 'Section1!#"ncs gl_accounts"#EvaluatedExpression', which was not part of its formula text.
The data is stored in a MySQL environment.  I am advised that the same does not occur in a SQL Server environment.
PQ code and .txt file contents replicated below
Merge2 PQ
let
    //Load M code from text file
    Source = Text.FromBinary(File.Contents("O:\Finance - Reporting\Common Data\Power Queries\Merge2.txt")),
    //Evaluate the code from the file as an M expression
    EvaluatedExpression = Expression.Evaluate(Source, #shared)   
in
    EvaluatedExpression
merge2.txt
let
    Source = Table.NestedJoin(#"ncs gl_accounts",{"gl_unique_id"},#"ncs gl_matches",{"gl_unique_id"},"NewColumn"),
    #"Expand NewColumn" = Table.ExpandTableColumn(Source, "NewColumn", {"id", "version", "gl_id", "gl_unique_id", "hpc", "hpc_name", "hpc_m", "level4",
"level4_name", "level4_m", "level3", "level3_name", "level3_m", "level2", "level2_name", "level2_m", "level1", "level1_name", "level1_m", "location",
"location_name", "location_m", "manager", "manager_name", "manager_m", "division", "division_name", "division_m", "overview", "overview_name", "overview_m",
"code", "code_name", "code_m", "summary", "summary_name", "summary_m", "grouping", "grouping_name", "grouping_m", "alt", "alt_name", "alt_m",
"type", "type_name", "type_m", "standard", "standard_name", "standard_m", "intext", "intext_name", "intext_m", "funding", "funding_name", "funding_m",
"cash", "cash_name", "cash_m", "project", "project_name"}, {"NewColumn.id", "NewColumn.version", "NewColumn.gl_id", "NewColumn.gl_unique_id", "NewColumn.hpc",
"NewColumn.hpc_name", "NewColumn.hpc_m", "NewColumn.level4", "NewColumn.level4_name", "NewColumn.level4_m", "NewColumn.level3", "NewColumn.level3_name", "NewColumn.level3_m", "NewColumn.level2",
"NewColumn.level2_name", "NewColumn.level2_m", "NewColumn.level1", "NewColumn.level1_name", "NewColumn.level1_m", "NewColumn.location", "NewColumn.location_name", "NewColumn.location_m",
"NewColumn.manager", "NewColumn.manager_name", "NewColumn.manager_m", "NewColumn.division", "NewColumn.division_name", "NewColumn.division_m", "NewColumn.overview", "NewColumn.overview_name",
"NewColumn.overview_m", "NewColumn.code", "NewColumn.code_name", "NewColumn.code_m", "NewColumn.summary", "NewColumn.summary_name", "NewColumn.summary_m", "NewColumn.grouping",
"NewColumn.grouping_name", "NewColumn.grouping_m", "NewColumn.alt", "NewColumn.alt_name", "NewColumn.alt_m", "NewColumn.type", "NewColumn.type_name", "NewColumn.type_m", "NewColumn.standard",
"NewColumn.standard_name", "NewColumn.standard_m", "NewColumn.intext", "NewColumn.intext_name", "NewColumn.intext_m", "NewColumn.funding", "NewColumn.funding_name", "NewColumn.funding_m",
"NewColumn.cash", "NewColumn.cash_name", "NewColumn.cash_m", "NewColumn.project", "NewColumn.project_name"})
in
    #"Expand NewColumn"

The methodology used was:
Created 2x .txt files 
1.     ncs gl_accounts.txt
     let
         Source = MySQL.Database("kdc-linux", "ncs"),
         ncs_gl_accounts = Source{[Schema="ncs",Item="gl_accounts"]}[Data]
     in
         ncs_gl_accounts
2.     ncs gl_matches.txt
     let
         Source = MySQL.Database("kdc-linux", "ncs"),
         ncs_gl_matches = Source{[Schema="ncs",Item="gl_matches"]}[Data]
     in
    ncs_gl_matches
Created 2x Power Queries
1.     ncs gl_accounts
let
    //Load M code from text file
    Source = Text.FromBinary(File.Contents("O:\Finance - Reporting\Common Data\Power Queries\ncs gl_accounts.txt")),
    //Evaluate the code from the file as an M expression
    EvaluatedExpression = Expression.Evaluate(Source, #shared)   
in
    EvaluatedExpression
2.     ncs gl_matches
let
    //Load M code from text file
    Source = Text.FromBinary(File.Contents("O:\Finance - Reporting\Common Data\Power Queries\ncs gl_matches.txt")),
    //Evaluate the code from the file as an M expression
    EvaluatedExpression = Expression.Evaluate(Source, #shared)   
in
    EvaluatedExpression
BOTH PQ CORRECTLY RETURN THE RECORDSET
Created further Power Query (merge1 using PQ builder) to merge the above
let
    Source = Table.NestedJoin(#"ncs gl_accounts",{"gl_unique_id"},#"ncs gl_matches",{"gl_unique_id"},"NewColumn"),
    #"Expand NewColumn" = Table.ExpandTableColumn(Source, "NewColumn", {"id", "version", "gl_id", "gl_unique_id", "hpc", "hpc_name", "hpc_m", "level4", "level4_name", "level4_m", "level3", "level3_name", "level3_m", "level2", "level2_name", "level2_m",
"level1", "level1_name", "level1_m", "location", "location_name", "location_m", "manager", "manager_name", "manager_m", "division", "division_name", "division_m", "overview", "overview_name", "overview_m", "code", "code_name", "code_m", "summary", "summary_name",
"summary_m", "grouping", "grouping_name", "grouping_m", "alt", "alt_name", "alt_m", "type", "type_name", "type_m", "standard", "standard_name", "standard_m", "intext", "intext_name", "intext_m", "funding", "funding_name", "funding_m", "cash", "cash_name",
"cash_m", "project", "project_name"}, {"id", "version", "gl_id2", "gl_unique_id2", "hpc", "hpc_name", "hpc_m", "level4", "level4_name", "level4_m", "level3", "level3_name", "level3_m", "level2", "level2_name", "level2_m", "level1", "level1_name", "level1_m",
"location2", "location_name", "location_m", "manager", "manager_name", "manager_m", "division2", "division_name", "division_m", "overview", "overview_name", "overview_m", "code", "code_name", "code_m", "summary", "summary_name", "summary_m", "grouping", "grouping_name",
"grouping_m", "alt", "alt_name", "alt_m", "type", "type_name", "type_m", "standard", "standard_name", "standard_m", "intext", "intext_name", "intext_m", "funding", "funding_name", "funding_m", "cash", "cash_name", "cash_m", "project", "project_name"})
in
    #"Expand NewColumn"
(NOTE THIS CORRECTLY RETURNS THE RECORDSET)
Copied the query from the advanced editor and pasted into merge2.txt
Created Power Query merge2
let
    //Load M code from text file
    Source = Text.FromBinary(File.Contents("O:\Finance - Reporting\Common Data\Power Queries\Merge2.txt")),
    //Evaluate the code from the file as an M expression
    EvaluatedExpression = Expression.Evaluate(Source, #shared)   
in
    EvaluatedExpression
PQ errors with firewall message as described previously.

Similar Messages

  • Custom Tag not evaluating expression in attribute

    I have a custom tag that needs to take dynamic values in the attributes, but I can't seem to get the values "interpreted" correctly. I have the <rtexprvalue> tag set to "true" in my .tld file, which I thought was the only thing that was needed in order to accomplish what I am trying to do. However, that does not seem to be the case.
    I am using WebLogic (8.1.4) and their <netui> tags, along with JSTL tags (1.0).
    An example of what my code looks like is the following:
    <test:myTag id="1" idx="<netui:content value='{container.index}' />">
        <netui:select ... />
    </test:myTag>and
    <c:set var="myIdx" value="<netui:content value='{container.index}' />" />
    <test:myTag id="1" idx="<c:out value='${myIdx}' />">
        <netui:select ... />
    </test:myTag>Neither of the above approaches has worked. In my code for my Tag.java file, I get the literal string values of <netui:content value='{container.index}' /> and <c:out value='${myIdx}' />, respectively, in my idx property.
    Can someone give me any hints as to what I may be doing wrong?
    Thanks.

    Shouldnt that be
    <netui:content value='${container.index}' />Actually, weblogic does not use the '$' prefix before
    their expressions. Fine. Which in turn means weblogic has some custom expression evaluator.
    Note weblogic 8.1
    as a container doesnt implicitly supportexpressions
    and you have to build in that feature into yourtag
    library.Are you referring to the 'isELIgnored' attribute when
    you mentioned the above statement? If not, can you
    explain what you meant by "build that feature into
    your tag library"?
    It's like this - expression language is supported by default in all containers that implement the j2ee 1.4 spec (servlet 2.4/jsp 2.0). Additionally you should also declare your web application to adhere to the 2.4 standards (through the schema definition in web.xml). In applications that refer to the 2.3 dtd but are run on a 2.4 compliant container you can set the 'isELIgnored' attribute to false and use EL. This works because your container anyways supports it.
    If your container doesnt provide support for EL (outside the jstl tags) as is the case with weblogic 8.1, then you can still use expressions by using something like the [url http://jakarta.apache.org/commons/el/]apache common evaluator  package. The difference being that you will have to call the evaluator classes to evaluate the attribute.
    Are there any alternatives that I could use to
    accomplish what I am trying to do?Did the above answer your question?
    ram.

  • Evaluating expression

    Hey there guys!!! i just have a simple problem, but this may be hard to find in java. Do java have an eval method where in it can evaluate expression like the one in JavaScript Math.eval("3+2*12"), for example?
    Or does anyone has a better (shorter and complete) way of implementing such method? thanks a lot!!! hope you can help me with that one guys. :-) thanks again and have a nice computing time! :-)

    You can try JFormula :
    http://www.japisoft.com/formula/
    Here the features :
    * Decimal, string, boolean operators (or, and, not, xor...)
    * Unicode
    * Boolean expression support : (A<B)&&(B>C), (A or B) and not ( C equals D )
    * String expression support : "abc" != "cba"
    * IF THEN ELSE expression
    * Short expression format : 2x+3y
    * Variable : A=(cos(PI + x )*2) + [y-x]^2
    * Multiple lines expression : A = 1 B = A + 1 ...
    * High precision mode
    * Functions with decimal, boolean or string arguments
    * Evaluation tree produced by a pluggable parsing system
    * Evaluation optimization for symbol value changes
    * Standard library with 24 mathematical functions
    * Delegate for resolving unknown functions or symbols
    * Extend or add a new library dynamically
    * Share multiple formula context
    * Override any functions from the current library by your one
    * Support for multithreaded computing
    * Many samples (library extension, graphes) for API interesting parts
    * JDK 1.1 compliant (tested on JDK1.1.8 and JDK1.4.2)
    Best regards,
    A.Brillant

  • Tags not evaluating expression

    When the jsp executes with a single expression in the defaultValues attribute, it evaluates fine.
    eg>
    <ft:phone namePrefix="representative" defaultValues="<%=appeal.getRepresentative_area_code()%>"/>
    // area code is set to 111
    produces
    <input size="3" type="text" maxlength="3" name="representative_area_code" value="111">
    <input size="3" type="text" maxlength="3" name="representative_phone_prefix" value="">
    <input size="4" type="text" maxlength="4" name="representative_phone_suffix" value="">
    which is the expected response, Yet when I do
    <ft:phone namePrefix="representative" defaultValues="<%=appeal.getRepresentative_area_code()%>;555"/>
    I get
    <input size="3" type="text" maxlength="3" name="representative_area_code" value="<%=appeal.getRepresentative_area_code()%>">
    <input size="3" type="text" maxlength="3" name="representative_phone_prefix" value="555">
    <input size="4" type="text" maxlength="4" name="representative_phone_suffix" value="">
    like it doesn't evaluate the embedded expression.
    Also is there a better way to pass in the default values then using a semi colon delimited list. Perhaps pass in a hashmap with attributes set?
    Here is the tld file:
    // tld begin
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>formtags</shortname>
    <info>WCB Tags for Forms</info>
    <tag>
    <name>phone</name>
    <tagclass>wcb.common.jsptags.PhoneTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>This tag puts 3 input boxes for phone numbers.</info>
    <attribute>
    <name>namePrefix</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>defaultValues</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    //end tld
    //tag definition PhoneTag.java
    package wcb.common.jsptags;
    * This tag will output three input text fields that are used to input phone numbers.
    * Creation date: (08/20/2002 2:05:00 PM)
    * @author: Travis Leippi, WCB
    * Changes:
    * Author                    Date               Change
    * Travis Leippi          2002-08-20          Initial revision
    import java.util.StringTokenizer;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.tagext.TagSupport;
    public class PhoneTag extends TagSupport {
         private class PhoneField {
              String strField = null;
              int intSize;
              String strValue = null;
              public PhoneField(String argField, int argFieldSize) {
                   strField = argField;
                   intSize = argFieldSize;
                   strValue = new String();
              public PhoneField(String argField, int argFieldSize, String argValue) {
                   strField = argField;
                   intSize = argFieldSize;
                   strValue = argValue;
         private String strNamePrefix = null;
         private String strDefaultValues = null;
         private PhoneField[] objFields =
              { new PhoneField("area_code", 3), new PhoneField("phone_prefix", 3), new PhoneField("phone_suffix", 4)};
         * doStartTag is called by the JSP container when the tag is encountered
         public int doStartTag() {
              try {
                   JspWriter out = pageContext.getOut();
                   // Iterate through the elements of strFields
                   // printing out a textbox for each
                   if (strDefaultValues != null) {
                        setupFieldValues();
                   for (int i = 0; i < objFields.length; i++) {
                        out.print("<input size=\"");
                        out.print(objFields.intSize);
                        out.print("\" type=\"text\" maxlength=\"");
                        out.print(objFields[i].intSize);
                        out.print("\" name=\"");
                        if (strNamePrefix != null) {
                             out.print(strNamePrefix);
                        out.print(objFields[i].strField + "\" value=\"");
                        if (objFields[i].strValue != null) {
                             out.print(objFields[i].strValue);
                        out.print("\">");
                        out.println();
              } catch (Exception ex) {
                   throw new Error("All is not well in the world.");
              // Must return SKIP_BODY because we are not supporting a body for this
              // tag.
              return SKIP_BODY;
         * doEndTag is called by the JSP container when the tag is closed
         public int doEndTag() throws JspTagException {
              return SKIP_BODY;
         * Gets the strNamePrefix
         * @return Returns a String
         public String getNamePrefix() {
              return strNamePrefix;
         * Sets the strNamePrefix
         * @param strNamePrefix The strNamePrefix to set
         public void setNamePrefix(String strNamePrefix) {
              this.strNamePrefix = strNamePrefix + "_";
         * Gets the strValues
         * @return Returns a String
         public String getDefaultValues() {
              return strDefaultValues;
         * Sets the strValues
         * @param strValues The strValues to set
         public void setDefaultValues(String strDefaultValues) {
              this.strDefaultValues = strDefaultValues;
         private void setupFieldValues() {
              StringTokenizer st = new StringTokenizer(strDefaultValues, ";");
              for (int i = 0; i < objFields.length && st.hasMoreTokens(); i++) {
                   objFields[i].strValue = st.nextToken();
    // end java

    The expression needs to be a legal java expression that evaluates to a string. Try:
    <ft:phone namePrefix="representative" defaultValues='<%=appeal.getRepresentative_area_code() + ";555"'%>/>If that doesn't work, go with
    <%String st = appeal.getRepresentative_area_code() + ";555";%>
    <ft:phone namePrefix="representative" defaultValues="<%=st%>/>

  • Evaluating expression functions in oracle

    i am displaying a column on a jsp page but i want to show it in different colours in such a way that if it is between 0-80 then yellow and 81-100 green and 100 equal to red. so is there ne function in oracle that checks this column's value in the select query and then display it in the appropriate colour?please tell me it is urgent

    Actually I think what they want is smomething like this:
    select col2, case when col2 between 0 and 80 then 'GREEN'
                      when col2 between 81 and 100 then 'AMBER'
                      when col2 > 100 then 'RED'
                      else 'WHITE HOT!' end AS colour
    from de1Cheers, APC

  • Please help ... evaluating jsp:expression in attributes

    Dear All,
    I have searched the forum and found a few posts expressing a similar problem. However none seemed to divulge any solution.
    <option value="<jsp:expression> signals[count] </jsp:expression>"><jsp:expression> signals[count] </jsp:expression></option>In the code above the second expression evaluates fine but the first causes problems. Its the angle brackets of the jsp:expression:
    The value of attribute "value" must not contain the '<' characterI have also tried <%= %> and %= % as has been suggested in previous posts
    <%= => fails also because of the angle brackets
    %= % is set to the value, instead of the evaluated expression.
    Am Completely Stumped. Surely there must be a way to do this!?!
    Thanks is advance

    Hi Steve, thanks for your help I have resolved the problem. Somewhere in the J2EE Tutorial I found a snippet of code that talked about using CDATA tags.
    My working code now looks like this:
    <td><select name="signal_list" multiple="multiple">
        <jsp:useBean id="signalslist" class="acreweb.SignalsList" scope="session" />
            <jsp:scriptlet>
                int count = 0;
                System.out.println("useBean");
                String[] signals = signalslist.getSignals();
                while(count < signals.length)
         //Display signal names in select box
         System.out.println(signals[count]);
         </jsp:scriptlet>
              <![CDATA[<option value=']]><jsp:expression>new String(signals[count])</jsp:expression><![CDATA[' />]]><jsp:expression> signals[count] </jsp:expression>
         <jsp:scriptlet>     
         count++;
               </jsp:scriptlet>
        </select>
    </td>Sorry about formatting am being dragged to the pub, impatient work colleagues

  • JSP ${} expressions in JSF tag attributes

    Does anyone know why the expert group decided not to allow ${} style expressions within JSF tag attributes? I understand that a different syntax is needed to implement the 'late binding' #{} expressions used to link input controls to form beans, but not why the JSF tags actually prevent the use of immediately evaluated ${} expressions for accessing variables in the page scope in JSP 2.0.
    I know there has been a lot of discussion about this and other threads mention a security loophole that would be opened up by allowing expressions like #{blah.${someProperty}}, but I'm not sure why this sort of thing would cause a problem. Is there any way to enable this behaviour, such as editing the JSF tag library descriptors to allow runtime expressions (horrible though that sounds)? Or perhaps another JSF implementation that supports both immediately evaluated and late-binding expressions? It seems a rather unnecessary restriction that is going to cause much confusion and mistyping for all...
    Thanks in advance,
    Keith.

    Thanks Adam, I see the problem now. It's a fairly obscure loophole but serious nonetheless. Of course, this problem could also be avoided by not using request parameters within JSF tags as it doesn't affect the majority of legitimate uses for expressions.
    I have to disagree with you about mixing ${} and #{} expressions though. The majority of developers will be used to writing ${} expressions in JSTL and JSP text and so will expect them to do work the same in JSF tags. Judging by the number of posts in this forum about being unable to use page scope variables in JSF tags this issue is already confusing a lot of people.
    As a rule of thumb, "use ${} for expressions that are output to the page and #{} for binding controls to backing beans and invoking methods" (which perform clearly distinct functions) is a lot simpler and easier to learn IMHO than the current one, which is "use ${} for expressions that are output to the page except within a JSF tag, where you use #{} for the same thing and also to update form values and invoke action methods"! (OK, I'm exaggerating a little for effect, but you get the point... :-)
    I agree that mixing both types of expression in the same attribute might be a little confusing, but this is an unlikely edge case that should probably be prevented in value binding or action attributes anyway. It's more of an issue for label values where mistyping one for the other is already very common and, although not especially difficult to debug, is just another pitfall awaiting the unwary JSP developer. I'm not sure that JSP expressions would be much more difficult to debug anyway as the value and method bindings will simply not work, which is pretty obvious as soon as you try and test the thing.
    Is this something that the EG would be prepared to reconsider for the next release of JSF, or perhaps getting the security loophole addressed in the next JSP spec? In the meantime, is there any reason that developers shouldn't enable runtime expressions in the TLD file provided that they're willing to live with the consequences?
    (Sorry to harp on about it, but I've already had several complaints about this after recommending JavaServer Faces for a major development project at ingenta.com.)
    Many thanks,
    Keith.

  • Nested Expressions

    The following works gives me no errors, and the page comes up, but the modelReference is always binded to index 0:
    <c:forEach items="${model.jobList}" varStatus="status" >
    <c:out value="${status.index}" />
    <h:input_text id="Job" modelReference="model.jobList[0].name" converter="text">
    <g:validate_required/>
    </h:input_text><br>
    </c:forEach>
    I have tried the following:
    <c:forEach items="${model.jobList}" varStatus="status" >
    <c:out value="${pageScope.status.index}" />
    <h:input_text id="Job" modelReference="model.jobList[${status.index}].name" converter="text">
    <g:validate_required/>
    </h:input_text><br>
    </c:forEach>
    I know that I have to be able to embed the index as part of the
    binded name. I had no problem doing this with the Struts-el tags.
    I keep getting the old reliable:
    ModelReference expression '{0}' is illegal in this context
    Any ideas about what might be wrong?

    I have found this to be clearly a bug, but in the default
    faces context, since all custom tags make calls to the faces
    context getModelValue() method. This method is not handling
    the nested expression, as from the JSTL <c:foreach tag.
    The good news is that it is an easy fix. JSF is very configurable. I was able to fix this problem by creating my own FacesContextFactory and FacesContext. My FacesContext implementation simply extends the default implementation provided by sun. I simply override the getModelValue() method, evaluate the nested expression correctly, then call the parent getModelValue().
    Here is my simple FacesContextFactory==========================>
    package com.geac;
    import javax.faces.lifecycle.*;
    public class FacesContextFactoryImpl
         extends javax.faces.context.FacesContextFactory {
         public FacesContextFactoryImpl() {
         public javax.faces.context.FacesContext getFacesContext(
              javax.servlet.ServletContext context,
              javax.servlet.ServletRequest request,
              javax.servlet.ServletResponse response,
              Lifecycle lifecycle) {
              System.out.println("$$$$$com.geac.FacesContextFactory.getFacesContext");
              System.out.println("Call the new constructure...");
              com.geac.FacesContextImpl facesContext =
                   new FacesContextImpl(context, request, response, lifecycle);
              return facesContext;
    Here is my FacesContext=================>
    package com.geac;
    import javax.servlet.*;
    import javax.faces.lifecycle.*;
    public class FacesContextImpl extends com.sun.faces.context.FacesContextImpl {
         public FacesContextImpl(
              ServletContext sc,
              ServletRequest request,
              ServletResponse response,
              Lifecycle lifecycle) {
              super(sc, request, response, lifecycle);
         public java.lang.Object getModelValue(java.lang.String modelReference) {
              System.out.println(
    "@@@@@FacesContext.getModelValue[" + modelReference + "]");
    // Evaluate the complete expression here utilizing
    // standard JSTL API
    // Pass the already evaluated expression into the
    // parent API
              return super.getModelValue(modelReference);
    That's all there is to it. This allows the model reference for all
    provided custom tags to fully support the JSTL 1.0 standard like
    the JSR-127 requires.
    The JSTL <c:foreach tag can work seamlessly with the JSF EA3 release. This bug will ultimatley be fixed on its own account, but in the mean time...
    Hope this helps anyone else who happens to have the same question.

  • Postfix Evaluation

    I am having trouble understanding why the PostfixEvaluator method in the class PostfixEvaluator is causing a number of problems; everything else works fine.
    import java.io.*;          
    import javax.swing.JOptionPane;
    class Stack
       private int maxSize;
       private char[] stackArray;
       private int top;
       public Stack(int s)       // Constructor of Stack
          maxSize = s;
          stackArray = new char[maxSize];
          top = -1;
       public void push(char j) {  // Puts item on top of stack
           stackArray[++top] = j; }
       public char pop(){         // Takes an item from the top of stack
       return stackArray[top--]; }
       public char peek(){        // Shows item at the top of the stack
       return stackArray[top]; }
       public boolean isEmpty(){  // Returns true if stack is empty
       return (top == -1); }
    class Converter                  // This class converts Infix input to Postfix output
       private Stack theStack;
       private String input;
       private String output = "";
       public Converter(String in) { // Constructor for the Converter class
          input = in;
          int stackSize = input.length();
          theStack = new Stack(stackSize);
       public String toPostFix()    // toPostFix method
          for(int j=0; j<input.length(); j++)     
             char ch = input.charAt(j);           
             switch(ch)
                case '+':              
                case '-':
                   gotOper(ch, 1);     
                   break;              
                case '*':              
                   gotOper(ch, 2);     
                   break;              
                case '(':              
                   theStack.push(ch);  
                   break;
                case ')':              
                   gotParen(ch);       
                   break;
                default:              
                   output = output + ch;
                   break;
                }  // end switch
             }  // end for
          while( !theStack.isEmpty() )    
             output = output + theStack.pop();
          return output;                   // Returns Postfix Answer to User
       public void gotOper(char opThis, int prec1) // Get Operator from entered Expression
          while( !theStack.isEmpty() )
             char opTop = theStack.pop();
             if( opTop == '(' )            // if it's a '(' (left parentheses)
                theStack.push(opTop);      // Push '(' into the stack
                break;
             else                          // If it isn't a left parentheses
                int prec2;                 //
                if(opTop=='+' || opTop=='-')  // Gets precedence of operator
                   prec2 = 1;     //
                else
              prec2 = 2;       // Assigns Precedence
                if(prec2 < prec1)          // Compares Precedence
                   theStack.push(opTop);  
                   break;
                else                      
                   output = output + opTop; 
      theStack.push(opThis);
       public void gotParen(char ch)
          while( !theStack.isEmpty() )
             char chx = theStack.pop();
             if( chx == '(' )         
                break;                
             else                      
                output = output + chx; 
    public class PostfixEvaluator
           StackArray stackArray = new StackArray();
           StringTokenizer tok;
           private int val1,val2;
           private int result;
        public PostfixEvaluator(String output)
        tok = new StringTokenizer(output);
         while(tok.hasMoreElements())
         String token = tok.nextToken();
         if(Numeral.isOperand(token))
         stack.push(token);
         else if(Numeral.isOperator(token))
         if(token.equals("+"))
         val1 = Integer.parseInt(stackArray.pop().toString());
         val2 = Integer.parseInt(stackArray.pop().toString());
         result = val1 + val2;
         stack.push(new Integer(result));
         else if(token.equals("-"))
         val1 = Integer.parseInt(stackArray.pop().toString());
         val2 = Integer.parseInt(stackArray.pop().toString());
         result = val2 - val1;
         stackArray.push(new Integer(result));
         else if(token.equals("*"))
         val1 = Integer.parseInt(stackArray.pop().toString());
         val2 = Integer.parseInt(stackArray.pop().toString());
         result = val1 * val2;
         stackArray.push(new Integer(result));
         else if(token.equals("/"))
         val1 = Integer.parseInt(stackArray.pop().toString());
         val2 = Integer.parseInt(stackArray.pop().toString());
         result = val2 / val1;
         stackArray.push(new Integer(result));
         public String getResult()
         return String.valueOf(stackArray.top());
    class Calculator
       public static void main(String[] args) throws IOException
          String input, output;
               input = JOptionPane.showInputDialog(null, "Enter an Infix Expression:"); // Enter an infix expression
             Converter docalculation = new Converter(input); // --> See Converter Class
              output = docalculation.toPostFix(); // Does Infix to Postfix Calculation
             JOptionPane.showMessageDialog(null, "The Postfix Expression is: " + output); // Outputs the postfix expression
             JOptionPane.showMessageDialog(null, "The evaluated expression is: " + getResult(output));
       }  Edited by: babypurin on Oct 14, 2009 10:37 PM

    I get the following compiling errors (I am having trouble interpreting what these error messages mean).
    Calculator.java:123: cannot find symbolsymbol : class StackArraylocation: class Converter.PostfixEvaluator     StackArray stackArray = new StackArray();     
    Calculator.java:124: cannot find symbolsymbol : class StringTokenizerlocation: class Converter.PostfixEvaluator     StringTokenizer tok;     
    Calculator.java:123: cannot find symbolsymbol : class StackArraylocation: class Converter.PostfixEvaluator     StackArray stackArray = new StackArray();     Calculator.java:131: cannot find symbolsymbol : class StringTokenizerlocation: class Converter.PostfixEvaluator tok = new StringTokenizer(output);
    Calculator.java:135: cannot find symbolsymbol : variable Numerallocation: class Converter.PostfixEvaluator     if(Numeral.isOperand(token))     
    Calculator.java:137: cannot find symbolsymbol : variable stacklocation: class Converter.PostfixEvaluator     stack.push(token);     
    Calculator.java:139: cannot find symbolsymbol : variable Numerallocation: class Converter.PostfixEvaluator     else if(Numeral.isOperator(token))     
    Calculator.java:146: cannot find symbolsymbol : variable stacklocation: class Converter.PostfixEvaluator     stack.push(new Integer(result));     
    Calculator.java:200: cannot find symbolsymbol : variable output2location: class Converter.Calculator     output2 = output.PostfixEvaluator(); // Calculates value of postfix expression     Calculator.java:200: cannot find symbolsymbol : method PostfixEvaluator()location: class java.lang.String     output2 = output.PostfixEvaluator(); // Calculates value of postfix expression     
    Calculator.java:204: cannot find symbolsymbol : variable output2location: class Converter.Calculator JOptionPane.showMessageDialog(null, "The evaluated expression is: " + output2);
    Calculator.java:188: inner classes cannot have static declarations public static void main(String[] args) throws IOException

  • Evaluator.java won't compile due to issues with javax.tools.*

    * Evaluator.java
    * Created on January 23, 2007, 4:17 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package ObjectTools;
    import java.io.*;
    import java.net.*;
    import javax.tools.*;
    import java.lang.reflect.*;
    * Utilizes {@link java.lang.reflect} package
    * @author ppowell-c
    public abstract class Evaluator {
        public static boolean writeSource(final String sourcePath, final String sourceCode)
        throws FileNotFoundException {
            PrintWriter writer = new PrintWriter(sourcePath);
            writer.println(sourceCode);
            writer.close();
            return true;
        public static boolean compile(final String sourcePath) throws IOException {
            final JavaCompilerTool compiler = ToolProvider.defaultJavaCompiler();
            final JavaFileManager manager = compiler.getStandardFileManager();
            final JavaFileObject source =
                    manager.getFileForInput(sourcePath); /* java.io.IOException */
            final JavaCompilerTool.CompilationTask task = compiler.run(null, source);
            return task.getResult();
        public static final java.lang.Class loadExpression(final String path, final String className)
        throws MalformedURLException,
                ClassNotFoundException { /* java.net.MalformedURLException */
            final URLClassLoader myLoader = new URLClassLoader(new java.net.URL[] {
                new File(path).toURI().toURL()
            /* java.lang.ClassNotFoundException */
            return Class.forName(className, true, myLoader);
        public static java.lang.Object evalExpression(final Class test)
        throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
            final Class[] parameterType = null;
            /* java.lang.NoSuchMethodException */
            final Method method = test.getMethod("expression", parameterType);
            final Object[] argument = null;
            Object instance = null;
            /* java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException */
            return method.invoke(instance, argument);
        public static Object eval(final String expression)
        throws FileNotFoundException, IOException, MalformedURLException,
                ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
                InvocationTargetException {
            final Object result;
            final String path = "c:/";
            final String className = "ExpressionWrapper";
            final String sourcePath = path + className + ".java";
            writeSource(/* to */ sourcePath,
                    "public class " + className + "\n" +
                    "{ public static java.lang.Object expression()\n" +
                    "  { return " + expression + "; }}\n" );
            if(compile(sourcePath)) {
                final Class class_ =
                        loadExpression(/* from */ path, className);
                result = evalExpression(class_);
            } else {
                result = null;
            return result;
    }Produces compiler errors on javax.tools.ToolProvider along with nearly everything else in javax.tools to boot.
    I'm using J2SE 1.5.0 with NetBeans 5.5 so they all should be there. I'm following the example at http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht9Ht/evaluating-expressions-with-java since all I want to do is come up with a Java equivalent of "eval()", which I use in PHP whenever I need it.
    Help appreciated, I'm lost here.
    Thanx
    Phil

    How do you do the Java equivalent of eval()?The language provides no support for that.
    Reflection lets you call any method, where you
    specify that method's name as a string and go through
    a few other steps to build the proper Method object
    with the proper args.
    (http://java.sun.com/docs/books/tutorial/reflect/) It
    won't let you just evaluate Java source code as a
    script interpreter though. To do that, see
    www.beanshell.org. Jython and I think Ruby on Rails
    also give you scriptingin Java. Jython uses Python's
    syntax, but gives you access to your Java classes. I
    don't know ayhthing about RoR.I am going to look up PHP/Java myself as I know no Python right offhand (but probably could learn it in about 10,000 years). Tried to figure out reflection but couldn't figure out how to do what in PHP we do like this:
    $msg = eval('JButton ' . $nameArray[$i][0] . ' = new JButton("' . $nameArray[$i][1] . '");');

  • Report data binding error

    I have created a banded report split into departments. Each
    recore has a value associated with it. The report runs fine if I
    dont try to sub-total each departments vale, but if I add a
    calculated field to the banding, I get the following error:
    Report data binding error Error evaluating expression :
    textField_2 Source text : calc.Department_Total.
    Variable calc.Department_Total is undefined.
    The calculated field is simply the sum of the values, with an
    initial value of 0 and set to reset when the group changes on the
    department. I am using the same data type for the calc field as it
    automatically gave for the original Value field (Big Decimal)
    Any ideas?
    Dave H

    Does anyone have any ideas about this, Its getting a bit
    critical now. Has anyone else been able to do sums that calculate
    on group changes?? The sum total works for the report, jusyt not
    the bands. I desparate here, pulling my hair out.
    Regards
    Dave H

  • Error while creating PDF using asynchronous

    Hi,
    I was using Asynchronous call to generate PDF. It was
    working for some time. Now it is showing error.
    We are not able to able to create PDF reports at that time.
    When we are checking the exception log of the CF Server, we can
    find the following error.
    "Error","Thread-16","12/05/07","10:58:51",,"Error invoking
    CFC for gateway CreatePDF: An exception occurred when performing
    document processing. The cause of this exception was that:
    java.lang.IllegalArgumentException."
    coldfusion.tagext.lang.DocumentTagException: An exception
    occurred when performing document processing.
    at
    coldfusion.tagext.lang.DocumentTag.doAfterBody(DocumentTag.java:1209)
    at
    cfGeneratePDF2ecfc1106407227$funcONINCOMINGMESSAGE.runFunction(C:\Inetpub\wwwroot\mycfsit e\reports\CF\model\GeneratePDF.cfc:343)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
    at
    coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at
    coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254)
    at
    coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
    at
    coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
    at
    coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:194)
    at
    coldfusion.filter.EventComponentFilter.invoke(EventComponentFilter.java:67)
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
    at
    coldfusion.filter.EventRequestMonitorFilter.invoke(EventRequestMonitorFilter.java:46)
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at
    coldfusion.eventgateway.EventProxy.invokeComponent(EventProxy.java:52)
    at
    coldfusion.eventgateway.EventRequestHandler.invokeCFC(EventRequestHandler.java:165)
    at
    coldfusion.eventgateway.EventRequestHandler.processRequest(EventRequestHandler.java:102)
    at
    coldfusion.eventgateway.EventRequestDispatcher$Task.run(EventRequestDispatcher.java:121)
    at
    coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:214)
    Anyone having idea about this error?
    Please help to track this.
    Thanks in advance

    If the report didn't change, then perhaps the data did. Check
    to make sure the data being supplied to the report is as expected.
    I have run into mysterious errors where an expected value was of
    the wrong type or a required value was now blank. It is also
    possible to have existing logical errors in an iif() or other
    dynamic evaluation expression that was not previously examined;
    until now. So, is there any unexpected or exceptional data the
    report cannot handle?

  • Useful Document/resources For Begginners

    this document is easily on net
    WS-BPEL Guide
    Last changed on Dec 10, 2004 by Matthieu Riou
    What is this article about ?
    This is an introduction to WS-BPEL that should give you a practical understanding of what you have to do to create a nice WS-BPEL process, dwelling on most important details. After reading this article you probably won't be able to write a WS-BPEL process from top to bottom. But you should have a pretty good notion of what can be done with it, what it involves and be familiar with the main elements of the grammar.
    First things first, here are the answers to the most trivial questions:
    •     What this new and unique acronym means? Web Services Business Process Execution Language.
    •     What is WS-BPEL? It's an XML grammar (a W3C schema) defining and standardizing structures necessary for web services orchestration.
    •     What does WS-BPEL? Well, actually nothing as it's just a grammar. But a WS-BPEL engine can do many things when executing your process. Like reacting to message reception, manipulating the message data, sending messages to web services and evaluating expressions.
    •     Where does it come from? It has been written by IBM, BEA Systems and Microsoft. Siebel and SAP joined these three and the specification has bee donated to OASIS.
    •     Where does WS-BPEL fit? It's a very good candidate to add an orchestration layer to a Service Oriented Architecture. It will make your services collaborate nicely and will encapsulate the cross-service business logic. It will also help you to introduce long-living transactions.
    Now that the introductory questions have been answered and before going any further I would like to clarify one thing about WSDL (I voluntarily wrote WSDL here, it's not a weird typo). WS-BPEL heavily relies on WSDL to describe the web services it is interacting with (we will see that soon) but that doesn't mean that it can only interact with services using XML(SOAP)/HTTP. WSDL introduces bindings which are the declaration of your services underlying communication medium. Bindings can be declared for local Java, JMS, RMI or anything you like (you might want to check Apache WSIF ). So a WS-BPEL engine using the right bindings could very well invoke many different services.
    So let's see how we are going to take a look at WS-BPEL. First, I'm going to give a very simple and classic example, just to give you a taste of what can be done with WS-BPEL. Then I'll introduce briefly its main activities. We'll see how to handle your process data and manipulate it and also how a particular process execution can be identified among all others. Finally we'll talk about how WS-BPEL introduces long-living transactions.
    A very simple yet demonstrative example
    After reading this chapter, most of you will probably think that the example I'm going to use is too simple and not realistic. I agree. But my goal here is just to give you a flavor of how WS-BPEL can be used, a realistic example would take more than all this article by itself.
    Now, you are the owner of a small bank granting loans to some of your customers. You have sales offices creating new customer contracts. You also have a web site and customers can directly ask for a loan online for small amounts. But before accepting a contract, some verifications are necessary. Those verifications are done using a risk assessment system maintained by a third party and by an in-house system that files the most tough requests. Loan specialists are part of your staff and then use this in-house system to take the final decision.
    So here is, step by step, the process that must be followed:
    1.     A loan request is issued, either from your web site of from one of your agencies. This request is made for a customer and for a certain amount.
    2.     A risk assessment system must be contacted to check whether the risk associated with the customer asking for the loan is high or low (probably based on his credit history).
    1.     If the loan amount is lower than $10,000 and the risk associated to the customer is low, the loan is directly approved (which saves time).
    2.     Otherwise, the loan request must be filed in your in-house system.
    1.     A loan specialist checks the request and gives his final decision.
    2.     The in-house system let you know the specialist's decision.
    3.     The response is sent to the customer.
    So how those pieces would be implemented in a "WS-BPEL aware" architecture? Here we go:
    •     One message triggered by your web site or your sales system and targeted at your process web service. It would hold at least the customer's name and the loan amount.
    •     One message triggered by the WS-BPEL engine to the risk assessment system to ask for the risk associated with the customer. If you pay your bills correctly, an answer message from this message should be expected.
    •     If needed, one message from the WS-BPEL engine to your in-house system to fill the loan request.
    •     One message from your in-house system to the process web service to give it the loan specialist's answer.
    •     Finally, one message back to your web site or to your sales system to give the final answer.
    One thing some of you probably already noticed is that when talking about the process I mentioned the "process web service". That's right, every process created inside a WS-BPEL engine is published as a web service with its own endpoint. When you want to send a message to your process, you actually send it to this web service.
    So now that you have a better idea of what it would take to implement this process in WS-BPEL, it's time to step back a bit.
    Private vs. Public Processes
    It's quite important to differentiate private and public processes (they are called executable and abstract in WS-BPEL). It is the same kind of opposition as between orchestration and choreography and it has a great impact on your architecture.
    Private processes manage services inside a given organization. They act as a service themselves and are centralized. As in an orchestra, there is a chief conductor (the process engine). Public processes manage services across several organizations. Each organization knows about it's own part of the process but doesn't know anything about the activities executed by other parties (for obvious confidentiality reasons). It's a peer-to-peer approach where you know the incoming and the outgoing messages, but nothing about what is done before, after or even meanwhile.
    WS-BPEL is quite good to handle private processes but doesn't perform so well for public ones (don't shoot me!). I have a feeling that even the members of the Oasis committee working on WS-BPEL don't know too much what to do with those. But actually, service choreography (public services) is not completely mature yet in terms of standards and market acceptance where as orchestration already has a widely embraced specification (WS-BPEL, in case you didn't realize) and many commercial implementations as well as open source ones (you may want to check Twister ). So good news, what you are going to learn in this article might prove useful.
    After those high-level considerations, we'll now look into WS-BPEL guts to see what's there and what we could use to build our process.
    WS-BPEL Activities
    In WS-BPEL, everything being part of your process body is an activity. There are basic activities (the ones that do something) and structured activities (the ones that organize basic activities without doing anything by themselves, just like your boss).
    Basic activities
    Invoking a web service is as simple as that:
    <invoke partnerLink="riskAssessor" portType="assessor" operation="assess"/>
    Pretty simple isn't it? In our initial example this declaration would be used to invoke the risk assessment system. Well, I'm actually cheating, you'll see later that you usually need a bit more (like input and output data) but this is a valid invocation.
    To wait for an incoming message, you'll write:
    <receive partnerLink="inhouseSystem" portType="inhousePort" operation="registerLoanRequest"/>
    That would be used to wait for the loan specialists' answer after registering the loan request in your in-house system. Now let's say that you want to send an immediate synchronous answer to this "receive". You'd write, after the receive:
    <reply partnerLink="inhouseSystem" portType="inhousePort" operation="registerLoanRequest"/>
    But how exactly does a WS-BPEL engine know, upon reception of a message, if it has to trigger the creation of a new process execution (a process instance)? Well, there's an attribute just for that: "createInstance".
    <receive partnerLink="loanRequester" portType="loanProcess" operation="processLoanRequest" createInstance="true"/>
    These 3 declarations use common attributes: partnerLink, portType and operation. If you know WSDL, you are already familiar with the port types and operations. Partner links have been introduced in WS-BPEL to model a two-way interaction between a process and a partner (a web service or another process). It lets you define the role of each of the two party in the interaction.
    There are two more basic activities that could prove useful (or at least one of the two):
    <wait until="'2002-12-24T18:00+01:00'"/>
    <empty/>
    Structured activities
    To start with, 3 basic ones: sequence, switch and while. If their behavior is not clear yet, here are examples:
    <sequence>
    <receive .../>
    <invoke .../>
    <invoke .../>
    </sequence>
    <switch xmlns:inventory="http://supply-chain.org/inventory" xmlns:FLT="http://example.com/faults">
    <case condition= "bpws:getVariableProperty(stockResult,level) > 100">
    … do something
    </case>
    <case condition="bpws:getVariableProperty(stockResult,level) >= 0">
    … do something else
    </case>
    <otherwise>
    … do the last thing
    </otherwise>
    </switch>
    <while condition="10 < bpws:getVariableData('loopVar', 'main', '/counter')">
    <assign>
    <copy>
    <from expression="bpws:getVariableData('loopVar', 'main', '/counter') + 1"/>
    <to variable="loopVar" part="main" query="/counter"/>
    </copy>
    </assign>
    </while>
    Another structured activity is 'pick'. It's just like several receive activities waiting at the same time with an additional alarm construct to avoid waiting forever the occurrence of a message:
    <pick>
    <onMessage partnerLink="" portType="" operation="">
    … do something
    </onMessage>
    <onMessage partnerLink="" portType="" operation="">
    … do something else
    </onMessage>
    <onAlarm until="2004-12-31T23:59:00">
    … hey, what the hell are you waiting for?
    </onAlarm>
    <pick>
    Like the receive activity, it's possible to declare a 'createInstance' attribute on the pick element to trigger the creation of a new process instance.
    Finally, for those who found all those activities way too structured and were missing a bit of anarchy, WS-BPEL introduced a flow activity. You basically declare all your activities as you like and then create links that take those activities as origin and target. The flow is also the only way to enable the execution of several parallel branches.
    Process Data
    To handle the process execution data, WS-BPEL introduces a new and unique concept: variables… Ok, that was just a bad attempt to keep you interested. Here is the context: your process engine must receive and send messages as defined by web services WSDL descriptions. To be able to do anything useful it must retain those messages and let you manipulate their content to create new messages or influence the process flow in variables. Therefore variables hold the state of a process execution. WS-BPEL variables can either hold a WSDL message or an arbitrary XML structure defined by a schema.
    An example for the declaration of a variable that can hold a WSDL message (the first stanza comes from the WSDL description, the second is a part of the process definition):
    <message name="creditInformationMessage">
    <part name="firstName" type="xsd:string"/>
    <part name="lastName" type="xsd:string"/>
    <part name="amount" type="xsd:integer"/>
    </message>
    <variable name="requestLoan" messageType="creditInformationMessage"/>
    So now, how do I stuff an incoming message into this variable? Here is the stuffing:
    <receive partnerLink="loanRequester" portType="loanProcess" operation="processLoanRequest" variable="requestLoan"/>
    Hey hey! That's our old receive! A variable attribute can be specified for a receive to hold the incoming message. For a reply, there's also a variable attribute to give the content of the message to send. And for an invoke, there's an inputVariable attribute to give the variable to send and an outputVariable to hold the response (for a synchronous invocation).
    We have variables to hold our message and we know how to give them a value upon reception of a message. But how do you initialize a variable when you want to send a message using it? How do you build a variable using parts of other variables? The answer is assignment. There's an additional activity I didn't mention yet (yes, I'm holding information) named assign. It lets you "copy and paste" the whole content of a variable, only a WSDL part in a message or even just an element (using Xpath). Again, examples are better than idle words:
    <assign>
    <copy>
    <from variable="ob1"/>
    <to variable="knob"/>
    </copy>
    <copy>
    <from variable="userInfo" part="homeAddress"/>
    <to variable="address"/>
    </copy>
    <copy>
    <from variable="house" part="bathroom" query="/shower/soap"/>
    <to variable="cleaningAgent"/>
    </copy>
    <copy>
    <from>hey you</from>
    <to variable="song" part="title"/>
    </copy>
    </assign>
    Once your variable has been set correctly, you can simply use it as inputVariable for an invoke.
    There's still one mystery unsolved in the way you can use variables in WS-BPEL: referencing them in expressions. Let's say you have a variable holding a specific value and want to use this value in the condition of a switch case, how do we do that? By using two functions:
    bpws:getVariableProperty ('variableName', 'propertyName')
    bpws:getVariableData ('variableName', 'partName'?, 'locationPath'?)
    The first function accepts the name of your variable and a property (we'll introduce property later but right now you just need to know that a property is a named XPath expression). The second accepts your variable, an optional part and an optional XPath expression relative to the part root.
    It's now time to see your first complete WS-BPEL example. It triggers the execution of a process upon reception of a message and iterates over a value contained in the message until 10. It's a very stupid example and it's probably the last thing you want to do with WS-BPEL (just as a reminder, WS-BPEL is used to orchestrate web services, not iterate over a value) but it illustrates almost everything we talked about in this paragraph.
    <?xml version='1.0' encoding="UTF-8"?>
    <process name="loop"
    targetNamespace="http://www.smartcomps.org/twister/example/loop/process/"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:def="http://www.smartcomps.org/twister/examples/loop/service/"
    abstractProcess="no">
         <variables>
              <variable name="loopVar" type="loopVarType"/>
         </variables>
         <correlationSets>
              <correlationSet name="counterCorrel" properties="def:counterId"/>
         </correlationSets>
         <sequence>
              <receive partnerLink="loopPartner" portType="loopPort" operation="loopOp"
              variable="loopVar" createInstance="true">
                   <correlations>
                        <correlation set="counterCorrel" initiate="yes"/>
                   </correlations>
              </receive>
              <while condition="10 > bpws:getVariableData('loopVar', 'main', '/counter')">
                   <assign>
                        <copy>
                             <from expression="bpws:getVariableData('loopVar', 'main', '/counter') + 1"/>
                             <to variable="loopVar" part="main" query="/counter"/>
                        </copy>
                   </assign>
              </while>
         </sequence>
    </process>
    As you probably already realized, data manipulation can quickly become a bit verbose. The WS-BPEL Technical Committee is currently working on it to have something easier for WS-BPEL 2.0.
    Correlation
    Correlation is a notion that can be a bit hard to grasp at first but is very important. So hang on and I'll do my best to be even more clear (somehow) than usually. During its execution, a process has to interact with several different services. This interaction is stateless so there is no way to make sure you will be addressed to a particular instance of a service. So let's imagine you own a wine store and have a web site allowing users from all over the world to order cheap and very good French wine. A service provided by your bank does the billing for you and you also use a shipper to send the orders all over the world. When a user places an order online, your web site generates an order id. But your bank doesn't know anything about your order id, it creates its own billing id corresponding to your order and you always must use this billing id when interacting with your bank (to confirm the transaction just after shipment for example). The shipper also creates his own shipment id that will be used when he confirms that the order has been sent.
    You want to use a WS-BPEL engine to handle those tasks automatically and orchestrate all the services (there's probably much more than three services and many steps involved). That's a really good idea!!! But how do you deal with all these different ids ? Yep, you guessed it: correlation. How does it work? A correlation is an unique way to identify the interaction of your process execution with a given party. A correlation is a list of property elements and a property element is a named XPath expression. This XPath expression must select a value in the exchanged messages that will be the value of the correlation for this particular message. So for our previous example we would define the following elements:
    <property name="billId" type="xsd:string"/>
         <propertyAlias propertyName="billId" messageType="createBillMessage" part="billInfo" query="billId"/>
         <propertyAlias propertyName="billId" messageType="confirmTransactionMessage" part="billId"/>
         <property name="shipId" type="xsd:string"/>
         <propertyAlias propertyName="shipId" messageType="shipMessage" part="shipId"/>
         <correlationSets>
              <correlationSet name="bankCorrelation" properties="billId"/>
              <correlationSet name="shipperCorrelation" properties="shipId"/>
         </correlationSets>
    A correlation can be composed of more than one property (separated by spaces). A property can also have several aliases for each type of message the correlation is used for.
    Usually a correlation is declared for each actor your process has to communicate with. The correlation is initiated during the first message exchange between your process execution and a party and is reused anytime your process execution sends a message to this party.
    Compensation
    I'm not going to detail this chapter as much as I did for the previous ones. This article is already far too long (and therefore too boring). Talking about compensation in a detailed manner would require another article like this one. But to whet your appetite, I'll tell you what its is and what it is the problem it has been designed to solve.
    Compensation is related to error handling. WS-BPEL processes are usually long-lasting (there could be days between 2 activities), they use asynchronous messages and interact with several different services. Introducing the concept of ACID transactions in this context is quite tough. Each of the services involved can locally use its own transaction but it's impossible within your process to control them (and you probably don't want to). So what can you do if you have three asynchronous operations, like 3 invoke / receive couples, that must be executed in an "all or nothing" fashion? How to cancel the two first operations that have already been committed if the third fails?
    Compensation is basically a set of activities attempting to cancel operations that have already been completed inside an unit of work. If an activity fails or a fault is thrown inside this unit of work, this set of activities is supposed to roll back everything that has been already completed in the unit of work in a way specific to your business case. You are the only one who really knows what to do if something goes wrong so you have to provide the necessary operations.
    But this system has important drawbacks:
    •     It is your responsibility to execute the right activities to handle the cancellation.
    •     All the services you are interacting with must support a way to rollback a previously committed transaction (most probably requiring some hard coding).
    Conclusion
    WS-BPEL has been a bit criticized principally for its absence of human participant interaction (as in conventional workflows), everything is a service. But whether you like it or not, it's already standard and if you use it for what it is good at, a pretty good one. Besides it's a good step in the right direction to standardize the BPM - SOA - 'call it what you like' space. And you can always rely on good products like Twister to introduce Worklist functionalities (remember, always a bit of marketing in a conclusion).
    Resources
    WS-BPEL Specification: http://www-106.ibm.com/developerworks/library/ws-bpel/
    Oasis WS-BPEL Technical committee: http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsbpel
    Twister WS-BPEL Open Source Implementation: http://www.smartcomps.org/twister

    Where can I get a document like this for the IQ775? I have asked HP several times, but get no response. I just want to know how to open the damned thing!

  • BW Upgrade from 3.5 to 7.3 directly

    Hi All,
    We are planning to upgrade one of our client systems from 3.5 to 7.3 directly. After checking with SAP we have come to the conclusion that we can upgrade our system directly to 7.3 version without going to 7.0 and then to 7.3 process.
    But now my question is what are the security related work we are going to perform after the 7.3 upgrade as the older version 3.5 authorization concept is not supported in the 7.3 version.
    Kindly suggest if any one has performed the direct BW upgrade from 3.5 to 7.3.
    Thanks in advance...

    Hi,
    We have started to perform the BW upgrade activity. After performing the pre-Upgrade steps we are starting the Upgarde. When we were trying to toad the SAPUP as described in the guide we have got the below error :
    To start the Upgrade :
    Login as QSECOFR user load the upgrade tool
    Command :  QSH CMD('/<DVD mount directory>/DATA_UNITS/UM_SAPCAR_OS400_PPC64/loaduplib <SID>')
       ******    SAP Upgrade Control Program - Loading tool libraries ...    ******
       SAPCAR: processing archive /bwupgd/BWUpgradeSW/InstMasterUpgrMaster/51042312/
    DATA_UNITS/UM_SAPCAR_OS400_PPC64/ILE.SAR (version 2.01)                     
       SAPCAR: 7 file(s) extracted
       Loading base tools library SAP_TOOLS ...                                    
       Loading library SAPUP ...                                                   
       [: 001-0062 Syntax error evaluating expression: primary not found.          
       [: 001-0062 Syntax error evaluating expression: primary not found.          
       Fixing file system authorities ...                                          
       Checking IGS file system settings ...                                       
      Finished sucessfully.
    So we had raised the SAP message for the loading issue then SAP recommended us to run the below commands twice and error will be resolved :
    QSH CMD('/QOpenSys/usr/bin/sh -x /<DVD mount directory>/DATA_UNITS/UM_SAPCAR_OS400_PPC64/loaduplib <SID>' > /usr/sap/<SID>/loaduplib.trc 2> /usr/sap/<SID>/loaduplib.err')
    Which I did and then :
    2. ADDLIBLE SAPUP
    3. STARTUP SID(BWD) TYPE(*ABAP) DVDPATH('<DOWNLOAD DIR>') UPGDIR('/usr/sap/<SID>/upg')
    I can see that the JOB is started and when I start the GUI on browser using http://<HOSTNAME>:4239
    Its not opening the upgrade GUI.
    Please some one help me in resolving the issue as AS400 is new to me and for the 1st time that I am working on this OS.
    Thanks in advance.....
    Thanks & Regards.

  • Displaying data from a Database control

              I'm retrieving data from a sybase database into a java class and then pass that
              through to my jsp page. This works fine, as long as the sql actually returns a
              value (This specific query only returns one or none records).
              If no records were found, my jsp page displays an error message "Caught exception
              when evaluating expression "{pageFlow.m_dates.mon_am_loc}" with available binding
              contexts [actionForm, pageFlow, globalApp, request, session, appication, pageContext,
              bundle, container, url, pageInput]. Root cause: knex.scripting.javascript.EvaluatorException:
              The undefined value has no properties."
              the call in my .jsp looks as follow : <netui:label value="{pageFlow.m_dates.mon_am_loc}"
              escapeWhiteSpaceForHtml="false"/>
              .... and is part of a repeter item tag.
              Any help would be appreciated.
              

    Hi Jothivenkatesh M,
    Place the cursor in forst field and press  CNT+y now select the entair row by using your mouce and press CNT+C and paste the data in what ever position.
    Plzz rewad if it is useful,
    Mahi.

Maybe you are looking for

  • FTP process flow not using registered userid

    Hi, I posted the following last week, to the back of a thread that Igor was answering to, but haven't seen any replies yet. Can some body answer the question regarding the userid used on the target location when an FTP process flow is ran please? Tha

  • Re: Can't start Satellite A40-271 with USB driver

    Hello, I've a Toshiba Satellite A40-271 and there was a problem with windows and i can't start it, so i've decided to start it with linux. I've tried once with a cd and it worked perfectly, now i'm trying with an usb flash pen and it's not working. C

  • SD-QM: Sales Return Inspection lot status Error

    Hello Expert, I want to post Goods receipt in a Returns delivery with QM activated in the material but the following message is displayed: Status of inspection lot 060000000001 / partial lot 000000 does not allow good issue Message no. VL171 The insp

  • Invoking BPEL process on startup

    Hi there, Does anyone have suggestions as to how i can run a BPEL process automatically when BPEL PM starts up? I would prefer not to use external tools. I tried using the OC4J startup classes invoking it via java, but the BPEL engine has not started

  • Is it possible to open à web page

    Inside à page of iBook I mean when we havé à link we go outside thé ibook But i want à link Thatcher open inside thé iBook Using thé main page of à widget and adding à code