Copy collection data in TEST mode to LIVE Mode

527 views
Skip to first unread message

bestfri...@gmail.com

unread,
Nov 12, 2013, 6:27:27 PM11/12/13
to suppor...@runmyprocess.com
Hi Team,

Could you please confirm whether we can copy the data in TEST mode to the LIVE mode,as we are going to use same collection data for both the instances ?

Sabine El Rassy

unread,
Nov 13, 2013, 6:12:44 AM11/13/13
to RunMyProcess Support Forum
Hello Nagasai,

We don't have a prepackeged tool for that yet, but you can do that manually.
Here's the url to use to access the data

You can stock the data into a variable, open an interface that has the collection plugged in in a LIVE mode. Add to the url of the interface &P_attributes=tester so you'll have a link that looks as follow:
 
The P_attributes=tester allows you to have the test console like in test mode, the difference is that all of the executed javascript codes will be applied on LIVE.

Then you can use a code similar to follow:
var col= your_data_array_from_the_collection;
for(var i = 0 ; i< col.length;i++){
var my_object = col[i];
col_your_collection.saveCallback(my_object,add_ok,add_ko); 
}
function add_ok(result) {
}
function add_ko(result) {
alert("ko " + JSON.stringify(result));
}

Hope this helps you enough.

Best regards,

Sabine EL RASSY

bestfri...@gmail.com

unread,
Nov 13, 2013, 10:14:41 PM11/13/13
to suppor...@runmyprocess.com
Hi Sabine,

The data in TEST mode is around 8 lakh records which i m trying to push it to the same collection in LIVE mode.


I just copied the data from the below url

https://live.runmyprocess.com/live/2215554940/object/SP/?P_mode=TEST&P_nb=600000

and assigned it to variable - col as below


var col = [{"":""},{"":""},.....]

But the javascript is failing .....

Sabine El Rassy

unread,
Nov 14, 2013, 5:47:34 AM11/14/13
to RunMyProcess Support Forum
Hello Nagasai,

You cannot import more than 1000 object at once, so you have to loop over your data. If the collection is big, executing the code on the server side in freemarker would be faster.
So here's what you need to do: 
Create a composite API or a process with two boxes. The first box get's the content of the collection in TEST and the second one insert the data into the collection in LIVE.

Here's the config of the first box:

Input:
rmp_url = live/2215554940/object/SP/?P_mode=TEST&P_first=${P_first}&P_nb
P_first = ${P_first?default(0)?number+P_nb?default(0)?number}
P_nb = 1000

Output:
collection_content = ${collection_content?default([])+P_result.value}
continue = ${P_result.value?size!=0}

The first box will be a connector + type loop, so within the loop tab, configure as follow:
Type loop = While
Condition = "${continue}"=="true"

The second box will have the following config:

Input:
rmp_url = live/2215554940/object/SP/?P_mode=LIVE
collection_content = ${collection_content}

You'll using get anything connector for the first box and post anything connector for the second box. The connector are in the library within RMP secured connection provider.

Regards,

bestfri...@gmail.com

unread,
Nov 14, 2013, 11:28:48 AM11/14/13
to suppor...@runmyprocess.com
Hi Sabine,


In the connectors list , we could find only get anything but not post anything...


I have created process with the above mentioned steps except the post anything connector, as i was not able to find from connectors list.

I am getting below errors, when i used the same get anything which is available for both input and output

2013-11-14T16:17:55+0000 - Task "GET DATA FROM TEST COLLECTION" (id: 1[0] - status: ABORTED): Error while processing "{continue}"=="true"
Expression continue is undefined on line 1, column 4 in GET DATA FROM TEST COLLECTION.

2013-11-14T16:27:30+0000 - Task "GET DATA FROM TEST COLLECTION" (id: 1[0] - status: ACTIVE): The request could not be understood by the server due to malformed syntax

Sabine El Rassy

unread,
Nov 14, 2013, 11:35:58 AM11/14/13
to RunMyProcess Support Forum
Hello Nagasai,

The POST connector has the same config as the GET, you only need to change the Method to POST.
Give an initial value of true for the continue variable

Regards

Sabine EL RASSY

PreSales Consultant

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://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/8e225dbe-8756-455e-adb4-7b01ac872850%40runmyprocess.com.

bestfri...@gmail.com

unread,
Nov 14, 2013, 11:52:24 AM11/14/13
to suppor...@runmyprocess.com
Hi Sabine,

I have updated the POST as you mentioned , but it is failing with below error now

2013-11-14T16:42:39+0000 - Task "GET DATA FROM TEST COLLECTION" (id: 1[0] - status: ACTIVE): The request could not be understood by the server due to malformed syntax


Please find the details of the process which i have created for reference.



On Thursday, November 14, 2013 11:35:58 AM UTC-5, Sabine El Rassy wrote:
> Hello Nagasai,
>
>
> The POST connector has the same config as the GET, you only need to change the Method to POST.
> Give an initial value of true for the continue variable
>
>
>
>
> Regards
>
>
>
>
> Sabine EL RASSY
>
>
>
>
>
> PreSales Consultant
> Contact: selr...@runmyprocess.com
>
>
> Website: Fujitsu RunMyProcess
>
>
>
>
>
> 3 Rue de Gramont 
>
>
>
> 75002 Paris - France
> Mobile   : +33 (0) 6 22 10 64 61
>
>
>
>
>      
>
>
>
>
>
>
>
>
>
>
>
box-1.PNG
box-1 connector.PNG
box-1-param.PNG
box-2 param.PNG
box-2-connector.PNG
error.PNG

Sabine El Rassy

unread,
Nov 14, 2013, 12:23:26 PM11/14/13
to RunMyProcess Support Forum
Hello Nagasai,

The default value of continue should be initialized on the output of your start event not as an input for the first box.
Untick the inject results on the connector.
I can see in the screenshot of the first connector that the method is a POST. The first connector should be a get because you're retrieving data. The second connector should be a POST because you're posting data into the collection.

If you still face any problem, do not hesitate to contact us back.

Regards

bestfri...@gmail.com

unread,
Nov 14, 2013, 5:01:35 PM11/14/13
to suppor...@runmyprocess.com
Hi Sabine,

For first block , I am able to get output on Launch

When I launch the entire process by launch , it is failing with below error

2013-11-14T21:33:17+0000 - Task "GET DATA FROM TEST COLLECTION" (id: 1[0] - status: ACTIVE): The request could not be understood by the server due to malformed syntax


I have changed the first block as GET method and second as POST and continue variable at the start.

It seems some on the output variable of the first block is causing the issue.


Project name :PCN2

Process:TEST_LIVE


Please find the screenshot of the first block response on launch process


WHen i was using get anything(xml output) for the both the connectors, I am not able to make one as GET and other as POST , if i change one box, other block is changing with same method.

Hence i created a new connector for POST but no luck in copying the data.


Could you please where i was doing mistake in making the process work?

In process report,only input variables are getting displayed and while processing output variabled it seemd to be throwing error.

bestfri...@gmail.com

unread,
Nov 15, 2013, 10:32:27 AM11/15/13
to suppor...@runmyprocess.com, bestfri...@gmail.com
Please find the screenshots for reference
error2.PNG
block1- GET.PNG
block2-POST.PNG
start.PNG
output variables.PNG

Sabine El Rassy

unread,
Nov 15, 2013, 11:26:05 AM11/15/13
to RunMyProcess Support Forum, Nagasai aytha
Hello Nagasai,

I did the necessary modifications, your connector result transformation is XML so I changed it to Json.
The process should work fine now. But I did notice that you have more than 20000 entries in the collection.
Let me check if I can find a better way to copy your data. I'll get back to you as soon as possible

Kind Regards,

Sabine EL RASSY

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.

rode...@roderickforsythe.com

unread,
Sep 11, 2014, 5:59:29 PM9/11/14
to suppor...@runmyprocess.com
The solution works wonderfully!
Reply all
Reply to author
Forward
0 new messages