Define an array of threshold

Hello

I looked and looked on how to do this on the forums but no luck.

I work with the larger sets of data. The code below is a simplified version of what I'm trying to do.

I have a 2D converted to a 1 d table table do the easier average.

I want to create a 1 d array whose elements are above a threshold that I defined. This new table size can be smaller. Whenever I try to eliminate the elements below the threshold for those below the threshold values, a zero is put in the new table. This will effect the average.

If anyone can help. I like just the values below the line and without leading zeroes.

See you soon.

K

You can go there.

Tags: NI Software

Similar Questions

  • How can I define my array to display in excel csv correctly?

    I currently have an array of 6 elements of type double entries. I am using writing worksheet function to produce this table in a csv file. Since it seems that the table has no space at the exit to the writing of the worksheet function, the output for each line is as follows:

    0.000.2310.2410.3310.5420.334

    I need it for output in separate columns in the csv as this files:

    0.00 0,231 0,331 0,241 0,542 0,334

    What I am doing wrong?

    As you write in a CSV file, Excel expects a comma as a delimiter.  Then make sure your separator is a comma (the default is a tab).

  • How to create a multidimensional array constant?

    I have a code where I'm trying to mathematically manipulate tables in a while loop. I was counting on multiplying one table by a constant, but on the second iteration the constant actually eventually change to an array of different constants *. So, I would define an array of constants to a single value. I did it using the 'constant matrix. I stuck a double constant Interior point and wired it me terminal. A problem I have is that the size of the array is not matching my another Bay. In the box to the left of my constant value double point, I put in '10' because the size of the table I want is 10. Instead of generating a table of 10 elements with all the same constant, it created... uh... nothing. I received null: []. What I am doing wrong?

    Then, is it possible to set the length of this array based on the length of another table? For example, the table I want to work with that is 10 items, but it may not ALWAYS be 10 items. I would like to put in some flexibility so that if it passes 30 items, the constant table that I create will be smart enough to know that it must also be an array of 30 items.

    In addition, I apologize to not include an image. The computer with LabVIEW is not the same as the computer connected to the internet. Promote my frustration, the only way I can transfer data from this computer translates into encrypted data unless I have to burn a CD. Oh working for the federal Government is sometimes a treat.

    * The constant becomes a table of constants because the process is iterative. I start with an estimate of the constant, but then this assumption is updated by the values in the table, forcing him to become a table itself.

    And if you really want to continue to use berries, yes there is a way to make the length of you table identical to the length of another table.

    Here is an example with a 2D array:

    -Table is the original array

    -10 is the constant which acts as the multiplier

  • How to insert values of array of String in BPM

    Hello

    I have defined an array of strings in the business object, created a data object and want to fill/insert values inside. I searched a lot of messages and tried several options but no luck.

    My BO:

    " < xs: Schema targetNamespace = ' http://xmlns.Oracle.com/BPM/bpmobject/TestTypes/SimpleArrayBO "elementFormDefault ="qualified"xmlns =" http://xmlns.Oracle.com/BPM/bpmobject/TestTypes/SimpleArrayBO "" xmlns: XS = " http://www.w3.org/2001/XMLSchema " xmlns:bpmo =" http://xmlns.Oracle.com/BPM/bpmobject/ " > ""

    < name XS: complexType = "SimpleArrayBOType" >

    < xs: SEQUENCE >

    < name XS: ELEMENT = "attr1" nillable = "true" type = "xs: String" maxOccurs = "unbounded" / >

    < / xs: SEQUENCE >

    < / xs: complexType >

    < xs: element name = "SimpleArrayBO" type = "SimpleArrayBOType" / >

    < / xs: Schema >

    Add a script task and tried different ways to fill in the values.

    Basic ['a', 'b'] also fails with the error expected "-result tree fragment" rather than "string".

    How to manually enter the values?

    Thank you

    Chandra

    Because your input is coming from a few strings and not a table, you can just add a Script activity to your process and to define table of your target XSD using XML.

    To do this, you must add a Script to the activity-> in the "Application" tab click on 'Data Associations'-> dragging the "Expression" icon above your target object on the right side (not the table but the table parent)-> open the XPath expression box in the Middle-> click 'XPath Exp' in the drop-down list at the top.

    I used your XSD to create the XML file for the logic below:

    oraext:ParseXml (concat ('))

    http://www.w3.org/2001/XMLSchema-instance '.

    "" xsi: schemaLocation = "http://xmlns.oracle.com/bpm/bpmobject/TestTypes/SimpleArrayBO xsd/mySimpleArray.xsd.

    xmlns ="http://xmlns.oracle.com/bpm/bpmobject/TestTypes/SimpleArrayBO" >. "

    ', bpmn:getDataObject('string1') '

    ', bpmn:getDataObject('string2') '

    '))

    When I 'bpmn:getDataObject('...')', you should rather to insert your data object variables both your process chain.

    Hope it gets you going,

    Dan

  • How can I define table field residing in a Structure field?

    I use java Adobe XMP toolkit.

    There are a few methods to define elements of structure and table.

    setStructField() and appendArrayItem().

    But ducu said that the members of the Structure may be table or a structure, in addition also array elements can be tables or structures.

    So, how can I define field Array in Structure or table Structure?

    Thank you

    Andrey

    OK, it worked, first time (without exception) I tried to set the value of the CURRENT field.

    The trick is to add table or a struct before setting their values.

    This short example shows how this works:

    Register of XMPSchemaRegistry = XMPMetaFactory.getSchemaRegistry ();

    registry.registerNamespace (extNS, "pdfaExtension");

    registry.registerNamespace (shemaNS, "pdfaSchema");

    registry.registerNamespace (propertyNS, "pdfaProperty");

    XMPMeta m = XMPMetaFactory.create ();

    m.appendArrayItem (extNS, "pdfaExtension:schemas", new PropertyOptions () .setArray (true), "", new PropertyOptions () .setStruct (true));

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:prefix","dc" ');

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:namespaceURI","http://purl.org/dc/elements/1.1/" "");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:schema","Dublin Core Schema" ");

    m.appendArrayItem (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property", new PropertyOptions () .setArrayOrdered (true), null, new PropertyOptions() ")

    .setStruct (true));

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [1] / pdfaProperty:name","contributor", null ");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [1] / pdfaProperty:category","external", null ");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [1] / pdfaProperty:description", ")

    ("Contributors to the resource (other than the authors).", null);

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [1] / pdfaProperty:valueType","bag ProperName", null ");

    m.appendArrayItem (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property", new PropertyOptions () .setArrayOrdered (true), null, new PropertyOptions() ")

    .setStruct (true));

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [2] / pdfaProperty:name","coverage", null ");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [2] / pdfaProperty:category","external", null ");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [2] / pdfaProperty:description","the extent or scope of the resource.", null ");

    m.setProperty (extNS, "pdfaExtension:schemas [1] / pdfaSchema:property [2] / pdfaProperty:valueType","Text", null ");

    Code above creates more XMP:

    http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    "xmlns:pdfaExtension ="http://www.aiim.org/pdfa/ns/extension/"

    "xmlns:pdfaSchema ="http://www.aiim.org/pdfa/ns/schema#"

    xmlns:pdfaProperty ="http://www.aiim.org/pdfa/ns/property#" >. "

    DC

    http://purl.org/DC/elements/1.1/

    Dublin Core Schema

    contributor

    external

    Contributors to the resource (other than the authors).

    bag ProperName

    coverage

    external

    The extent or scope of the resource.

    Text

  • Message box

    Hello

    I hope someone can give me a hand with this...

    I created an array of offset, where each position of the table corresponds to the offset for a channel. I have another array containing the names of channels.

    Now I want a pop window mentioning the name of the channel on the left and his shift on the right (there are 36 shifts) so the user can check them.

    So far, that I've created a loop For which opens a message box (using the 'msgboxdisp' function) with a single value in time, 36 times, which to be honest is an extremely poor solution.

    If anyone can suggest something

    Thank you

    Hi Leillo,

    Here is the approach of ambivalent MsgBox.

    For iCount = 1 to 23
    StatSel (iCount) = 'no '.
    Next
    StatSel (6) = 'yes '.
    Dim offset (100)' define an array of 100 for the channel offset
    Dim a, i, Msg
    a = ChnNoMax'Calculates the number of channels
    ICount = 1 to a ' loop to calculate the table of offsets
    Call StatBlockCalc ("Channel", "1-", iCount)' compute channelwise, 1st row on the last, all channels (iCount represents "all channels.
    offset (iCount) = statarithmean ' table of offsets
    Next
    for i = 1 to a
    MSG = Msg & I & vbTAB & offset (i) & + "\n"
    Next
    Call msgboxdisp (Msg, "MB_OK", "MsgTypeWarning", 3)

    MsgBox items won't be able to show all the 100, but you could filter only issue items / interesting and hide the others uninteresting.  Or you can go the road from SUDialog to pop up to a custom dialog box, you set for a table with 2 columns.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Table programming don't hear is committed

    I have a table control that I created by NewCtrl program.  I put its control mode to VAL_HOT so that it will listen to validate events when I edit the cells.  And yet, the EVENT_COMMIT never happens.

    A test, I created a table in my UIR, put in hot mode and put a DebugPrintf in the EVENT_COMMIT case.  Triggers as expected when I change a cell.

    Now to my programmatic table, all my other events trigger as expected:

    • EVENT_RIGHT_CLICK

    • EVENT_LEFT_CLICK

    • EVENT_LEFT_DOUBLE_CLICK

    • EVENT_GOT_FOCUS

    • EVENT_LOST_FOCUS

    • EVENT_TABLE_ROW_COL_LABEL_CLICK

    What else do I need to define an array of programming to make commits to answer?

    OK, I have this resolved now.  It was a mix of issues.  This project is part of my another series of questions here, where the first thing that happens in my essay is that I spend monitors (with the help of a DiscardPanel and DuplicateCtrl).

    For some reason, the DuplicateCtrl does not seem redundant with the status of control mode.  So after I have move monitors and call the DuplicateCtrl, I need to reissue a call to change its attribute to control mode.  Turns, just this one:

    SetCtrlAttribute (main, tableControl, ATTR_CTRL_MODE, VAL_HOT);

  • Optimization of code using the multi-hearts

    All, morning

    I have a piece of labview code that I want to run 10,000 times, varying my input parameters to see the effect on the output (Monte Carlo simulation). The output of 1 run does not affect the input to the other, so I can define an array of startup parameters. My code will run more efficiently on a multicore processor if I have 4 for loops, each of the 2,500 tracks 1 loop of 10 000 races? Is that any way to optimize this process?

    Paul

    Please refer following links: http://www.ni.com/tutorial/9393/en/

    and this: http://www.ni.com/white-paper/6423/en/

  • Detection of the contours of a measured waveform

    Hello

    I'm trying to detect the edges of a measured waveform. My ideas using peak detection or threshold has failed. Attached is an example of a waveform. I try to find edges, marked of a cursor.

    I would be very happy if someone has a good idea.

    Thank you very much.

    Best regards

    Michael

    You can change the enum to the VI edge detector to detect the rising or falling edges. You have only to increase edges in your current signal, so you might find the signal low medium and medium high signal and find where the data that passes through in both places. I moved the thresholds of 0.001, but you would need to define an arbitrary passing threshold so that it is not triggered by the noise.

    You can also use the VI transitional measures in waveform > Analog Wfm > measurements. This VI allows to specify thresholds in percentage of the transition (or absolute value) and find the start time and the end time of the transition.

    Again, be careful with the effect of noise in States of high/low if you try to measure the transition points near the levels down.

  • How can I search and return several items from the table quickly (like Matlab find)?

    Hi, I'm a pretty experienced Labview programmer, and I've always wondered if there is a way to quickly search for pictures on several items that meet the selection criteria, equivalent to the Matlab find command.  While my inability to do in Labview has always annoyed me, I now have an application that requires this capability and I need to find a solution.

    Is the fastest way I've found to do this in labview to perform comparisons on the data vectors, then use the Boolean value that results from vector to analyze the table using a loop and shift registers.  I enclose an extract vi a analysis comparative vi to one of the simple searches that I need to do.  On my laptop, this research takes about 600 ms.  In comparison, the equivalent in Matlab:

    newArray=oldArray(find(oldArray(:,4)./oldArray(:,2)>1.5),;

    runs in about 1.2ms.  So, the way I am doing this in Labview is only 400 times slower

    Needless to say, I need to make these types of research many times, and these additional 599 ms start to add up pretty quickly!

    Thanks for your help,

    Aaron

    Hi Aaron,

    the slow part is probably "build group" of the node in the loop.

    Try this:

    Define an array the same size as the input data (or simply uses a copy of it) and the wire that to the shift register. Keep a counter of lines found in the loop. Use IndexArray and ReplaceArraySubset for the loop to move rows found at the beginning of the table (overwrite the 'bad' lines). After the loop simply ReshapeArray the number of found lines...

    Sorry, don't have LV (2009) on hand for editing your snippet.

  • Do curve a real - time of the linear adjustment computed

    Hi, here is how my program works:

    (1) plot data read from a file

    (2) user can move the sliders to select a range of data

    3) allows users to choose the scale with control 2 Y (Y minimum and maximum)

    (4) make a linear adjustment of certain data in real-time and gives the results.

    And there's no problem, I asked the graph xy of a while loop in which I drove

    (1) the function of fitting (selection of data to 2 inhabitants variable (cursors)) and table functions

    (2) local variable 2 (write) to adjust the scale Y with the number in the control.

    Data and sliders move user appear, all right.

    The problem is that I want to draw the fitted line of the xy-graph, so I did 2 x 2-number-table (with x = 0.1 and y = intercept, slope + interception) and...

    I must establish xy-curve in real-time to the Assembly line to refresh on a cursor move XD

    So I put the chart at the time, and I traced it each time the moment of the cycle (I used a condition with shift register to skip unnecessary calculation).

    And here's the problem: when the xygraph is traced the scale there is the default. A few ms then the scale will have correct (when the program has wide are the values of controls).

    Is there a way to avoid that the graph will go to scale by default when it is drawn again? Or is it possible to trace the line of editing without trace all the xy graph?

    Thank you

    PS: I tried to put a sequence stacked with paint 1) graph 2) scale but cen see you in any case the flash of the scale Y incorrect

    I think all you need to do is disable autoscale for axes.

    Overall, there are a few very complicated and very dangerous built code. Here is a small sample (are there many, many others!):

    The code on the left can blocking the program, for example if the data are all zero. Why is there a local variable? thread just from the source, it is just there! What you probably want instead of these small while loops is the array of threshold function. No need to loop.

    To write two properties, you use oven (!) property and three structures of sequence nodes deep stacked. Property nodes are running up and down, so all you need is the code below! Also note that 'table of index' is resizable. You don't need to wire the index unless you want something special.

  • Conversion table of varying Dynamics

    I tried to convert a number of 2D, dynamically assigned tables to VARIANTS in order to generate a plot of parametric Surface 3D ActiveX.   Unfortunately, the CA_VariantSet2DArray function has problems with this.  If I understand the question, a translation to the VARIANT cannot be completed if non-contiguous memory is passed into the function.  I AM able to pass arrays statically defined in the CA_VariantSet2DArray function and generate my very well 3D parametric Surface plot.  In the end, however, table sizes that will be Wescott may vary each time the user the parcel data.  Given that the size info is not known at compile time, I can't define static arrays.

    I saw a few people who have asked similar questions in these forums in the past, but there seems to be no solution.  Is there an a way in which the varrient conversion functions can be used with dynamically created tables?  Is there some sort or work-arround?   I tried defining a very large static arrays and then using only a part of them because the CA_VariantSet2DArray requires the dimensions of the matrix as input.  Let us, the unused portions of static arrays are always copied in the VARIANT and bad data are thus drawn to the plot of 3D parametric Surface.

    Any help would be GREATLY appreciated!  Thank you!!

    Here is a snippet of my code simplfied:

    -----------------------------------------------------------------

    IT DOES NOT WORK...

    -----------------------------------------------------------------

    XVt VARIANT, yVt, zVt;

    nRows = 40;

    Matches = 39;

    float * xVals.
    float * yVals;

    float * zval;

    int row, col;

    xVals = (Char *) malloc (nRows * sizeof(float *));
    yVals = (Char *) malloc (nRows * sizeof(float *));
    ZVAL = (Char *) malloc (nRows * sizeof(float *));
      
    for (row = 0; row)< nrows;="">

    {
    xVals [Online] = (Char *) malloc (matches * sizeof (float));
    yVals [Online] = (Char *) malloc (matches * sizeof (float));
    ZVAL [line] = (Char *) malloc (matches * sizeof (float));
    }

    for (row = 0; row)< nrows;="">

    {
    for (col = 0; col< ncols;="">
    {

    xVals [Online] [column] = 0;
    yVals [Online] [column] = 0;
    ZVAL [row] [column] = 0;

    }

    }

    Valid values plot copied in yVals, xVals, zVals here.

    CA_VariantSet2DArray (& xVt, CAVT_FLOAT, nRows, matches, xVals);

    CA_VariantSet2DArray (& yVt, CAVT_FLOAT, nRows, matches, yVals);
    CA_VariantSet2DArray (& zVt, CAVT_FLOAT, nRows, matches, zval);

    CW3DGraphLib__DCWGraph3DPlot3DParametricSurface (surfGraphHndl, NULL, xVt, yVt, zVt, CA_DEFAULT_VAL);

    -----------------------------------------------------------------

    IT DOES NOT WORK...

    -----------------------------------------------------------------

    XVt VARIANT, yVt, zVt;

    nRows = 40;

    Matches = 39;

    float * xVals.
    float * yVals;

    float * zval;

    float xtemp [40] [39];
    float ytemp [40] [39];
    float ztemp [40] [39];

    int row, col;

    xVals = (Char *) malloc (nRows * sizeof(float *));
    yVals = (Char *) malloc (nRows * sizeof(float *));
    ZVAL = (Char *) malloc (nRows * sizeof(float *));
      
    for (row = 0; row)< nrows;="">

    {
    xVals [Online] = (Char *) malloc (matches * sizeof (float));
    yVals [Online] = (Char *) malloc (matches * sizeof (float));
    ZVAL [line] = (Char *) malloc (matches * sizeof (float));
    }

    for (row = 0; row)< nrows;="">

    {
    for (col = 0; col< ncols;="">
    {

    xVals [Online] [column] = 0;
    yVals [Online] [column] = 0;
    ZVAL [row] [column] = 0;

    }

    }

    Valid values plot copied in yVals, xVals, zVals here.

    for (row = 0; row)< nrows;="">

    {
    for (col = 0; col< ncols;="">
    {
    XTemp [row] [column] is xVals [row] [column];.
    [Online] ytemp [column] = yVals [row] [column];
    [Online] ztemp [column] = zval [row] [column];
    }
    }
        
    CA_VariantSet2DArray (& xVt, CAVT_FLOAT, nRows, matches, xtemp);
    CA_VariantSet2DArray (& yVt, CAVT_FLOAT, nRows, matches, ytemp);
    CA_VariantSet2DArray (& zVt, CAVT_FLOAT, nRows, matches, ztemp);

    CW3DGraphLib__DCWGraph3DPlot3DParametricSurface (surfGraphHndl, NULL, xVt, yVt, zVt, CA_DEFAULT_VAL);

    You must allocate a block of memory for each table, something like:

    VARIANT  xVt, yVt,  zVt;
        nRows = 40;
        nCols = 39;
    
        float *xVals;
        float *yVals;
        float *zVals;
    
        int row, col;
    
        xVals = (float *) malloc(nCols * nRows * sizeof(float));
        yVals = (float *) malloc(nCols * nRows * sizeof(float));
        zVals = (float *) malloc(nCols * nRows * sizeof(float));
    
        for(row = 0; row < nRows; row++)
    
        {
            for(col = 0; col < nCols; col++)
            {
              xVals[nCols*row + col] = 0;
              yVals[nCols*row + col] = 0;
              zVals[nCols*row + col] = 0;
    
            }
    
        }
    
       // Valid plot values copied into xVals, yVals, and zVals here.
    
        CA_VariantSet2DArray(&xVt, CAVT_FLOAT, nRows, nCols, xVals);
    
        CA_VariantSet2DArray(&yVt, CAVT_FLOAT, nRows, nCols, yVals);
        CA_VariantSet2DArray(&zVt, CAVT_FLOAT, nRows, nCols, zVals);
    
        CW3DGraphLib__DCWGraph3DPlot3DParametricSurface (surfGraphHndl, NULL, xVt, yVt, zVt, CA_DEFAULT_VAL);
    
  • SetFont ActiveRichTextField Bold

    How do you define an activerichtextfield to use a bold font?  I tried to do this and it does not work.  In the API, he said setFont is inherited from RichTextField.

    Font font_Bold=Font.getDefault().derive(Font.BOLD);
    ActiveRichTextField mo_Art_text = new ActiveRichTextField( "text" );
    mo_Art_text.setFont(font_Bold);
    

    ActiveRichTextField is much more complicated - it keeps the tables of fonts and colors that harmonize with the regions (start and end offsets) in control and.

    I guess you can define an array of police and this will be affected in the region with zero shift. See the documentation for the API for RichTextField.

  • Cisco IOS IPS?

    Hello

    I'm currently studying PSAB NSS by Greg Bastien. I have the following lab scenario and would like clarification on what I see. I want to check the functioning of my installation of IPS, so I ran "angry ip" ip address/port scan on the router. "When I use ' statistical property sh industrial ips I see ' packets 3051:1 verified signature: [0:1]" which means by ' TCP connection window size back ATOMIC. TCP "."

    Is this signature 3051 an indication that the router has seen the scan of IP? and it considered a reconnassaince attack. Are there other ways to check the attack of?

    Hello

    If you see signing warning messages, then that means there is a match and IPS triggers an alert message which is the default setting of a signature.

    In your case, it means only that the signature of 3051:1 saw a package matching, so he comes to save the information. For this signature to the fire (which means for IP addresses identify an attack, he must check the other settings as well).

    If you look into the details of the definition of this signature, it has a global analytical threshold and interval summary settings. Which means the PPE must see this signature are in the interval of summary for the number of times defined in the analytical threshold, then it will validate a signature match, so send the alarm and perform actions defined in the signature.

    In your case, it shows that there is a corresponding signature packet. You might be able to find more information, if you run a sniff and capture your ' angry ip' traffic sent to the router. "

    Thank you

    -Chris

  • E-mailing of a Workflow log

    We have a lot of detailed logging that happens in our workflows.  Most are System.log/error/debug/whatever.

    Is it possible to scratch these log to the workflow data and send it to someone?

    I'm testing...  I've implemented a script object just to generate content in the newspaper.  The generated log looks like this:

    [16:18:03.325 2015-02-19] [I] entered:

    [16:18:03.325 2015-02-19] [I] has is a

    [16:18:03.325 2015-02-19] [I] B is b

    [16:18:03.325 2015-02-19] [I] C is c

    [16:18:03.325 2015-02-19] [I] E is e

    [16:18:03.325 2015-02-19] [I] F is f

    [16:18:03.326 2015-02-19] [I]

    [16:18:03.326 2015-02-19] [I] everything together is abcef

    [16:18:03.326 2015-02-19] [I]

    [16:18:03.326 2015-02-19] [I] put them in an output variable...

    [16:18:03.326 2015-02-19] [I]

    [16:18:03.326 2015-02-19] [I] out that g is abcef

    [16:18:03.326 2015-02-19] [I]

    [16:18:03.326 2015-02-19] [E] registering an error to see what it looks like

    [16:18:03.326 2015-02-19] [I]

    [16:18:03.326 2015-02-19] [D] logging debug to see what it looks like.

    [16:18:03.326 2015-02-19] [I]

    I want to enjoy this output 'plain English' as a string / string array in order to put it in the body of an email and send it to me.  I thought I was something with this code snippit:


    Enter for table error log

    var rootWorkflow = workflow.rootWorkflow;

    work output stream object

    ("Exit Debug :") system.log

    System.Debug (rootWorkflow);

    System.log("")

    natural logarithm of workflow for output to table

    ("View of events in the log Array :") system.log

    outputLogToArray = rootWorkflow.logEvents

    Scoreboard for debug temp

    for {(i in outputLogToArray)

    System.log (Server.toStringRepresentation (i))

    }

    But when viewing the table is something I didn't really know and do not really understand what she is out:

    [16:18:03.345 2015-02-19] [I] debug output:

    [16:18:03.345 2015-02-19] [D] Workflow:ch.dunes.scripting.jsmodel.JSWorkflow@47024668

    [16:18:03.345 2015-02-19] [I]

    [16:18:03.346 2015-02-19] [I] view of events in the log table:

    [16:18:03.363 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@2ab31112

    [16:18:03.363 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@5225caa4

    [16:18:03.363 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@2f1aff1e

    [16:18:03.364 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@156322bb

    [16:18:03.364 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@1f7d2df5

    [16:18:03.364 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@53543ff9

    [16:18:03.364 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@40341f2c

    [16:18:03.364 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@1deaa2a2

    [16:18:03.365 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@175b4906

    [16:18:03.365 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@6a1734e4

    [16:18:03.365 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@19919b26

    [16:18:03.365 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@2660e8e7

    [16:18:03.366 2015-02-19] [I] StringRepresentation:ch.dunes.scripting.jsmodel.JSStringRepresentation@245aa960

    and this list is long... and... and... with just the last 8 characters changing.  And oddly seems to be more and more every time I run the workflow!

    My plan was to use the contents of my table, redirect the in on the body of an email and send it.  But what I get is not really useful information.

    So, can someone tell me what is the information that I'm actually?  And is it possible to get the things that I actually wrote in the newspaper to a variable in my workflow if I can do something with it?

    My system is

    vCO device 5.5.2

    Generation 1946710

    Thanks in advance!

    Ben

    He does!  And I'll be nice and share it as well!

    Caveats

    So, I'll start by saying: I'm certainly not a professional Javascript coder.  I guess those more involved with Javascript will highlight the million mistakes that I made and I could have taken shortcuts.  It would be awesome if you could for the good of the community.

    I'll also say this works with the vCO device, there are some paths hard-coded in the log files in the underlying * ux file system of the device.  It's probably variable to be friendly to Windows, but I don't have one of those, you will be on your own looking for the right folder paths.

    It is also quite slow.  Run time for me is around the 5 minute mark.  Most of the time seems to be taken in reading through the lines of logs looking for a regular expression match.

    What it does

    Thus, the goal is: get all the content of the log file, as shown in the vCO client when you run a workflow and output it to a string in order to send it in an email to myself.

    The Action code below gets some details of the running, including the execution ID workflow.  It looks in the current log file where this text is stored and the journal previous folder in the case where newspapers spilled while the workflow is running, looking for the execution ID and the text of the line containing that run ID.  It puts it all in two tables (one for the old log file, a current).  Concatenates the two tables.  Brings together all the values in a single string with a delimiter of
    , so the string is very pretty when you send it in a HTML email.  Then, it returns the string for you to do what you want with.  I want to send by e-mail.

    And here's the code...

    Call to action what you want.  I chose getWorkflowLogContentsToString

    Define a string return type

    Copy and paste this into your action:

    Writing to System.log to identify the beginning of the action

    System.log ("Grabbing content generated by this workflow log.")

    System.log("")

    get current workflows

    currentWorkflow var = workflow.currentWorkflow;

    get the ID of the current workflow

    var workflowID = currentWorkflow.id

    System.log ("workflow ID is:" + workflowID)

    get workflows currently run id & date

    var workflowRunID = workflow.id

    System.log ("current workflow, run ID:"+ workflow.id ");

    System.log ("current workflow race start date:"+ workflow.startDate ");

    define a regular Expression to search for lines in the log file, look for the id for workflow

    var regEx = new RegExp (".") "*?" + workflowRunID + "." *", "g") ;

    workflow ID Gets the file scripting.log.1 and lists related lines

    var resultFromOlderLog = [] / / define the array variable

    var fileReadOlderLog = new FileReader("/storage/log/vmware/vco/app-server/scripting.log.1"); read in "current - 1" log file ".

    fileReadOlderLog.open (); Open the log file

    var contentsOfOlderLog = fileReadOlderLog.readAll (); read the contents of the log file

    resultFromOlderLog = contentsOfOlderLog.match (regEx); Find the lines that match RegEx and pip through the array variable

    fileReadOlderLog.close (); Close the log file

    If the old log file is not a regular expression match, add a few lines to make the table valid for future requests in this action

    If (resultFromOlderLog = null) {}

    resultFromOlderLog = ["old log file contains no items for this stream of work.", "Trying log in progress...] »] ;

    }

    workflow ID Gets the file scripting.log and lists related lines

    var resultFromCurrentLog = [] / / define the array variable

    var fileReadCurrentLog = new FileReader("/storage/log/vmware/vco/app-server/scripting.log"); read in the current log file

    fileReadCurrentLog.open (); Open the log file

    var contentsOfCurrentLog = fileReadCurrentLog.readAll (); read the contents of the log file

    resultFromCurrentLog = contentsOfCurrentLog.match (regEx); Find the lines that match RegEx and pip through the array variable

    fileReadCurrentLog.close (); Close the log file

    concatenate two bays in single table

    var allLogFileResultsArray =]

    allLogFileResultsArray = resultFromOlderLog.concat (resultFromCurrentLog)

    convert tables to the string with
    separators of HTML tag for the nice email formatting

    var allLogFileResultsString

    allLogFileResultsString = allLogFileResultsArray.join (')
    ")

    Writing to System.log to show the end of the action

    System.log ("combined log files.  Return a string to the workflow. »)

    Returns the string

    return allLogFileResultsString

    If include you this action at the end of a workflow, then channel out of the chain of it on the body of a certain type of workflow of the sender of email, it should arrive in your inbox within a few minutes.

    Observations / comments welcomed.

    Please note: I DO NOT SUPPORT this.  Use it at your own risk.  It works for me, but it might not work for you.  Plus all the other usual warnings which absolve me from any liability for any loss of data / functionality using.  Tweak it, use it as you want to satisfy your own needs.  Although I would appreciate a mention if you do publish / use anywhere.

Maybe you are looking for

  • "Update security for Microsoft Office System 2007 (KB2540162)"

    WIndows Update keeps insisting on the fact I need a "Security Update for Microsoft Office System 2007 (KB2540162)"-more funny about this, and I have MS Office 2010 this download will not install and is not going away... the pain the * Microsoft nonse

  • How do I change the prolific com port device driver 4 to the com port 1

    original title: prolific device driver When I installed Prolific he assigns the device on com port 4.  I need to assign to com port 1.  If I change my computer 4 to port 1 of the model by using the Device Manager does not recognize the software that

  • fill a dial with a connection to the local network

    I wanted to share my internet with my itouch but I can not, I was using a verizon 3g wireless device but my phone treats it as a dial-up modem... so it wont let me fill my connection with "connecting to LAN".

  • Cannot get rid of windows.old

    I've tried disk cleaner, it is not bring up the option to delete the old files. I would like to release the 20G, if I can. Thank you. JJ

  • Get the page property top of page on the navigation stack

    Hello world I have a navigation stack, and I push pages top (sometimes even several times the same page, just with a different content) The pages are custom pages Now I have the problem that I need to get a specific page in the foreground property, a