Clarity

 View Only
  • 1.  Custom script error

    Posted May 19, 2022 06:13 PM
    Hi all,

    Custom script is new to me, so I don't have much experience with it.

    There is a process that has a custom script in one of the steps. In this script we have a SELECT that returns the users belonging to the group selected during the registration of the idea. And then I need the script to save this data in a custom field (bnb_notificados_dir). However, we identified that this field is not being filled anymore and we could not identify the reason why this is happening.

    What could be happening? It used to work and now it doesn't anymore. I attached the bg-ca.log file and the script.

    Thanks a lot,
    Chris

    Here is a part of the error below.

    ERROR 2022-05-18 19:52:46,940 [Custom script execution pool-8-thread-4] utilities.BpmErrors (clarity:admin:51131340__D43D4ADF-2A96-4538-9486-56921FDB0887:none)

    Begin Error Information:
    Step Action Id: 5048674
    Process Instance Id: 6585353
    Step Instance Id: 7642951
    Error Code: bpm.raw.message
    Exception Trace: <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="idea"/>
    <Status elapsedTime="1.032 seconds" state="FAILURE"/>
    <Statistics failureRecords="1" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="0"/>
    <Records>
    <Record>
    <KeyInformation>
    <column name="ID">5175001</column>
    <column name="name">Demanda Teste HMG7</column>
    <column name="UNIQUE_NAME">GAPRE001285</column>
    </KeyInformation>
    <ErrorInformation>
    <Severity>ERROR</Severity>
    <Description>XOG-3656: Investment Object operation failed: update</Description>
    <Exception><![CDATA[CMN-0009: Attribute 'Notificados das diretorias responsáveis' has invalid Lookup Value '1']]></Exception>
    </ErrorInformation>
    </Record>
    </Records>
    </XOGOutput>
    </soapenv:Body>
    </soapenv:Envelope>

    End Error Information

    Attachment(s)

    zip
    bg-ca.log.zip   3 KB 1 version


  • 2.  RE: Custom script error

    Posted May 21, 2022 05:03 AM
    It looks like the attribute has its values controlled by a lookup. What are the valid values in it?

    Also if you execute this query

                 select res.id id_recurso
    			from INV_INVESTMENTS inv
    			inner join prj_obs_associations assoc1 on 
    				assoc1.record_id = inv.id and assoc1.table_name = 'INV_IDEA'
    			inner join prj_obs_units units1 on units1.id = assoc1.unit_id 
    			inner join nbi_dim_obs obs1 on units1.id = obs1.obs_unit_id	
    			inner join DEPARTMENTS dep on units1.ID = dep.obs_unit_id
    			inner join odf_multi_valued_lookups mvl on mvl.pk_id = dep.id
    			and mvl.attribute = 'bnb_grupos_acesso'
    			and mvl.object = 'department'
    			inner join cmn_sec_groups gp on mvl.value = gp.id
    			inner join cmn_sec_user_groups csug on gp.id = csug.group_id
    			inner join cmn_sec_users csu on csug.user_id = csu.id
    			inner join srm_resources res on csu.id = res.user_id
    		WHERE  inv.id = ?

    for the investment what comes back for id_recurso? It looks like it's returning 1 (the Clarity admin user) and perhaps that's not a valid value for the lookup.



  • 3.  RE: Custom script error

    Posted May 24, 2022 12:16 PM
    Hi Paul,

    When I ran the query I got the following return.


    We have board groups (with resources) where each investment belongs to one of these groups.

    The custom field created is Data Type Multi Valued Lookup - Number linked to the Lookup Resource browse. And it is in this custom field that we try to save the result of that query, but the error I reported earlier occurs.






    Do you know how to solve this?

    Thanks,
    Chris


  • 4.  RE: Custom script error

    Posted May 25, 2022 11:29 AM
    Edited by Paul Schofield May 25, 2022 11:46 AM
    I've tried to post a reply 4 times now and it never appears.

    Look at line 493 in the log files and in the list of values you'll seethe value of 1 (ie the admin user). The lookup you're using must have excluded that value so the XOG fails. Perhaps my earlier replies might show up one day.

    The fix is to remove the admin user from all the groups.





  • 5.  RE: Custom script error

    Posted May 25, 2022 01:26 PM
    Hi Paul,

    I'll test your suggestion.

    Thanks,
    Chris


  • 6.  RE: Custom script error

    Posted May 25, 2022 05:15 PM
    Final try...

    Hello again,

    I'm a bit confused - it doesn't take a lot. When you executed the query above the ID inserted was 5163004, but in the error it says the ID is 5175001:

    <column name="ID">5175001</column>

    <column name="name">Demanda Teste HMG7</column>

    <column name="UNIQUE_NAME">GAPRE001285</column>

     

    Which suggests the query as executed in the script hasn't returned the data that you see when you executed it manually.

    In the log file I see this as the error:

    Begin Error Information:

      Step Action Id: 5048674

      Process Instance Id: 6585353

      Step Instance Id: 7642951

      Error Code: bpm.raw.message

      Exception Trace: <?xml version="1.0" encoding="UTF-8"?>

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_idea.xsd">

      <Header action="write" externalSource="NIKU" objectType="idea" version="13.2.0.472"/>

      <Ideas>

        <Idea name="Demanda Teste HMG7" objectID="GAPRE001285">

          <CustomInformation>

            <ColumnValue name="partition_code">bnb_gapre</ColumnValue>

            <ColumnValue name="bnb_notificados_dir">

              <Value>1</Value>

              <Value>5008001</Value>

              <Value>5063832</Value>

              <Value>5064892</Value>

              <Value>5112006</Value>

              <Value>5127001</Value>

            </ColumnValue>

            <ColumnValue name="bnb_respon_encontrad">true</ColumnValue>

          </CustomInformation>

        </Idea>

      </Ideas>

    </NikuDataBus>

     

    End Error Information

     

    Where, as you can see, the values that have come back are not the same as the ones in your manually executed query, and they do indeed contain the value 1 (the admin user).

    I'm guessing this is the problem and 1 is not a valid value for the lookup that controls the attribute.




  • 7.  RE: Custom script error

    Posted May 25, 2022 05:16 PM
    For some reason my replies don't post...

    Here is my reply again:

    Hello again,

    I'm a bit confused - it doesn't take a lot. When you executed the query above the ID inserted was 5163004, but in the error it says the ID is 5175001:

    <column name="ID">5175001</column>

    <column name="name">Demanda Teste HMG7</column>

    <column name="UNIQUE_NAME">GAPRE001285</column>

     

    Which suggests the query as executed in the script hasn't returned the data that you see when you executed it manually.

    In the log file I see this as the error:

    Begin Error Information:

      Step Action Id: 5048674

      Process Instance Id: 6585353

      Step Instance Id: 7642951

      Error Code: bpm.raw.message

      Exception Trace: <?xml version="1.0" encoding="UTF-8"?>

    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_idea.xsd">

      <Header action="write" externalSource="NIKU" objectType="idea" version="13.2.0.472"/>

      <Ideas>

        <Idea name="Demanda Teste HMG7" objectID="GAPRE001285">

          <CustomInformation>

            <ColumnValue name="partition_code">bnb_gapre</ColumnValue>

            <ColumnValue name="bnb_notificados_dir">

              <Value>1</Value>

              <Value>5008001</Value>

              <Value>5063832</Value>

              <Value>5064892</Value>

              <Value>5112006</Value>

              <Value>5127001</Value>

            </ColumnValue>

            <ColumnValue name="bnb_respon_encontrad">true</ColumnValue>

          </CustomInformation>

        </Idea>

      </Ideas>

    </NikuDataBus>

     

    End Error Information

     

    Where, as you can see, the values that have come back are not the same as the ones in your manually executed query, and they do indeed contain the value 1 (the admin user).

    I'm guessing this is the problem and 1 is not a valid value for the lookup that controls the attribute.