-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_connect_bo.pl
57 lines (38 loc) · 1.3 KB
/
test_connect_bo.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/local/perl/bin/perl
####
# Connecting Business Obejcts
####
use strict;
use eMatrix::DB;
use eMatrix::BizObj;
use eMatrix::Expand;
my $mdb = eMatrix::DB::connect("MATRIX-R",
"/app/matrixone/ematrix/scripts");
$mdb->set_context("creator", "", "eService Production");
my $rc = 0;
my @errors;
my $rel_name = "Document Structure";
my $where = qq(last == revision);
my ($bo1) = eMatrix::BizObj::query_businessobject("Document",
"steve1", "A",
$where);
my ($bo2) = eMatrix::BizObj::query_businessobject("Document",
"steve1", "B",
$where);
print "From:\n";
print $bo1->get_type(), " ", $bo1->get_name(), " ", $bo1->get_rev(),
": ", $bo1->get_oid(), "\n";
print "To:\n";
print $bo2->get_type(), " ", $bo2->get_name(), " ", $bo2->get_rev(),
": ", $bo2->get_oid(), "\n";
$rc = $bo1->connect_businessobject(
$bo2,
$rel_name
);
if ($rc) {
@errors = $mdb->get_error();
print "Error:\n";
print join("\n", @errors), "\n";
} else {
print "Success\n";
}