remove_object and save_objects, I can not save _id not hexadecimals

800 views
Skip to first unread message

raul.ro...@efby.cl

unread,
Apr 17, 2018, 10:38:47 AM4/17/18
to Fujitsu RunMyProcess Developer Community
I could previously save and delete items with a non-hexadecimal _id
example:
<#if P_result.DBData??>
<#assign TEMP_LIST_BD=[]>
<#assign MANTENEDOR_JZ=[{"values":P_result.DBData.data,"_id":"LISTA_JEFE_ZONA"}]>
<#if "${count_objects( {'_id':'LISTA_JEFE_ZONA'}, 'BD_MANTENEDORES')}"=="0">
${save_object(MANTENEDOR_JZ,"BD_MANTENEDORES")}
<#else>
${remove_objects({"_id":"LISTA_JEFE_ZONA"},"BD_MANTENEDORES")}
${save_object(MANTENEDOR_JZ,"BD_MANTENEDORES")}
</#if>
</#if>

error:

: java.lang.IllegalArgumentException: invalid hexadecimal representation of an ObjectId: [LISTA_JEFE_ZONA]

change this logic that worked, it means a lot of extra work modifying the software

Pankaj Kumar

unread,
Apr 17, 2018, 12:21:04 PM4/17/18
to Fujitsu RunMyProcess Developer Community
Hi,

"_id" field is auto generated by mongodb when you insert a new record i.e. {"_id":{"$oid":"5ad4c9d79e87a9102cbda7d3"}.

Please use another field such as "p_key" (primary_key) to add unique value to make CURD operation on the record. This way in your data you have your custom unique key to update a specific record.

Kindly let me know if you have more query.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/c12a24be-32f2-45d4-91b0-1a0f26fded10%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Raúl Rodríguez

unread,
Apr 17, 2018, 1:20:50 PM4/17/18
to Fujitsu RunMyProcess Developer Community
the problem is that this used to work
for more than 1 year

attached image evidencing that this has already been saved.




regards


You received this message because you are subscribed to a topic in the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/3d64dVGF-ME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.



--
Raúl Rodríguez
Consultor
http://www.efby.cl




Móvil:+56 (9) 81767791
Carlos Condel 330
San Felipe, Valparaiso
Chile
Greenshot 2018-04-17 14.18.29.png

Pankaj Kumar

unread,
Apr 19, 2018, 9:04:50 AM4/19/18
to Fujitsu RunMyProcess Developer Community
Hi Raúl,

Glad to know you have updated the script to make it work. 

We need more details from you on this to answer your query:-
  • Since when old script started giving you error?
Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

Message has been deleted

Raúl Rodríguez

unread,
Apr 19, 2018, 9:21:11 AM4/19/18
to Fujitsu RunMyProcess Developer Community
I still do not correct the code

the image shown above is the information loaded in the past

when this code worked


<#if P_result.DBData??>
        <#assign TEMP_LIST_BD=[]>
        <#assign MANTENEDOR_JZ=[{"values":P_result.DBData.data,"_id":"LISTA_JEFE_ZONA"}]>
        <#if "${count_objects( {'_id':'LISTA_JEFE_ZONA'}, 'BD_MANTENEDORES')}"=="0">
                ${save_object(MANTENEDOR_JZ,"BD_MANTENEDORES")}
        <#else>
                ${remove_objects({"_id":"LISTA_JEFE_ZONA"},"BD_MANTENEDORES")}
                ${save_object(MANTENEDOR_JZ,"BD_MANTENEDORES")}
        </#if>
</#if>


now it can not be updated due to the error that did not happen before





Pankaj Kumar

unread,
Apr 19, 2018, 10:37:32 AM4/19/18
to Fujitsu RunMyProcess Developer Community
Hi Raúl,

Kindly let us know since when you are facing this error (approx date will be fine)

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Dipen Raval

unread,
Apr 23, 2018, 1:54:03 PM4/23/18
to Fujitsu RunMyProcess Developer Community
Hi Raúl,

Awaiting for your response.

Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

Raúl Rodríguez

unread,
Apr 23, 2018, 1:58:23 PM4/23/18
to Fujitsu RunMyProcess Developer Community
Hi
there's no answer

I insist that it is not correct to restrict a previously allowed functionality ...

the rework that caused this restriction was a lot and it does not correspond
(at least you must notify with time)

You received this message because you are subscribed to a topic in the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/3d64dVGF-ME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.



--
Reply all
Reply to author
Forward
0 new messages