Hi,
TS 6.7.1
Perl
OpenDeploy
I'm trying to deploy two dcrs an english and german. They have the xml structure and same ID, but different localeId to differentiate them. I do the following in my code
foreach my $dcr(@files) {
$dcr = &canonicalizePath("$dcr");
if ( $dcr =~ /^templatedata\/([^\/]+)\/([^\/]+)\/data\/.*$/ ) {
my $dcr_xml = "";
if (!open(XML, "$areaPath/$dcr")) {
debug("$dbgAlways", "Cannot Open DCR: $dcr ");
}
if (open(XML, "$areaPath/$dcr")) {
$dcr_xml = join "", ;
}
close(XML);
debug("$dbgAlways", "DCR : $dcr_xml ");
my $rootnode = TeamSite::XMLnode->new($dcr_xml);
my @ids;
for my $dcrNode ($rootnode->get_node_list()) {
push (@ids, $dcrNode->value('ID'));
push (@ids, $dcrNode->value('content_typeid'));
# if($dcrNode->value('LocaleID')){
push (@ids, $dcrNode->value('LocaleID'));
# }
}
my $content_id = $ids[0];
debug("$dbgAlways", "Content ID : $content_id ");
my $content_typeid = $ids[1];
debug("$dbgAlways", "Content Type ID : $content_typeid ");
my $LocaleID = $ids[2];
debug("$dbgAlways", "Locale ID : $LocaleID ");
$dcrCategory = $1;
$dcrDataType = $2;
#$ddconf = getSpecificDdConf($dcrDataType,$workarea);
$ddconf = getSpecificDdConf($dcrDataType);
debug("$dbgAlways", "$dcrDataType\n");
my $delDDCmd = "$OD_DIR/bin/iwodcmd start $ddconf -k iwdd=delete -k iwdd-op=do-sql -k user-op=delete ";
$delDDCmd .= "-k database=$database -k area=$areaPath -k dcrpath=$dcr -k contentID=$content_id -k contentTypeID=$content_typeid -k LocaleID=$LocaleID";
my $delDDOut = system ("$delDDCmd 2>&1");
debug("$dbgAlways", "Datadeploy Delete Command : $delDDCmd ");
debug("$dbgAlways", "Datadeploy Delete Status : $delDDOut ");
if($delDDOut) {
$callback_result = 1;
$comment = "Delete DataDeploy Failed";
}
my $ddCmd = "$OD_DIR/bin/iwodcmd start $ddconf -k iwdd=$dcrDataType -k area=$areaPath -k dcrpath=$dcr -k database=$database";
my $ddOut = system ("$ddCmd 2>&1");
debug("$dbgAlways", "Datadeploy Command : $ddCmd ");
debug("$dbgAlways", "Datadeploy DD Status : $ddOut ");
if($ddOut) {
$callback_result = 1;
$comment = "DataDeploy Failed";
}
my $ddSPCmd = "$OD_DIR/bin/iwodcmd start $ddconf -k iwdd=storedproc -k iwdd-op=do-sql -k user-op=execute_my_procedure ";
$ddSPCmd .= "-k database=$database -k contentID=$content_id -k contentTypeID=$content_typeid";
my $ddSPOut = system ("$ddSPCmd 2>&1");
debug("$dbgAlways", "Stored Procedure : $ddSPCmd ");
debug("$dbgAlways", "Datadeploy SP Status : $ddSPOut ");
if($ddSPOut) {
$callback_result = 1;
$comment = "Stored Procedure DataDeploy Failed";
}
# Added for error handling. Show correct message when deploy is successful.
if ($callback_result == 0){
$callback_result = 0;
$comment = "DataDeploy Success";
}
}
}
as part of my datadeploy perl script. The issue is that when run for the first time, it deletes one of the records. The logs show the following for each file:
Datadeploy Delete Status : 0
Datadeploy DD Status : 0
Datadeploy SP Status : 0
However the OpenDeploy logs show
DBD: Stat for group [Mon_Books]:
DBD: -----------------------------------
DBD: Rows inserted : 1
DBD: Rows updated : 0
DBD: Rows deleted : 1
DBD: Rows failed : 0
DBD: Rows rolled back : 0
DBD: Rows skipped : 0
DBD: -----------------------------
When I run it again both DCRs go through. It works fine in my development environment, but it doesn't in the production environment.
Could you please give me any ideas where the issue can be?
Any suggestions?
Thanks in advance