Use Generate XML/Create from XML to clone application in one

Posted by gwf on 24-Mar-2016 11:50

Is it possible to use Use Generate XML/Create from XML to clone an application within one instance on Rollbase Public Cloud? If so, a few questions:

1) Once I generate the XML file, what do I do with the id tags (not origId, which I believe should remain as is)?

2) I see that the XML file contains formulas in compressed code. Is it possible to modify the formulas as part of the cloning process with some way of batch editing them?

Thank you,

Greg

All Replies

Posted by Mani Kumar on 25-Mar-2016 01:07

Hi Greg,

Using Generate xml and importing the same by Install application into another zone/public account will clone the application to only certain extent. This will not carry data with it unless you seed each and every record (If you are seeding too many records, the performance of import/install would also be effected).

Further :

1. The ID tags are system generated and are not changeable. When you install the app onto the new zone the application ID will change accordingly (as you know, the Original ID would still remain the same). The same is with Object ID's as-well.

2. There is no such way to modify formulas to match the target zone id's if hard-coded. If you are using tokens instead, this will be taken care of.

Can you please elaborate your use case on what modifications you are referring to?

Regards,

Mani.

Posted by gwf on 28-Mar-2016 08:58

Hello Mani,

Thank you for your reply. First, to clarify, I am using XML to replicate an application within one zone/public account. The use case is that this is a project management application which I want to replicate for different projects that need to be segregated in their data, and also be able to account for some variations between them. I do not need to seed records, just set up new replicated applications which I can then add records to through importing from .xlsx files and/or manually.

For the ID tags, my question is what the XML file should look like before importing to prepare for Rollbase to create the new application, object, field, etc. IDs. For example, in these lines from the XML file:

<DataObjectDef id="?????" origId="123456" objDefName="objectA" isSystem="false" isAuditable="false" isViewable="false" isFlaggable="false" isDependent="false" isDeployed="true" >

<DataFieldDef id="?????" origId="789123" objDef="123456" columnName="INTG0" fieldName="field1" dataClassName="com.rb.core.data.definition.FieldBoolean" uiClassName="com.rb.core.ui.web.field.CheckBox" isRequired="false" isReadOnly="false" isTextIndexable="false" isSystem="false" isAuditable="false" hasPermissions="false" maxLength="0" >

When I export to XML the IDs are filled in for the original template application, so do I need to modify or delete the ID tag before importing to create a new application?

My question RE: modifying formulas is because I want expression fields generate values based on a single control record, not multiple related records. I thus need expression/formula fields and can’t use tokens (the way I understand it). Specifically, I have an object, objectA, with sets of fields following this convention:

objAField1InUse [integer expression]
objAField1Label [string expression]
objAField1Value [picklist]
objAField2InUse [integer expression]
objAField2Label [string expression]
objAField2Value [picklist]
... and so on

Records in this objectA hold data for the application.

Then I have an object, masterFieldSelector, which holds one record where I can modify the fields

mfsField1InUse [checkbox]
mfsField1Label [text]
mfsField2InUse [checkbox]
mfsField2Label [text]
... and so on

So, for objectA objAField1InUse, the expression formula would be:

function main() {

var checkbox = rbv_api.selectValue("SELECT mfsField1InUse FROM masterFieldSelector WHERE id = 246824");

return checkbox;

}

main();


And then I can modify the fields objAField1Value [picklist], objAField2Value [picklist], etc. to hold the data.

Because the expression needs to include the id, my assumption is it needs to be hard-coded into the expression.

So is there another way to do this with tokens or another approach that will allow for this flexibility and enable replicating with an XML file?

Thank you very much,

Greg

This thread is closed