Clarity

  • 1.  [Q] Help with GEL/Process, save as text tab delimited file.. then Email

    Posted May 02, 2011 08:30 AM
    I finally got this running ... however... I have two issues

    1. it's putting a comma at the end of each row... how do i remove that?
    >
    CLTCR,33634,04112011,CH.40000157.SC01,4.00,
    CLTCR,33634,04122011,CH.40000157.SC01,4.00,
    CLTCR,33634,04132011,CH.40000157.SC01,4.00,
    CLTCR,33634,04142011,CH.40000157.SC01,4.00,
    CLTCR,33634,04152011,CH.40000157.SC01,4.00,
    CLTCR,33634,04112011,CH.40000292.SC01,4.00,
    CLTCR,33634,04122011,CH.40000292.SC01,4.00,
    CLTCR,33634,04132011,CH.40000292.SC01,4.00,


    here is some of the code i am using: I had to put another column of the return char because it would not break on the next row... don't know if that is correct but it's getting me the results i need just the comma at the end of each row.. ^^^^
    >


    <file:writeFile delimiter="," embedded="false" fileName="${filePath}\${fileName}">



    <core:forEach trim="true" items="${results.rowsByIndex}" var="row">




    <core:forEach var="field" items="${results.columnNames}" indexVar="i" step="5">





    <file:line>






    <file:column value="${row}" />






    <file:column value="${row[i+1]}" />






    <file:column value="${row[i+2]}" />






    <file:column value="${row[i+3]}" />






    <file:column value="${row[i+4]}" />






    <file:column value="&#13;" />









    </file:line>




    </core:forEach>



    </core:forEach>


    </file:writeFile>



    2. i am getting an error when putting in a process...I am using jelly instead of GEL tags. The issue is when i "hard code" the attachement details, it works and sends the email... but when i take from parameters the same details (${filePath}${fileName} it gives the error below.

    >
    BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:112:22: <mail:email> Property 'attach' has no write method at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:671) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:259) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:180) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.IllegalArgumentException: Property 'attach' has no write method at org.apache.commons.beanutils.ConvertingWrapDynaBean.set(ConvertingWrapDynaBean.java:71) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:243) ... 9 more Root cause java.lang.IllegalArgumentException: Property 'attach' has no write method at org.apache.commons.beanutils.ConvertingWrapDynaBean.set(ConvertingWrapDynaBean.java:71) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:243) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:180) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595)


    some of the code:
    >
    ...

    xmlns:mail="jelly:email"

    ...
    <gel:parameter default="\\orlcldev\niku\Clarity\filestore" var="filePath"/>

    <gel:formatDate format="yyyy-MM-ddHH-mm" stringVar="rundate"/>


    <gel:parameter default="${rundate}TimeData.txt" var="fileName"/>

    ...

    <mail:email


    from="clarity.helpdesk@fiserv.com"


    to="keri.taylor@fiserv.com"


    CC="pat.fitzgerald@fiserv.com"


    subject="Simple email"


    attach="${filePath}\${fileName}"


    server="10.1.2.67">


    Hi,


    This is the timedata file: ${fileName}.

    </mail:email>



    any help would be appreciated.

    Keri


  • 2.  RE: [Q] Help with GEL/Process, save as text tab delimited file.. then Email

     
    Posted May 10, 2011 07:28 PM
    Hi All,

    Any further ideas here for Keri?

    Thanks!
    Chris


  • 3.  RE: [Q] Help with GEL/Process, save as text tab delimited file.. then Email
    Best Answer

    Posted May 11, 2011 11:41 AM
    Can't immediately help with the attachment issues (#2) - that looks odd, but for the comma issue (#1) I reckon the problem is that you have specified the file delimiter as a comma then used code like this;
    <file:column value="${row[i+4]}" />
    <file:column value="&#13;" /> 
    Which is actually saying "here is my last column, its content is "&#13;" and since its a column, it has helpfully put the delimiter in there for you.

    So try changing those two lines above to the single line;
    <file:column value="${row[i+4]}&#13;" />
    (i.e. don't add in a new column (containing nothing), but throw the newline at the end of the previous column)


  • 4.  RE: [Q] Help with GEL/Process, save as text tab delimited file.. then Email

    Posted May 11, 2011 03:48 PM
    Yup,. that was it Dave!! thanks so much!! :grin:

    I now have a Clarity process that gathers data from the DB, creates a flat file then it can either email the file or send it to FPT server.



    Keri