plug-in for mongodb tibco activematrix businessworks user ......plug-in for mongodb user's...

87
TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB User's Guide Software Release 6.4 August 2020

Upload: others

Post on 27-Sep-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

TIBCO ActiveMatrix BusinessWorks™

Plug-in for MongoDB

User's GuideSoftware Release 6.4August 2020

Page 2: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCHEMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (ORPROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THEEMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANYOTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS ANDCONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTEDSOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THECLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOADOR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE)OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USERLICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THESOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, ANDYOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BEBOUND BY THE SAME.

This document is subject to U.S. and international copyright laws and treaties. No part of thisdocument may be reproduced in any form without the written authorization of TIBCO Software Inc.

TIBCO, the TIBCO logo, ActiveMatrix BusinessWorks, Business Studio, and TIBCO Business Studio areeither registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or othercountries.

Java and all Java based trademarks and logos are trademarks or registered trademarks of Oracle and/orits affiliates.

All other product and company names and marks mentioned in this document are the property of theirrespective owners and are mentioned for identification purposes only.

This software may be available on multiple operating systems. However, not all operating systemplatforms for a specific software version are released at the same time. Please see the readme.txt file forthe availability of this software version on a specific operating system platform.

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICALERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESECHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCOSOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S)AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY ORINDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE,INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.

This and other products of TIBCO Software Inc. may be covered by registered patents. Please refer toTIBCO's Virtual Patent Marking document (https://www.tibco.com/patents) for details.

Copyright © 2014-2020. TIBCO Software Inc. All Rights Reserved.

2

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 3: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Contents

TIBCO Documentation and Support Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

Plug-In Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

TIBCO Business Studio Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Creating a MongoDB Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Configuring a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Testing a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Deploying an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

MongoDB Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14

Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

MongoDB Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

InsertDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22

QueryDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31

UpdateDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35

RemoveDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36

3

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 4: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40

GetMongoDBConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42

DatabaseCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44

MapReduce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49

EventListener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50

Conversations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

WaitForEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51

General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Conversations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53

MongoDB Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54

Working with the Sample Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Importing the Sample Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

4

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 5: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Configuring MongoDB Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Running the Sample Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Configuration of Sample Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Event_Sample Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

EventCleanDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61

EventInsertDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61

EventUpdateDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

EventListener.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62

OperationProcess.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

WaitForEvent.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Hierarchical_Aggregation Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65

MapReduceAggregate.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

QueryAggregate.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

CleanDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

InsertDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

QueryDocuments.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Metadata_and_Asset_Management Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

CreateDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

CreateGridFSFile.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

DeleteDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70

DeletePhoto.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

QueryDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

QueryDocumentbyIndex.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

DropIndex.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

UpdateDocument.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

GridFSPhotoOperate.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

QuerybyIndex.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

QueryJSONtoXML.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76

SaveXMLtoMongoDB.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

GeospatialQuery_Sample Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

CurrentNeighborhood.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78

RestaurantsWithinNeighborhood.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

Transaction_Sample Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79

CRUDActivities.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

DocumentLocking.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

InsertinMultipleDB.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

SubProcess.bwp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Log Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84

Log Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 6: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Setting Up Log Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

Exporting Logs to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

6

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 7: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

TIBCO Documentation and Support Services

How to Access TIBCO Documentation

Documentation for TIBCO products is available on the TIBCO Product Documentation website, mainlyin HTML and PDF formats.

The TIBCO Product Documentation website is updated frequently and is more current than any otherdocumentation included with the product. To access the latest documentation, visit https://docs.tibco.com.

Product-Specific Documentation

The following documents for this product are available on the TIBCO ActiveMatrix BusinessWorksTM

Plug-in for MongoDB documentation page:

● TIBCO ActiveMatrix BusinessWorksTM Plug-in for MongoDB Installation

● TIBCO ActiveMatrix BusinessWorksTM Plug-in for MongoDB User’s Guide

● TIBCO ActiveMatrix BusinessWorksTM Plug-in for MongoDB Release Notes

How to Contact TIBCO Support

You can contact TIBCO Support in the following ways:

● For an overview of TIBCO Support, visit http://www.tibco.com/services/support.

● For accessing the Support Knowledge Base and getting personalized content about products you areinterested in, visit the TIBCO Support portal at https://support.tibco.com.

● For creating a Support case, you must have a valid maintenance or support contract with TIBCO.You also need a user name and password to log in to https://support.tibco.com. If you do not have auser name, you can request one by clicking Register on the website.

How to Join TIBCO Community

TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matterexperts to share and access their collective experience. TIBCO Community offers access to Q&A forums,product wikis, and best practices. It also offers access to extensions, adapters, solution accelerators, andtools that extend and enable customers to gain full value from TIBCO products. In addition, users cansubmit and vote on feature requests from within the TIBCO Ideas Portal. For a free registration, go to https://community.tibco.com.

7

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 8: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Plug-In Overview

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB provides a user-friendly environment tomanage documents and files in MongoDB.

In addition to inserting, querying, updating, or removing documents or files in MongoDB, you can usethe plug-in to wait and listen for write operations in a collection in MongoDB. You can also use theplug-in to get MongoDB Connection instances, run commands on MongoDB, and perform map-reduceoperations in any collection in MongoDB.

Plug-In Architecture

The following list describes each item in the figure and the relationship between them.

● MongoDB is an open-source, document-oriented database that provides high performance, highavailability, and automatic scaling. For more information about MongoDB features andfunctionalities, visit MongoDB website at http://docs.mongodb.org/manual/.

● TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB is plugged into TIBCO ActiveMatrixBusinessWorks™ and is connected to MongoDB.

● ActiveMatrix BusinessWorks™ is an easy-to-use integration product suite for enterpriseapplications.

● TIBCO Business Studio™ is the GUI used by ActiveMatrix BusinessWorks and the plug-in to designbusiness processes, and the process engine used to execute them.

● TIBCO® Enterprise Administrator provides a centralized administrative interface to manage andmonitor the plug-in applications deployed in an enterprise.

8

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 9: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Getting Started

This tutorial is designed for the beginners who want to use TIBCO ActiveMatrix BusinessWorks Plug-infor MongoDB in TIBCO Business Studio.

All the operations are performed in TIBCO Business Studio.

See TIBCO Business Studio Overview to get familiar with TIBCO Business Studio.

A basic procedure for using ActiveMatrix BusinessWorks Plug-in for MongoDB includes:

1. Creating a Project

2. Creating a MongoDB Connection

3. Configuring a Process

4. Testing a Process

5. Deploying an Application

TIBCO Business Studio OverviewTIBCO Business Studio is an Eclipse-based integration development environment that is used todesign, develop, and test TIBCO ActiveMatrix BusinessWorks™ applications.

TIBCO Business Studio provides a workbench in which you can create, manage, and navigate resourcesin your workspace. A workspace is the central location on your machine where all data files are stored.

The workbench consists of:

1. Menu: Contains menu items such as File, Edit, Diagram, Navigate, Search, Project, Run, Window,and Help.

2. Toolbar: Contains the frequently used commands such as New , Save , Enable/Disable

Business Studio capabilities , Create a new BusinessWorks Application Module ,

Create a new BusinessWorks Shared Module , Debug , and Run

MongoDBConnectionResource .

9

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 10: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

3. Perspective: Contains an initial set and layout of views that are required to perform a certain task.TIBCO Business Studio launches the Modeling perspective by default. To change a perspective, goto Window > Open Perspective > Perspective_Name.

4. View: Displays resources. For example, the Project Explorer view displays the ActiveMatrixBusinessWorks applications, modules, and other resources in your workspace, and the Propertiesview displays the properties for the selected resource. To open a view, go to Window > Show View> View_Name.

5. Editor: Provides a canvas to configure, edit, or browse a resource. Double-click a resource in a viewto open the appropriate editor for the selected resource. For example, double-click an ActiveMatrixBusinessWorks process (MortgageAppConsumer.bwp) in the Project Explorer view to open theprocess in the editor.

6. Palette: Contains a set of widgets and a palette library. A palette groups activities that performsimilar tasks and provides quick access to activities when configuring a process.

Creating a ProjectThe first task using the plug-in is creating a project. After creating a project, you can add resources andprocesses.

An Eclipse project is an application module configured for TIBCO ActiveMatrix BusinessWorks. Anapplication module is the smallest unit of resources that is named, versioned, and packaged as part ofan application.

Procedure

1. Start TIBCO Business Studio in one of the following ways:

● Microsoft Windows: Click Start > All Programs > TIBCO > TIBCO_HOME > TIBCO BusinessStudio version_number > Studio for Designers.

● Mac OS and Linux: Run the TIBCO Business Studio executable file located in the TIBCO_HOME/studio/version_number/eclipse directory.

2. From the menu, click File > New > BusinessWorks Resources to open the BusinessWorks Resourcewizard.

3. On the "Select a wizard" page, click BusinessWorks Application Module and click Next to open theNew BusinessWorks Application Module wizard.

4. On the Project page, configure the project that you want to create:a) In the Project name field, enter a project name.b) By default, the created project is located in the workspace, which is currently in use. If you do

not want to use the default location for the project, clear the Use default location check box andclick the Browse button to select a new location.

c) Use the default version of the application module, or enter a new version in the Version field.d) Keep the Create empty process and Create Application check boxes selected to automatically

create an empty process and an application when creating the project.e) Select the Use Java configuration check box if you want to create a Java module.

A Java module provides the Java tooling capabilities.f) Click Finish to create the project.

Result

The project with the specified settings is displayed in the Project Explorer view.

10

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 11: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Creating a MongoDB ConnectionAfter creating a project, you add a MongoDB Connection shared resource to create a connectionbetween the plug-in and a MongoDB server.

Prerequisites

The MongoDB Connection shared resource is available at the Resources level. Ensure that you havecreated a project as described in Creating a Project.

Procedure

1. In the Project Explorer view, expand the project.

2. Open the MongoDB Connection wizard: Right-click the Resources folder and click New >MongoDB Connection.The resource folder, package name, and resource name of the MongoDB Connection are providedby default.

3. If required, change the default values and click Finish.

4. In the MongoDB Connection Editor, configure the MongoDB Connection shared resource.For more information regarding the configuration fields, see MongoDB Connection.

5. Click Test Connection to validate the connection.

Configuring a ProcessAfter creating a project, an empty process is created. You can add activities to the empty process tocomplete a task, such as inserting documents.

Prerequisites

Ensure that you have created an empty process when creating a project. For more details, see Creating aProject.

11

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 12: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Procedure

1. In the Project Explorer view, click the created project and open the empty process from theProcesses folder.

2. Select activities from the Palette view and drop them in the Process editor.For example, select and drop the Timer activity from the General Activities palette, and theInsertDocument activity from the MongoDB palette.

3. Click an activity in the Process editor and drag the icon to create a transition between theadded activities.

4. Configure the added MongoDB activities, as described in MongoDB Palette.

5. Click File > Save to save the project.

Testing a ProcessAfter configuring a process, you can test the process to check if the process completes your task.

Prerequisites

Ensure that you have configured a process, as described in Configuring a Process.

Procedure

1. Open the process you have configured in TIBCO Business Studio.

2. On the toolbar, click Debug > Debug Configurations.

3. Click BusinessWorks Application > BWApplication in the left pane.

Ensure that only the application that you want to debug is selected on the Applicationstab in the right pane.

4. Click Debug to test the process in the selected application.TIBCO Business Studio changes to the Debug perspective. The debug information is displayed inthe Console view.

5. On the Debug tab, expand the running process and click an activity, such as the InsertDocumentactivity.

6. In the upper-right corner, click the Job Data tab, and then click the Output tab to check the activityoutput.

12

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 13: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Deploying an ApplicationAfter testing, if the configured process works as expected, you can deploy the application that containsthe configured process to a runtime environment, and then use the bwadmin utility to manage thedeployed application.

Before deploying an application, you must generate an application archive, which is an enterprisearchive (EAR) file that is created in TIBCO Business Studio™.

Deploying an application involves the following tasks:

1. Uploading an application archive

2. Deploying an application archive

3. Starting an application

For details about how to deploy an application, see the TIBCO ActiveMatrix BusinessWorksAdministration guide.

13

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 14: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

MongoDB Connection

The MongoDB Connection shared resource contains all the necessary parameters that have to beconfigured when you use the plug-in to connect to the MongoDB server. The MongoDB Connection isused by all the activities in the MongoDB palette.

For details about how to create a MongoDB connection, see Creating a MongoDB Connection.

GeneralThe following table describes the fields on the General tab:

FieldModuleProperty? Description

Package No The name of the package where the shared resource is located

Name No The name of the shared resource

Description No A short description for the shared resource

ConfigurationThe following table describes the fields on the Configuration tab:

Field

ModuleProperty? Description

PlainURL Yes Select this check box to manually enter the URL for the server.

ConnectionURL Yes Enter the server URL to which the plug-in connects.

Condition: Available only when the PlainURL check box isselected

Default value:mongodb://localhost:27017/?connectTimeoutMS=10000&socketTimeoutMS=0&waitQueueTimeoutMS=120000&maxPoolSize=100

The default value is for an on-premises setup. To connect to theMongoDB Atlas database, you can change it to the SRV recordURL.

Example SRV record URL:mongodb+srv://<Cluster URL>/

If you enter the SRV record URL, then on the Securitytab, you must select the credential type as SHACredential.

14

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 15: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Field

ModuleProperty? Description

SRV Record Yes Select this check box to use MongoDB Atlas.

If you select the SRV Record check box, then on theSecurity tab, you must select the credential type asSHA Credential.

HostPort Yes Specify the host and connection port for the MongoDB server.

Default value: localhost:27017

DatabaseName Yes Specify the database that you want to connect to.

Default value: databaseName

ConnectTimeout(milliseconds)

Yes Specify the maximum duration for which a MongoDB driverwaits for a connection to be established with a MongoDB server.

Default value: 10000 milliseconds

SocketTimeout(milliseconds)

Yes Specify the maximum duration for which a socket waits for amessage sent by the server or the plug-in.

Default value: 0 milliseconds

Server SelectTimeout(milliseconds)

Yes Specify the duration for which the driver waits for serverselection to succeed before throwing an exception.

● Default value: 30000 milliseconds● 0: If the value is 0, the test connection times out immediately,

irrespective of whether the server is available.

● After clearing a manually entered value: In this field, if youdelete a manually entered value and then leave the fieldblank, the last value specified before clearing the field isdisplayed as the field value.

MaxWaitTime(milliseconds)

Yes Specify the maximum duration for which a thread waits for asocket from the connection pool.

Default value: 120000 milliseconds

MaxPoolSize Yes Specify the maximum number of connections in the connectionpool.

Default value: 100

15

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 16: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

SecurityThe Security tab contains the authentication fields required to establish a secure connection with theMongoDB server.

FieldModuleProperty? Description

Credential Type Yes Select the credential authentication to verify the user name andpassword when connecting to a MongoDB database. Thefollowing credential types are available:

● None

● CR Credential

● SHA Credential

● Kerberos

On the Configuration tab, if you enter the SRV recordURL or select the SRV Record check box, you mustselect the credential type as SHA Credential.

UserName Yes Specify the user name you created in the MongoDB database.

Condition: Available only when CR Credential, SHACredential, or Kerberos is selected

Password Yes Specify the password that is used to access the database.

Condition: Available only when CR Credential or SHACredential is selected

SSL Yes Select this check box if you want to use the SSL authentication.

Key File Yes Specify the key file that your deployment uses to verify the userand the server.

Condition: Available only when the SSL check box is selected

Key Password Yes Specify the key password.

Condition: Available only when the SSL check box is selected

Trust File Yes Specify the trust file with CA.

Condition: Available only when the SSL check box is selected

Trust Password Yes Specify the trust password.

Condition: Available only when the SSL check box is selected

Allow InvalidHostnames

Yes When this check box is selected, MongoDB disables thevalidation of the host names in SSL certificates, allowingMongoDB to connect to the clients even if the host name in theircertificates does not match the specified host name.

16

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 17: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

X509 Credential Yes Select this check box to use X.509 credential to connect to theMongoDB server.

Condition: Available only when the SSL check box is selected

The SSL authentication works one-way when the Key File and Key Password fields are empty.

17

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 18: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

MongoDB Palette

A palette groups the activities that connect the same external applications together. The MongoDBpalette is added to TIBCO Business Studio after installing TIBCO ActiveMatrix BusinessWorks Plug-infor MongoDB.

The MongoDB palette contains the following activities:

● InsertDocument

● QueryDocument

● UpdateDocument

● RemoveDocument

● GetMongoDBConnection

● DatabaseCommand

● MapReduce

● EventListener

● WaitForEvent

InsertDocumentYou can use the InsertDocument activity to insert documents into a collection or insert files into abucket.

GeneralThe following table describes the fields on the General tab of the InsertDocument activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process.

Default value: InsertDocument

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResourceResource Template dialog box, which lists all theavailable resources.

2. In the Matching items panel, select a shared resourceand click OK.

Collection Name Yes Specify the name for the collection where documents areinserted. Adhere to the following rules when specifyingthe collection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as$.

18

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 19: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Write Concern Yes Select an assurance that MongoDB provides when itreports on the success of a write operation. The strengthof a write concern determines the level of an assurance.When the plug-in performs a write operation with a weakwrite concern, the write operation is returned quickly.While the plug-in performs a write operation with astrong write concern, the client has to wait for theMongoDB to confirm the write operation before reportingthe result of the operation.

The write concern selected for the first activityinside a transaction group is used astransaction level write concern. All theactivities are executed using this write concern,ignoring the write concern that is selected forthe remaining activities inside the transactiongroup.

Select a write concern from the following list, rankedfrom the weakest to the strongest:

● UNACKNOWLEDGED

With an unacknowledged write concern, MongoDBdoes not acknowledge the receipt of a write operationand the write operation is returned as soon as themessage is written to the socket. Only network errorsare captured and handled.

● ACKNOWLEDGED

With an acknowledged write concern, a writeoperation waits for an acknowledgment from theprimary server before returning a result. Network,duplicate key, and other errors are captured andhandled.

● JOURNALED

With a journaled write concern, MongoDBacknowledges a write operation after committing thedata to the journal. Both network issues and servererrors are captured and handled. This type of writeconcern ensures that MongoDB can recover the data ifthere is a shutdown or power interruption emergency.Before using this type of write concern, you must havejournaling enabled.

● FSYNCED

With an fsynced write concern, a write operation waitsfor the server to flush data to the disk before returninga result. Network, duplicate key, and other errors arecaptured and handled.

● REPLICA_ACKNOWLEDGED

With a replica acknowledged write concern, a writeoperation waits for acknowledgments from at least 2

19

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 20: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

servers before returning a result. Network, duplicatekey, and other errors are captured and handled.

● MAJORITY

With a majority write concern, a write operation waitsfor acknowledgments from a majority of serversbefore returning a result. Network, duplicate key, andother errors are captured and handled.

Continue On Error Yes Select this check box if you want the remaining insertoperations to continue when an error occurs.

This does not affect the local transactions.

Is GridFS No Select this check box if you want to insert one or morefiles into a bucket.

GridFS is a specification for storing andretrieving files that exceed the BSON-documentsize limit of 16 MB.

This option is not supported by the local transactions.

DescriptionOn the Description tab, add a short description for the InsertDocument activity.

AdvancedThe following table describes the fields on the General tab of the InsertDocument activity.

FieldModuleProperty? Description

Override TransactionBehavior

No When this check box is selected, the activity does notparticipate in the transaction even if it is a part of thetransaction group. However, if such an activity fails, theentire transaction fails.

20

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 21: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

InputThe following table describes the fields on the Input tab of the InsertDocument activity.

Input Item Data Type Description

CollectionName String Specify a name for the collection where documents areinserted, within single or double quotation marks.Adhere to the following rules when specifying thecollection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as$.

The value specified in this field overwrites the valuespecified in the Collection Name field of the Generaltab.

Document String Enter a document name in this field within doublequotation marks. This document is inserted in thespecified collection.

To insert multiple documents in a collection,you can duplicate the Document node byhovering your cursor over the Document nodeand right-clicking to select Duplicate.

ContinueOnError Boolean Enter true() in this field if you want the remaininginsert operations to continue even when an error occurs.Otherwise, leave this field blank.

If you select the Continue On Error check boxon the General tab, leave this field blank.

IndexDocument String Enter a document name within double quotation marksto index documents in the specified collection. The indexdocument can be further used in querying documents.

For more information about creating an index, see http://docs.mongodb.org/manual/administration/indexes-creation/.

IndexOptionsDocument String Enter an index type for the index document withindouble quotation marks, such as "{unique:1}".

For more information about the index options, see http://docs.mongodb.org/manual/core/index-properties/

For more information about createIndex method, see https://docs.mongodb.com/v3.0/reference/method/db.collection.createIndex/

The following fields are displayed when the Is GridFS check box is selected on the General tab.

21

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 22: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

BucketName String Specify the name for the bucket, where files are inserted,within single or double quotation marks. Adhere to thefollowing rules when specifying the bucket name:

● Do not start the bucket name with system.

● Do not contain empty strings, and characters such as$.

GridFSFile N/A This node supports duplication.

To insert multiple files into a bucket, you canduplicate the GridFSFile node by hoveringyour cursor over the GridFSFile node andright-clicking to select Duplicate.

FullFileName String Enter the absolute path for the file within single ordouble quotation marks. This file is inserted in thespecified bucket.

At least 8 GB memory is required for themachine, if the inserted file is 1 GB.

NewFileName String Enter a new name for the file within single or doublequotation marks when you insert it into a bucket. Thenew file name can be used when you query the file.

OutputThe following table describes the items on the Output tab of the InsertDocument activity.

Output Item Data Type Description

ResultDocument String The document that records the returned value after usingthe InsertDocument activity.

TotalCount Integer The total documents that are inserted in the specifiedcollection.

SucceedNum Integer The total documents that are successfully inserted in thespecified collection.

FailedNum Integer The total documents that are not successfully inserted in thespecified collection.

FaultThe following table describes the error schema on the Fault tab of the InsertDocument activity.

Error SchemaElement Data Type Description

MongoDBPluginException

22

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 23: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error SchemaElement Data Type Description

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the InsertDocument activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the InsertDocument activity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-relatedexception occurs.

JSONParseException

msg String This error message is displayed when an invalid JSON objectis passed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON object ispassed to the JSON parser.

DuplicateKeyException

msg String This error message is displayed when an error of duplicatekey occurs.

msgCode String This error code is displayed when an error of duplicate keyoccurs.

23

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 24: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

QueryDocumentYou can use the QueryDocument activity to query documents from a collection or query files from abucket.

GeneralThe following table describes the fields on the General tab of the QueryDocument activity.

FieldModuleProperty ? Description

Name No The name of the activity displayed in the process.

Default value: QueryDocument

MongoDBConnection

Yes Select a shared resource by completing the following steps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResource ResourceTemplate dialog box, which lists all the availableresources.

2. In the Matching items panel, select a shared resource andclick OK.

Collection Name Yes Specify the name for the collection where documents arequeried. Adhere to the following rules when specifying thecollection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as $.

Query Type Yes Specify the query type that you want to use. The followingoptions are available:

● FIND_ONE

Finds the first document that matches the query condition.

● FIND_MANY

Finds all documents that match the query condition.

● COUNT

Counts the total number of documents that match thequery condition.

● DISTINCT

Finds an array of distinct values for a specified field indocuments.

● AGGREGATE

Processes documents in a collection by using versatilestage-based data processing pipeline or map-reduceoperations.

24

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 25: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty ? Description

Read Preference Yes Select the read preference when the plug-in queriesdocuments from a collection. The following options areavailable:

● PRIMARY

Reads from the primary member of a replica set.

● PRIMARY_PREFERRED

Reads from the primary member preferentially, but if theprimary member is unavailable, reads from secondarymembers of a replica set.

● SECONDARY

Reads from secondary members of a replica set.

● SECONDARY_PREFERRED

Reads from secondary members preferentially, but if nosecondary members are available, reads from the primarymember of a replica set.

● NEAREST

Reads from a member of a replica set with the leastnetwork latency, irrespective of the member type of thereplica set.

The query preference functionality does not supportthe aggregate query type. When you selectAGGREGATE from the Query Type list, the ReadPreference list is unavailable.

Read Preference selected for the first acitivity insidetransaction group is used as transaction level readpreference.All QueryDocument activities areexecuted using that read preference ignoring theread preference selected for the remainingQueryDocument activities inside the transactiongroup.

Is GridFS Yes Select this check box if you want to query one or more filesfrom a bucket.

GridFS is a specification for storing and retrievingfiles that exceed the BSON-document size limit of 16MB.

This option is not supported by the local transactions.

25

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 26: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty ? Description

File Query Type Yes Select a file query type from the following list:

● FIND_ONE

Finds the first file that matches the query condition.

● FIND_MANY

Finds all files that match the query condition.

Condition: Available only when the Is GridFS check box isselected

File ContentOutput Type

Yes Select an output type for a file from the following list:

● JAVA_OBJECT

Produces an object that contains the returned file contentas the output.

● BINARY

Produces a byte array as the output.

● WRITE_TO_FILE

Creates a new file that contains the returned file content.

Condition: Available only when the Is GridFS check box isselected

DescriptionOn the Description tab, add a short description for the QueryDocument activity.

AdvancedThe following table describes the fields on the General tab of the InsertDocument activity.

FieldModuleProperty? Description

Override TransactionBehavior

No When this check box is selected, the activity does notparticipate in the transaction even if it is a part of thetransaction group. However, if such an activity fails, the entiretransaction fails.

26

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 27: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Lock Document No When this check box is selected, the document specified inQueryDocument input is locked by updating the documentwith a new attribute LockID and is set to a value that is ofObjectId data type. Every time the document is locked thevalue is modified. Once the write lock is obtained on thedocument any concurrent write operations on the samedocument give writeconflict error. For Query typeFIND_ONE, when Lock Document checkbox is checked,locking only the first document that matches the input givenin Query Document. For the Query Types FIND_MANY,COUNT, DISTINCT locking all the documents that match theinput given in the Query Document. This feature is notapplicable for the query type AGGREGATE.

InputThe following table describes the fields on the Input tab of the QueryDocument activity.

Input Item Data Type Description

The following fields are displayed when FIND_ONE in the Query Type list is selected on theGeneral tab.

CollectionName String In single or double quotation marks, specify the name ofthe collection where query operations are performed.

The value specified in this field overwrites thevalue specified in the Collection Name fieldof the General tab.

QueryDocument String Enter a document name within double quotation marks.This document is used to query one or more documentsfrom the collection.

ReturnFieldsDocument String Enter a document name within double quotation marks.This document is used to decide the return field valuesin the queried documents.

SortDocument String Enter a document name within double quotation marks.This document is used to define the sequence of thedocuments in the query result.

The following fields are displayed when FIND_MANY in the Query Type list is selected on theGeneral tab.

CollectionName String In single or double quotation marks, specify the name ofthe collection where query operations are performed.

The value specified in this field overwrites thevalue specified in the Collection Name fieldof the General tab.

27

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 28: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

QueryDocument String Enter a document name within double quotation marks.This document is used to query one or more documentsfrom a specified collection.

ReturnFieldsDocument String Enter a document name within double quotation marks.This document is used to decide the return field valuesin the queried documents.

Skip Integer Enter a number to decide how many documents to skipbefore the query result is displayed.

Limit Integer Enter a number to decide how many documents todisplay in the query result.

HintDocument String Enter a document name within double quotation marks.This document contains an index name or indexspecification and is used to overwrite the default indexin a collection.

SortDocument Integer Enter a document name within double quotation marks.This document is used to define the sequence of thedocuments in the query result.

The following fields are displayed when COUNT in the Query Type list is selected on the Generaltab.

CollectionName String In single or double quotation marks, specify the name ofthe collection where query operations are performed.

The value specified in this field overwrites thevalue specified in the Collection Name fieldof the General tab.

QueryDocument String Enter a document name within double quotation marks.This document is used to query one or more documentsfrom a specified collection.

Skip Integer Enter a number to decide how many documents to skipbefore the query result is displayed.

Limit Integer Enter a number to decide how many documents todisplay as the query result.

The following fields are displayed when DISTINCT in the Query Type list is selected on theGeneral tab.

CollectionName String Specify the name of the collection (within single ordouble quotation marks) where query operations areperformed.

The value specified in this field overwrites thevalue specified in the Collection Name fieldof the General tab.

28

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 29: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

QueryDocument String Enter a document name within double quotation marks.This document is used to query one or more documentsfrom the collection.

DistinctField String Enter a field name within single or double quotationmarks. This value decides the distinct field valuesreturned from the queried documents.

The following fields are displayed when Aggregate in the Query Type list is selected on the Generaltab.

CollectionName String In single or double quotation marks, specify the name ofthe collection where query operations are performed.

The value specified in this field overwrites thevalue specified in the Collection Name fieldof the General tab.

Document String Enter a document name within double quotation marks.This document contains an aggregation pipeline or amap-reduce operation and is used to perform anaggregation in a collection.

For more information on defining an aggregationpipeline or a map-reduce operation, see http://docs.mongodb.org/manual/core/aggregation-introduction.

The following fields are displayed when the Is GridFS check box, and FIND_ONE in the File QueryType list are selected on the General tab.

BucketName String In single or double quotation marks, enter the name ofthe bucket where you can query a matching file.

FileName String Enter the name for the file within single or doublequotation marks.

GenerateNewFile String In double quotation marks, enter the absolute path forthe file where you want to save the query output result.

Condition: Available only when WRITE_TO_FILE inthe File Content Output Type list is selected on theGeneral tab.

The following fields are displayed when the Is GridFS check box, and FIND_MANY in the FileQuery Type list are selected on the General tab.

BucketName String In single or double quotation marks, enter the name ofthe bucket where you can query all matching files.

QueryDocument String Enter a document name in double quotation marks. Thisdocument is used to query files from a bucket.

29

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 30: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

OutputFileDirectory String In single or double quotation marks, enter the directoryfor the output file.

Condition: Available only when WRITE_TO_FILE inthe File Content Output Type list is selected on theGeneral tab

OutputThe following table describes the items on the Output tab of the QueryDocument activity.

Output Item Data Type Description

The following item is displayed only when FIND_ONE in the QUERY TYPE list is selected on theGeneral tab.

Document String The first document that matches the query condition

The following items are displayed only when FIND_MANY in the QUERY TYPE list is selected onthe General tab.

Document String All documents that match the query condition, or an emptyset if no documents match the query condition

TotalCount Integer The total number of documents that match the querycondition in the specified collection

RemainingCount Integer The total number of documents that match the querycondition but that are not displayed in the output result

The following item is displayed only when COUNT in the QUERY TYPE list is selected on theGeneral tab.

Count Integer The total number of documents that match the querycondition in the specified collection

The following item is displayed only when DISTINCT in the QUERY TYPE list is selected on theGeneral tab.

Object String The document that contains an array of distinct values ofthe specified field

The following item is displayed only when AGGREGATE in the QUERY TYPE list is selected on theGeneral tab.

Document String The document that contains the aggregation result of themap-reduce operation or aggregation pipeline

The following items are displayed only when the IS GridFS check box, and JAVA_OBJECT in theFILE CONTENT OUTPUT TYPE list are selected on the General tab.

Document String The document that contains data from the queried file

30

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 31: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Output Item Data Type Description

QueryFileContentStream

Java Object The instance of a file stream returned by theQueryDocument activity

The following items are displayed only when the IS GridFS check box, and BINARY in the FILECONTENT OUTPUT TYPE list are selected on the General tab.

Document String The document that contains data from the queried file

BinaryContent Binary The file content returned as Binary

The following items are displayed only when the IS GridFS check box, and WRITE_TO_FILE in theFILE CONTENT OUTPUT TYPE list are selected on the General tab.

Document String The document that contains data from the queried file

FileName String The file name returned after using the QueryDocumentactivity

FaultThe following table describes the error schema elements on the Fault tab of the QueryDocumentactivity:

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the QueryDocument activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the QueryDocument activity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-related exceptionoccurs.

JSONParseException

31

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 32: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error SchemaElement Data Type Description

msg String This error message is displayed when an invalid JSON object ispassed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON object ispassed to the JSON parser.

CursorNotFoundException

msg String This error message is displayed when a cursor is not found.

msgCode String This error code is displayed when a cursor is not found.

UpdateDocumentYou can use the UpdateDocument activity to update documents in a collection.

GeneralThe following table describes the fields on the General tab of the UpdateDocument activity.

FieldModuleProperty ? Description

Name No The name of the activity displayed in the process.

Default value: UpdateDocument

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource iconto open the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared and clickOK.

Collection Name Yes Specify the name for the collection where documents areupdated. Adhere to the following rules when specifyingthe collection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as$.

32

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 33: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty ? Description

Write Concern Yes Select an assurance that MongoDB provides when itreports on the success of a write operation.

The strength of a write concern determines thelevel of an assurance. When the plug-inperforms a write operation with a weak writeconcern, the write operation is returnedquickly. While the plug-in performs a writeoperation with a strong write concern, theclient has to wait for the MongoDB to confirmthe write operation before reporting the resultof the operation.

Select a write concern from the following list, rankedfrom the weakest to the strongest:

● UNACKNOWLEDGED

With an unacknowledged write concern, MongoDBdoes not acknowledge the receipt of a write operationand the write operation is returned as soon as themessage is written to the socket. Only network errorsare captured and handled.

● ACKNOWLEDGED

With a receipt acknowledged write concern, a writeoperation waits for an acknowledgment from theprimary server before returning a result. Network,duplicate key, and other errors are captured andhandled.

● JOURNALED

With a journaled write concern, MongoDBacknowledges a write operation after committing thedata to the journal. Both network issues and servererrors are captured and handled. This type of writeconcern ensures that MongoDB can recover the dataif there is a shutdown or power interruptionemergency. Before using this type of write concern,you must have journaling enabled.

● FSYNCED

With a fsynced write concern, a write operation waitsfor the server to flush data to the disk beforereturning a result. Network, duplicate key, and othererrors are captured and handled.

● REPLICA_ACKNOWLEDGED

With a replica acknowledged write concern, a writeoperation waits for acknowledgments from at least 2servers before returning a result. Network, duplicatekey, and other errors are captured and handled.

● MAJORITY

33

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 34: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty ? Description

With a majority write concern, a write operationwaits for acknowledgments from a majority ofservers before returning a result. Network, duplicatekey, and other errors are captured and handled.

Continue On Error Yes Select this check box if you want the remaining updateoperations to continue when an error occurs.

This does not affect the local transactions.

DescriptionOn the Description tab, add a short description for the UpdateDocument activity.

AdvancedThe following table describes the fields on the General tab of the InsertDocument activity.

FieldModuleProperty? Description

Override TransactionBehavior

No When this check box is selected, the activity does notparticipate in the transaction even if it is a part of thetransaction group. However, if such an activity fails, theentire transaction fails.

InputThe following table describes the fields on the Input tab of the UpdateDocument activity.

Input Item Data Type Description

CollectionName String In single or double quotation marks, specify the name forthe collection where documents are updated. Adhere to thefollowing rules when specifying the collection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as $.

The value specified in this field overwrites the valuespecified in the Collection Name field on the General tab.

Query Document String Enter a document name in double quotation marks. Thisdocument is used to query one or more documents from thespecified collection.

Update Document String Enter a document name in double quotation marks. Thisdocument is used to update one or more documents fromthe specified collection.

34

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 35: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

Upsert Boolean Enter true() in this field if you want to insert the documentspecified in the UpdateDocument field when no matchingdocument is found.

Multi Boolean Enter true() in this field if you want to update multipledocuments that match the query condition.

ContinueOnError Boolean Enter true() in this field if you want the remaining updateoperations to continue when an error occurs.

If you select the Continue On Error check box onthe General tab, leave this field blank.

OutputThe following table describes the items on the Output tab of the UpdateDocument activity.

Output Item Data Type Description

ResultDocument String The document that records the status of theUpdateDocument activity.

SucceedNum Integer The total number of documents that are updatedsuccessfully in the specified collection.

FailedNum Integer The total number of documents that are not successfullyupdated in the specified collection.

Upserts Integer The new document or documents that are inserted in thespecified collection.

FaultThe following table describes the error schema elements on the Fault tab of the UpdateDocumentactivity.

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the UpdateDocument activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the UpdateDocument activity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

35

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 36: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error SchemaElement Data Type Description

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-relatedexception occurs.

JSONParseException

msg String This error message is displayed when an invalid JSON objectis passed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON object ispassed to the JSON parser.

RemoveDocumentYou can use the RemoveDocument activity to remove documents from a collection or remove files froma bucket.

GeneralThe following table describes the fields on the General tab of the RemoveDocument activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process.

Default value: RemoveDocument

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared resourceand click OK.

36

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 37: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Collection Name Yes Specify the name for the collection where documents areremoved. Adhere to the following rules when specifyingthe collection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as$.

37

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 38: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Write Concern Yes Select an assurance that MongoDB provides when itreports on the success of a write operation.

The strength of a write concern determines thelevel of an assurance. When the plug-inperforms a write operation with a weak writeconcern, the write operation is returnedquickly. While the plug-in performs a writeoperation with a strong write concern, theclient has to wait for the MongoDB to confirmthe write operation before reporting the resultof the operation.

Select a write concern from the following list, rankedfrom the weakest to the strongest:

● UNACKNOWLEDGED

With an unacknowledged write concern, MongoDBdoes not acknowledge the receipt of a write operationand the write operation is returned as soon as themessage is written to the socket. Only network errorsare captured and handled.

● ACKNOWLEDGED

With an acknowledged write concern, a writeoperation waits for an acknowledgment from theprimary server before returning a result. Network,duplicate key, and other errors are captured andhandled.

● JOURNALED

With a journaled write concern, MongoDBacknowledges a write operation after committing thedata to the journal. Both network issues and servererrors are captured and handled. This type of writeconcern ensures that MongoDB can recover the data ifthere is a shutdown or power interruption emergency.Before using this type of write concern, you musthave journaling enabled.

● FSYNCED

With a fsynced write concern, a write operation waitsfor the server to flush data to the disk before returninga result. Network, duplicate key, and other errors arecaptured and handled.

● REPLICA_ACKNOWLEDGED

With a replica acknowledged write concern, a writeoperation waits for acknowledgments from at least 2servers before returning a result. Network, duplicatekey, and other errors are captured and handled.

● MAJORITY

38

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 39: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

With a majority write concern, a write operation waitsfor acknowledgments from a majority of serversbefore returning a result. Network, duplicate key, andother errors are captured and handled.

Continue On Error Yes Select this check box if you want the remaining removeoperations to continue when an error occurs.

This does not affect the local transactions.

Is GridFS No Select this check box if you want to remove one or morefiles from a bucket.

This option is not supported by the localtransactions.

DescriptionOn the Description tab, add a short description for the RemoveDocument activity.

AdvancedThe following table describes the fields on the General tab of the InsertDocument activity.

FieldModuleProperty? Description

Override TransactionBehavior

No When this check box is selected, the activity does notparticipate in the transaction even if it is a part of thetransaction group. However, if such an activity fails, theentire transaction fails.

InputThe following table describes the fields on the Input tab of the RemoveDocument activity.

Input Item Data Type Description

CollectionName String In single or double quotation marks, enter the name for thecollection where documents are removed.

The value specified in this field overwrites thevalue specified in the Collection Name field of theGeneral tab.

QueryDocument String Enter a document name in double quotation marks. Thisdocument is used to query one or more documents from aspecified collection.

39

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 40: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

ContinueOnError Boolean Enter true() in this field if you want the remaining removeoperations to continue when an error occurs.

If you select the Continue On Error check box onthe General tab, leave this field blank.

Multi Boolean Enter true() in this field if you want to remove alldocuments that match the query condition.

The following fields are displayed when the Is GridFS check box is selected on the General tab.

BucketName String In single or double quotation marks, enter the name for thebucket where one or more files are removed.

QueryDocument String Enter a document name in double quotation marks. Thisdocument is used to query one or more files from a bucket.

OutputThe following table describes the items on the Output tab of the RemoveDocument activity.

Output Item Data Type Description

ResultDocument String The document that records the returned value after using theRemoveDocument activity.

SucceedNum Integer The total number of documents that are successfully removedfrom the specified collection.

FailedNum Integer The total number of documents that are not successfullyremoved from the specified collection.

FaultThe following table describes the error schema elements on the Fault tab of the RemoveDocumentactivity.

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the RemoveDocument activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the RemoveDocument activity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

40

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 41: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error SchemaElement Data Type Description

msgCode String This error code is displayed when MongoDB encounters internalerrors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-related exceptionoccurs.

JSONParseException

msg String This error message is displayed when an invalid JSON object ispassed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON object ispassed to the JSON parser.

GetMongoDBConnectionYou can use the GetMongoDBConnection activity to get a MongoDB Connection instance, which can beused in Java Code activities to perform operations in MongoDB.

GeneralThe following table describes the fields on the General tab of the GetMongoDBConnection activity.

FieldModuleProperty ? Description

Name No The name of the activity displayed in the process.

Default value: GetMongoDBConnection

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared resourceand click OK.

DescriptionOn the Description tab, add a short description for the GetMongoDBConnection activity.

41

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 42: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

OutputThe following table describes the item on the Output tab of the GetMongoDBConnection activity.

Output Item Data Type Description

MongoDBConnection Accessor

Java Object The instance of the MongoDB connection obtained by theGetMongoDBConnection activity. The definition of theinstance:

com.tibco.bw.palette.mongodb.runtime.resources.Mo

ngoDBConnectionAccessorImpldb8d5e37-6926-47ea-93b

f-a7c0129ead29

FaultThe following table describes the error schema element on the Fault tab of the GetMongoDBConnectionactivity.

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the GetMongoDBConnectionactivity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the GetMongoDBConnectionactivity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-related exceptionoccurs.

DatabaseCommandYou can use the DatabaseCommand activity to run commands in a MongoDB database.

For more details about the commands supported by MongoDB, see http://docs.mongodb.org/manual/reference/command/.

42

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 43: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

GeneralThe following table describes the fields on the General tab of the DatabaseCommand activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process.

Default value: DataBaseCommand

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource iconto open the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared resourceand click OK.

Read Reference Yes Select the read preference when the plug-in readsdocuments from a collection. Select one from thefollowing list:

● PRIMARY

Reads from the primary member of a replica set.

● PRIMARY_PREFERRED

Reads from the primary member preferentially, butif the primary member is unavailable, reads fromsecondary members of a replica set.

● SECONDARY

Reads from secondary members of a replica set.

● SECONDARY_PREFERRED

Reads from secondary members preferentially, but ifno secondary members are available, reads from theprimary member of a replica set.

● NEAREST

Reads from a member of a replica set with the leastnetwork latency, irrespective of the member type ofthe replica set.

DescriptionOn the Description tab, add a short description for the DatabaseCommand activity.

43

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 44: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

InputThe following table describes the field on the Input tab of the DatabaseCommand activity.

Input Item Data Type Description

Document String Enter a document name in double quotation marks. Thedocument contains the database command that you can use toperform operations in a database.

OutputThe following table describes the item on the Output tab of the DatabaseCommand activity.

Output Item Data Type Description

ResultDocument String The document that records the value returned by theDatabaseCommand activity.

FaultThe following table describes the error schema elements on the Fault tab of the DatabaseCommandactivity.

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the DatabaseCommand activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the DatabaseCommand activity.

MongoException

msg String This error message is displayed when MongoDB encountersinternal errors.

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-relatedexception occurs.

JSONParseException

44

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 45: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error SchemaElement Data Type Description

msg String This error message is displayed when an invalid JSON objectis passed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON object ispassed to the JSON parser.

MapReduceYou can use the MapReduce activity to perform map-reduce and finalize operations to performaggregations in a collection by using custom JavaScript functions.

GeneralThe following table describes the fields on the General tab of the MapReduce activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process.

Default value: MapReduce

MongoDBConnection

Yes Select a shared resource by completing the following steps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared resourceand click OK.

Collection Name Yes Specify the name for the collection where map and reduceoperations are performed. Adhere to the following ruleswhen specifying the collection name:

● Do not start the collection name with system.

● Do not contain empty strings, and characters such as $.

45

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 46: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Read Preference Yes Select the read preference when the plug-in readsdocuments from a collection. Select one from the followinglist:

● PRIMARY

Reads from the primary member of a replica set.

● PRIMARY_PREFERRED

Reads from the primary member preferentially, but ifthe primary member is unavailable, reads fromsecondary members of a replica set.

● SECONDARY

Reads from secondary members of a replica set.

● SECONDARY_PREFERRED

Reads from secondary members preferentially, but if nosecondary members are available, reads from theprimary member of a replica set.

● NEAREST

Reads from a member of a replica set with the leastnetwork latency, irrespective of the member type of thereplica set.

Map Function No Enter your JavaScript in the Map Function field.

The map function maps an operation in everydocument in a collection. This operation emitskey and value pairs.

Reduce Function No Enter your JavaScript in the Reduce Function field.

The reduce function reduces all values of aspecific key to one element which contains theresult.

Finalize Function No Enter your JavaScript in the Finalize Function field.

The finalize function follows the reduce functionand is used to modify the output result.

DescriptionOn the Description tab, add a short description for the MapReduce activity.

46

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 47: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

InputThe following table describes the fields on the Input tab of the MapReduce activity.

Input Item Data Type Description

CollectionName String In single or double quotation marks, enter the name forthe collection where map-reduce operations areperformed.

The value specified in this field overwrites thevalue specified in the Collection Name field ofthe General tab.

JavaScriptMapFunction

JavaScript In double quotation marks, enter a JavaScript to map anoperation in every document in a collection. Theoperation emits key and value pairs.

The value specified in this field overwrites thevalue specified in the Map Function field of theGeneral tab.

JavaScriptReduceFunction

JavaScript In double quotation marks, enter a JavaScript to reduce allvalues of a specific key to one element which contains theresult.

The value specified in this field overwrites thevalue specified in the Reduce Function field ofthe General tab.

JavaScriptFinalizeFunction

JavaScript In double quotation marks, enter a JavaScript to modifythe output result.

The value specified in this field overwrites thevalue specified in the Finalize Function field ofthe General tab.

OutputTarget String In double quotation marks, enter a collection name tostore a map-reduce operation result.

If the output type is inline, leave this fieldblank.

47

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 48: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Input Item Data Type Description

OutputType String Select one output type from the following lists:

● INLINE

Returns the result inline.

● REPLACE

Replaces the contents of the specified collection, if thespecified collection exists .

● MERGE

Merges the new result with the existing result if theoutput collection already exists. If an existingdocument has the same key as the new result, the newresult overwrites that existing document.

● REDUCE

Merges the new result with the existing result if theoutput collection already exists. If an existingdocument has the same key as the new result, thereduce function is applied to both, the new and theexisting documents, and the existing document isoverwritten by the result.

QueryDocument String Enter a document name in double quotation marks. Thisdocument is used to query documents to be mapped andreduced.

Limit String Enter the number to decide how many documents to keepafter the query document operation.

SortDocument String Enter a document name in double quotation marks. Thisdocument is used to define the display order ofdocuments after the limit operation.

OutputThe following table describes the item on the Output tab of the MapReduce activity.

Output Item Data Type Description

ResultDocument String The document that records the returned value of theMapReduce activity.

The document varies when you select different outputtype.

48

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 49: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FaultThe following table describes the error schema elements on the Fault tab of the MapReduce activity.

Error SchemaElement Data Type Description

MongoDBPluginException

msg String This error message is displayed when the MongoDB plug-in captures an exception for the MapReduce activity.

msgCode String This error message is displayed when the MongoDB plug-in captures an exception for the MapReduce activity.

MongoException

msg String This error message is displayed when MongoDBencounters internal errors.

msgCode String This error code is displayed when MongoDB encountersinternal errors.

NetWorkException

msg String This error message is displayed when a network-relatedexception occurs.

msgCode String This error code is displayed when a network-relatedexception occurs.

JSONParseException

msg String This error message is displayed when an invalid JSONobject is passed to the JSON parser.

msgCode String This error code is displayed when an invalid JSON objectis passed to the JSON parser.

EventListenerYou can use the EventListener activity to listen for write operations in a collection, such as inserting orremoving documents or files. The EventListener activity is a start activity used for a replica set.

GeneralThe following table describes the fields on the General tab of the EventListener activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process

Default value: EventListener

49

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 50: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource icon to open the SelectMongodbconnectionResource ResourceTemplate window, where all the availableresources are listed.

2. In the Matching items panel, select a sharedresource, and click OK.

Collection Filter Yes Enter the name for the collection that you want theEventListener activity to listen for, such as the testcollection.

If you leave this field blank, the activitylistens for all the collections in the specifieddatabase.

Listen for Insert Event Yes Select this check box to listen for insert events in thespecified collection.

Listen for Remove Event Yes Select this check box to listen for remove events in thespecified collection.

Listen for Update Event Yes Select this check box to listen for update events in thespecified collection.

DescriptionOn the Description tab, add a short description for the EventListener activity.

AdvancedThe following table describes the fields on the Advanced tab of the EventListener activity.

FieldModuleProperty? Description

Sequence Key No This field contains an XPath expression that specifies the order inwhich the process runs.

Process instances with sequencing keys that have the same valueare executed sequentially in the order in which the processinstances are created.

Custom Job Id No This field contains an XPath expression that specifies a customjob ID for every job in the process instance.

50

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 51: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Conversations

On the Conversations tab, you can click Add New Conversation icon to initiate a conversation. Aconversation represents two or more related message exchanges in the same process that are correlatedby the BusinessWorks engine.

OutputThe following table describes the items on the Output tab of the EventListener activity.

Output Item Data Type Description

NameSpace String A combination of the database name and collection name

OperationType String The operation type listened to by the EventListener activity

ResultDocument String The document that records the returned value of theEventListener activity

WaitForEventYou can use the WaitForEvent activity to wait for write operations in a collection. This WaitForEventactivity is a signal-in activity used for a replica set.

When a WaitForEvent activity is performed, the process instance is suspended and waits for thespecified change to occur before resuming.

GeneralThe following table describes the fields on the General tab of the WaitForEvent activity.

FieldModuleProperty? Description

Name No The name of the activity displayed in the process

Default value: WaitForEvent

MongoDB Connection Yes Select a shared resource by completing the followingsteps:

1. Click the Choose/Create Default Resource icon toopen the Select MongodbconnectionResourceResource Template window, where all the availableresources are listed.

2. In the Matching items panel, select a shared resource,and click OK.

Collection Filter Yes Enter the name for the collection that you want to listenfor, such as test.

Listen for Insert Event Yes Select this check box to listen for insert events in thespecified collection.

51

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 52: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FieldModuleProperty? Description

Listen for RemoveEvent

Yes Select this check box to listen for remove events in thespecified collection.

Listen for Update Event Yes Select this check box to listen for update events in thespecified collection.

DescriptionOn the Description tab, add a short description for the WaitForEvent activity.

EventThe following table describes the fields on the Event tab of the WaitForEvent activity.

FieldModuleProperty? Description

Event Timeout (seconds) No Specify the amount of time (in seconds) for the event.If the event times out, an error is logged and the eventis discarded.

Activity Timeout (msec) Yes Specify the amount of time (in milliseconds) that theWaitForEvent activity waits for an event message. Ifin the specified time the WaitForEvent activity doesnot receive an event message, the status of theWaitForEvent activity changes to unavailable.

Conversations

On the Conversations tab, you can click Add New Conversation icon to initiate a conversation. Aconversation represents two or more related message exchanges in the same process that are correlatedby the BusinessWorks engine.

OutputThe following table describes the items on the Output tab of the WaitForEvent activity.

Output Item Data Type Description

NameSpace String A combination of the database name and collection name

OperationType String The operation type listened to by the WaitForEventactivity

ResultDocument String The document that records the result of operations in aspecified collection

52

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 53: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

FaultThe following table describes the error schema elements on the Fault tab of the WaitForEvent activity.

Error SchemaElement Data type Description

msg String This error message is displayed when the MongoDB plug-incaptures an exception for the WaitForEvent activity.

msgCode String This error code is displayed when the MongoDB plug-incaptures an exception for the WaitForEvent activity.

53

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 54: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

MongoDB Transactions

You can create a group of CRUD activities (insert, query, update, delete) inside a Local Transactiongroup. You must configure the activities participating in the same transaction with the same sharedresource. The transaction is committed or aborted as the execution progresses towards the end of thetransaction group. Transactions work only on existing collections.

This feature works with replica sets.

The Local Transaction group is available for the following activities:

● InsertDocument

● QueryDocument

● UpdateDocument

● RemoveDocument

Perform the following steps to apply transactions to a group of activities:

Procedure

1. In the application process, right-click and point to Create Group and click Local Transaction.

2. Add the required activities inside the newly created Local Transaction group.

3. In the General tab of the Transaction Group, select the Transaction Transport as MongoDB.

4. In the Advanced tab of the CRUD activities, if the Override Transaction Behavior checkbox isselected then the activity does not participate in the transaction even if it is a part of the transactiongroup. However, if this activity faults, transaction fails.

54

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 55: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Working with the Sample Projects

The MongoDB plug-in installer includes a sample project, which shows how TIBCO ActiveMatrixBusinessWorks Plug-in for MongoDB works.

After installing the plug-in, you can locate the sample project in the TIBCO_HOME/bw/palettes/mongodb/version/samples directory. This sample project contains the following projects that includedifferent processes, and each process corresponds to a task.

● Event_Sample

— EventCleanDocument

This subprocess demonstrates how to use the plug-in to clean documents in a specifiedcollection.

— EventInsertDocument

This subprocess demonstrates how to use the plug-in to insert documents in a specifiedcollection.

— EventUpdateDocument

This subprocess demonstrates how to use the plug-in to update documents in a specifiedcollection.

— EventListener

This process demonstrates how to use the plug-in to listen for write operations in a specifiedcollection.

— OperationProcess

This process demonstrates how to use the plug-in to insert, update, or delete documents in aspecified collection.

— WaitForEvent

This process demonstrates how to use the plug-in to wait and listen for write operations in aspecified collection.

● Hierarchical_Aggregation

— MapReduceAggregate

This process demonstrates how to use the plug-in to perform map-reduce operations in aspecified collection.

— QueryAggregate

This process demonstrates how to use the plug-in to perform an aggregation query from aspecified collection.

— CleanDocument

This subprocess demonstrates how to use the plug-in to delete all documents from a specifiedcollection.

— InsertDocumentv

This subprocess demonstrates how to use the plug-in to insert a group of documents in aspecified collection.

— QueryDocuments

This process demonstrates how to use the plug-in to query multiple documents from a specifiedcollection.

55

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 56: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

● Metadata_and_Asset_Management

— CreateDocument

This subprocess demonstrates how to use the plug-in to insert a group of documents in aspecified collection.

— CreateGridFSFile

This subprocess demonstrates how to use the plug-in to insert a file in a specified bucket.

— DeleteDocument

This subprocess demonstrates how to use the plug-in to delete all documents from a specifiedcollection.

— DeletePhotoDeletePhoto

This subprocess demonstrates how to use the plug-in to delete a file from a specified bucket.

— QueryDocument

This subprocess demonstrates how to use the plug-in to query a document from a specifiedcollection.

— QueryDocumentbyIndex

This subprocess demonstrates how to use the plug-in to query a document by index from aspecified collection.

— DropIndex

This subprocess demonstrates how to use the plug-in to delete all indexes from a specifiedcollection.

— UpdateDocument

This subprocess demonstrates how to use the plug-in to update a document in a specifiedcollection.

— GridFSPhotoOperatev

This process demonstrates how to use the plug-in to insert, query, or delete a file from aspecified bucket.

— QuerybyIndex

This process demonstrates how to use the plug-in to query documents from a specifiedcollection using a newly created index.

— QueryJSONtoXML

This process demonstrates how to use the plug-in to parse JSON documents into XMLdocuments.

— SaveXMLtoMongoDB

This process demonstrates how to use the plug-in to save XML documents into MongoDB.

● GeospatialQuery_Sample

— CurrentNeighborhood

This process demonstrates how to use the plug-in to find the user’s current neighborhood.

— RestaurantsWithinNeighborhood

This process demonstrates how to use the plug-in to find the restaurants in a neighborhood.

● Transaction_Sample

56

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 57: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

— CRUDActivities

This process demonstrates how to use the plug-in to implement transactions for CRUDoperations.

— DocumentLocking

This process demonstrates how to use the plug-in's QueryDocument Activity to lock documentsin a transaction.

— InsertinMultipleDB

This process demonstrates how to insert documents in multiple databases using differentconnection resources.

— SubProcess

This subprocess demonstrates how to use the plug-in to insert a document in a specifiedcollection using Mongodbconnectionresource1. This subprocess is a part of InsertinMultipleDBprocess.

Importing the Sample ProjectsBefore running the projects, you must import them to TIBCO Business Studio.

Procedure

1. Start TIBCO Business Studio:

● Microsoft Windows: Click Start > All Programs > TIBCO > TIBCO_HOME > TIBCO BusinessStudio version_number > Studio for Designers

● macOS and Linux: Run the TIBCO Business Studio executable file located in the TIBCO_HOME/studio/version_number/eclipse directory.

2. From the menu, click File > Import.

3. In the Import window, expand the General folder and select the Existing Studio Projects intoWorkspace item, and click Next.

4. Click Browse next to the Select archive file field to select the samples file, and click Finish.The samples file is located in the TIBCO_HOME\bw\palettes\mongodb\version\samples directory.

Result

The sample projects are imported to TIBCO Business Studio.

57

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 58: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Configuring MongoDB ConnectionConfiguring MongoDB Connection shared resource is essential for the plug-in to establish a connectionto the MongoDB server.

Prerequisites

Importing the Sample Projects.

Procedure

1. In the Project Explorer view, expand MongoDB_Sample.

2. In the Resources folder, double-clickMongoDBConnectionResource.mongodbconnectionResource.

3. In MongoDBConnection Editor, configure each field accordingly.

4. On the toolbar, click the Save icon to save your changes.

Running the Sample ProjectsThe sample projects show how to use the plug-in to insert, query, update, or remove documents or filesin MongoDB. The sample projects also show how to get a MongoDB connection instance, run databasecommand, listen for write operations in MongoDB, and perform map-reduce operations in MongoDB.

Prerequisites

Ensure that you have imported the sample projects to TIBCO Business Studio, as described in Importing the Sample Projects, and configured MongoDB Connection, as described in ConfiguringMongoDB Connection.

58

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 59: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Procedure

1. In the Project Explorer view, expand the Module Descriptors resource and double-clickComponents.By default, all the processes are listed in the Components editor.

2. Select the process that you do not want to run and click the remove selected component icon.

3. On the toolbar, click the Save icon to save your changes.

4. From the menu, click Run > Run Configurations to run the selected process.

5. In the Run Configuration dialog box, expand BusinessWorks Application, and clickBWApplication.

6. In the right pane, click the Applications tab and select the check box next toEvent_Sample.application, Hierarchical_Aggregation.application, orMetadata_and_Asset_Management.application.

7. Click Run to run the selected process.

8. Click the Terminate icon to stop the process.

Configuration of Sample ProcessesThe samples file contains five projects. Each process in these projects has different functions.

After importing the sample projects, expand all projects in the Project Explorer view. All the processesare displayed. See Importing the Sample Projects for more information.

59

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 60: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Event_Sample ProjectThe Event_Sample project contains the following processes:

● EventCleanDocument.bwp

● EventInsertDocument.bwp

● EventUpdateDocument.bwp

● EventListener.bwp

● OperationProcess.bwp

● WaitForEvent.bwp

60

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 61: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

EventCleanDocument.bwp

This subprocess demonstrates how to use the plug-in to clean documents in a specified collection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess.

Activity Description

OperationIn Receives data and starts the subprocess

CleanDocument Deletes documents in the specified collection

OperationOut Delivers the output data and ends the subprocess

EventInsertDocument.bwp

This subprocess demonstrates how to use the plug-in to insert documents in a specified collection.

The subprocess is designed with the following activities:

61

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 62: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

InsertDocument Inserts documents in the specified collection

OperationOut Delivers the output data and ends the subprocess

EventUpdateDocument.bwp

This subprocess demonstrates how to use the plug-in to update documents in a specified collection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

UpdateDocument Updates documents in the specified collection

OperationOut Delivers data and ends the subprocess

EventListener.bwp

This process demonstrates how to use the plug-in to listen for write operations in a specified collection.

The process is designed with the following activities:

62

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 63: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the process:

Activity Description

EventListener Listens for write operations in the specified collection

WriteFile Writes the result of the EventListener activity to a specifiedfile

OperationProcess.bwp

This process demonstrates how to use the plug-in to insert, update, or delete documents in a specifiedcollection.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

63

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 64: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

Sleep Sets the time interval for the InsertDocuments activity

InsertDocuments Invokes the EventInsertDocument subprocess to insert agroup of documents in the specified collection

Sleep2 Sets the time interval for the UpdateDocuments activity

UpdateDocuments Invokes the EventUpdateDocument subprocess to updateone or more documents in the specified collection

Sleep3 Sets the time interval for the CleanDocuments activity

CleanDocuments Invokes the EventCleanDocument subprocess to delete oneor more documents from the specified collection

WaitForEvent.bwp

This process demonstrates how to use the plug-in to wait and listen for write operations in a specifiedcollection.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

WaitForEvent Waits and listens for write operations in the specifiedcollection

WriteFile Writes the result of the WaitForEvent activity to a specifiedfile

64

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 65: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Hierarchical_Aggregation ProjectThe Hierarchical_Aggregation project contains the following processes:

● MapReduceAggregate.bwp

● QueryAggregate.bwp

● CleanDocument.bwp

● InsertDocument.bwp

● QueryDocuments.bwp

MapReduceAggregate.bwp

This process demonstrates how to use the plug-in to perform map-reduce operations in a specifiedcollection.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

CleanResultDocuments Invokes the CleanDocument subprocess to delete all resultdocuments from the specified collection

CleanSampleDocuments Invokes the CleanDocument subprocess to delete allsample documents from the specified collection

InsertDocuments Invokes the InsertDocument subprocess to insert a groupof documents in the specified collection

MapReduce Performs a map-reduce operation on the specifiedcollection and writes the result to another collection

GetMongoDBConnection Obtains a MongoDB Connection reference

65

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 66: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

GetResult Uses the obtained Connection reference to get informationrelated to the collection where the result of the map-reduceoperation is located

DataBaseCommand Performs database commands in the collection where theresult of the map-reduce operation is located

QueryAggregate.bwp

This process demonstrates how to use the plug-in to perform an aggregation query from a specifiedcollection.

The process is designed with the following activities:

The following table describes the activities in the process.

Activity Description

Timer Starts the process

CleanDocument Invokes the CleanDocument subprocess to delete alldocuments from the specified collection

InsertDocument Invokes the InsertDocument subprocess to insert a groupof documents in the specified collection

AggregateOperation Performs an aggregation query from the specifiedcollection

CleanDocument.bwp

This subprocess demonstrates how to use the plug-in to delete all documents from a specifiedcollection.

The subprocess is designed with the following activities:

66

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 67: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

CleanDocuments Deletes all documents from the specified collection

OperationOut Delivers the output data and ends the subprocess

InsertDocument.bwp

This subprocess demonstrates how to use the plug-in to insert a group of documents in a specifiedcollection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess:

67

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 68: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

OperationIn Receives data and starts the subprocess

InsertDocument Inserts a group of documents in the specified collection

OperationOut Delivers the output data and ends the subprocess

QueryDocuments.bwp

This process demonstrates how to use the plug-in to query multiple documents in a specified collection.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

CleanDocuments Invokes the CleanDocument subprocess to delete alldocuments from the specified collection

InsertDocuments Invokes the InsertDocument subprocess to insert a groupof documents in the specified collection

QueryDocument Queries documents in the specified collection and returnsone document each time

WriteFile Writes each document returned from the QueryDocumentactivity to a specified file

Metadata_and_Asset_Management ProjectThe Metadata_and_Asset_Management project contains the following processes:

● CreateDocument.bwp

68

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 69: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

● CreateGridFSFile.bwp● DeleteDocument.bwp● DeletePhoto.bwp● QueryDocument.bwp● QueryDocumentbyIndex.bwp● DropIndex.bwp● UpdateDocument.bwp● GridFSPhotoOperate.bwp● QuerybyIndex.bwp● QueryJSONtoXML.bwp● SavaXMLtoMongoDB.bwp

CreateDocument.bwp

This subprocess demonstrates how to use the plug-in to insert a group of documents in a specifiedcollection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

CreateDocument Inserts a group of documents in the specified collection

OperationOut Delivers the output data and ends the subprocess

CreateGridFSFile.bwp

This subprocess demonstrates how to use the plug-in to insert a file in a specified bucket.

The subprocess is designed with the following activities:

69

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 70: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

CreateGridFSFile Inserts a file into the specified bucket

OperationOut Delivers the output data and ends the subprocess

DeleteDocument.bwp

This subprocess demonstrates how to use the plug-in to delete all documents from a specifiedcollection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess.

70

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 71: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

OperationIn Receives data and starts the subprocess

DeleteDocument Deletes all documents from the specified collection

OperationOut Delivers the output data and ends the subprocess

DeletePhoto.bwp

This subprocess demonstrates how to use the plug-in to delete a file from a specified bucket.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess.

Activity Description

OperationIn Receives data and starts the subprocess

DeletePhoto Deletes a file from the specified bucket

OperationOut Delivers the output data and ends the subprocess

QueryDocument.bwp

This subprocess demonstrates how to use the plug-in to query a document in a specified collection.

The subprocess is designed with the following activities:

71

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 72: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess.

Activity Description

OperationIn Receives data and starts the subprocess

QueryDocument Queries a document in the specified collection

OperationOut Delivers the output data and ends the subprocess

QueryDocumentbyIndex.bwp

This subprocess demonstrates how to use the plug-in to query a document by index in a specifiedcollection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess.

Activity Description

OperationIn Receives data and starts the subprocess

72

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 73: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

QueryDocument Queries a document in the specified collection

OperationOut Delivers the output data and ends the subprocess

DropIndex.bwp

This subprocess demonstrates how to use the plug-in to delete all indexes from a specified collection.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

DropIndex Deletes all indexes from the specified collection

OperationOut Delivers the output data and ends the subprocess

UpdateDocument.bwp

This subprocess demonstrates how to use the plug-in to update a document in a specified collection.

The subprocess is designed with the following activities:

73

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 74: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess:

Activity Description

OperationIn Receives data and starts the subprocess

UpdateDocument Updates a document in the specified collection

OperationOut Delivers the output data and ends the subprocess

GridFSPhotoOperate.bwp

This process demonstrates how to use the plug-in to insert, query, or delete a file from a specifiedbucket.

The process is designed with the following activities:

The following table describes the activities in the process:

74

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 75: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

Timer Starts the process

CreateGridFSFile Invokes the CreateGridFSFile subprocess to insert a file inthe specified bucket and specify a new name for theinserted file

QueryGridFSPhotos Queries the inserted file from the specified bucket

JavaCode Obtains an instance of InputStream and writes the filestream to the inserted file

DeletePhotos Invokes the DeletePhoto subprocess to delete the insertedfile from the specified bucket

QuerybyIndex.bwp

This process demonstrates how to use the plug-in to query documents in a specified collection using anewly created index.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

DeleteDocument Invokes the DeleteDocument subprocess to delete alldocuments from the specified collection

DropIndex Invokes the DropIndex subprocess to delete all indexesfrom the specified collection

75

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 76: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Activity Description

CreateDocument Invokes the CreateDocument subprocess to insert a groupof documents in the specified collection and create a newindex for the inserted documents

UpdateDocument Invokes the UpdateDocument subprocess to update adocument in the specified collection

QueryDocument Invokes the QueryByIndex subprocess to query theupdated document from the specified collection using thenewly created index

QueryJSONtoXML.bwp

This process demonstrates how to use the plug-in to parse JSON documents into XML documents.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

DeleteDocuments Invokes the DeleteDocument subprocess to deletedocuments from the specified collection

CreateDocuments Invokes the CreateDocument subprocess to insertdocuments in the specified collection

QueryDocuments Invokes the QueryDocument subprocess to querydocuments in the specified collection

ParseJSON Parses the JSON documents into XML documents

76

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 77: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

SaveXMLtoMongoDB.bwp

This process demonstrates how to use the plug-in to save XML documents to MongoDB.

The process is designed with the following activities:

The following table describes the activities in the process:

Activity Description

Timer Starts the process

DeleteDocuments Invokes the DeleteDocument subprocess to deletedocuments from the specified collection

ReadFile Reads the specified XML file and converts it to a string

ParseXml Parses the string and converts it into an XML file

RenderXml Generates a new XML file

RenderJSON Converts the newly generated XML file to a JSON file

CreateDocuments Invokes the CreateDocument subprocess to insertdocuments in the specified collection

GeospatialQuery_Sample ProjectThe GeospatialQuery_Sample project contains the following processes.

● CurrentNeighborhood.bwp

● RestaurantsWithinNeighborhood.bwp

77

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 78: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

CurrentNeighborhood.bwp

This process demonstrates how to use the plug-in to find the user’s current neighborhood.

The subprocess is designed with the following activities:

The following table describes the activities in the subprocess:

Activity Description

FindCurrentNeighborhood Finds the current neighborhood of the point coordinatesspecified in the query

FindNumberRestaurantsInNeighborhood

Finds all restaurants contained in a given neighborhood

RestaurantsWithinNeighborhood.bwp

This process demonstrates how to use the plug-in to find the restaurants in a neighborhood.

The subprocess is designed with the following activities:

78

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 79: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the subprocess:

Activity Description

GetTenNearestRestaurants Returns the ten nearest restaurants (sorted from nearest tofarthest) within the radial distance specified in the query

GetAllWithinSphere Returns all restaurants in unsorted order within the radialdistance specified in the query

Transaction_Sample ProjectThe Transaction_Sample project contains the following processes:

● CRUDActivities.bwp

● DocumentLocking.bwp

● InsertinMultipleDB.bwp

● SubProcess.bwp

CRUDActivities.bwp

This process demonstrates how to use the plug-in to implement transactions for CRUDoperations.Activities are added to the Local Transaction Group. Configuration is mentioned in thesection MongoDB Transactions. The process demonstrates two scenarios:

● In the first Local Transaction Group, CRUD activities participate in a transaction and the transactionis committed successfully.

● In the second Local Transaction Group, three InsertDocument activities participate in a transactionbut the transaction is aborted due to an exception thrown from within the transaction group.

The process is designed with the following activities:

79

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 80: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the process.

Activity Description

RemoveDocument Removes all the documents in the specified collection.

InsertDocument This activity inserts a document in the specified collectionthat is used by activities inside local transaction group.Specified collection is created if it does not exist. Thisactivity is used because transactions work only on existingcollections.

InsertDocument1 This is the first activity inside a transaction. Transactionstarts with a session that is used for all the activities thatshare the same connection resource. WriteConcern selectedfor this activity is used for the whole transactionirrespective of the selected write concerns of individualactivities in the group. This activity inserts a document inthe specified collection using the session.

UpdateDocument Updates the inserted document with a field in the specifiedcollection using the session.

QueryDocument Queries the inserted document in the specified collectionusing the session.

RemoveDocument Removes the documents inserted in the specified collectionusing the session.

InsertDocument2 This activity does not participate in the transaction as theOverride Transaction behavior is selected in the Advancetab. Document is inserted though the transaction fails.

InsertDocument3 This is the first activity inside a transaction. This activitytries to insert a document in to the collection but astransaction is failed the changes are rolled back.

InsertDocument4 Duplicate ID insertion in this activity gives an exception.The transaction aborts with no changes committing todatabase. ContinueonError has no effect on transaction.

80

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 81: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

DocumentLocking.bwp

This process demonstrates how to use the plug-in's QueryDocument Activity to lock documents in atransaction. Activities are added to the Local Transaction Group. Configuration is mentioned in thesection MongoDB Transactions. Locking a document does not allow any concurrent transaction tomodify/remove it until the lock is released. Nested Transaction is used by creating another LocalTransaction Group that creates a second transaction.The process is designed with the following activities:

The following table describes the activities in the process.

Activity Description

RemoveDocument Removes all the documents in the specified collection.

InsertDocument Inserts a document in the specified collection with thefields Name and Age.

QueryDocument Locks the first document that matches the input inQueryDocument as Lock Document checkbox is checkedand QueryType FIND_ONE is selected.

UpdateDocument This activity is in a nested transaction.UpdateDocumentActivity throws a WriteConflict exceptionas the document that it is trying to update is locked byQueryDocumentActivity in the outer transaction. Lock canonly be released when the outer transaction session iscommitted which cannot be done with out the innertransaction successfully committing leading to a deadlockhere.

InsertinMultipleDB.bwp

This process demonstrates how to insert documents in multiple databases using different connectionresources. Two connection resources are configured. As transaction works only on existing collections,InsertDocument and InsertDocument1 activities are created. The process is designed with the followingactivities:

81

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 82: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The following table describes the activities in the process.

Activity Description

RemoveDocument Removes all the documents in the specified collection in adatabase that is configured inMongoDBConnectionResource.

RemoveDocument1 Removes all the documents in the specified collection in adatabase that is configured inMongoDBConnectionResource1.

InsertDocument Inserts a document in the specified collection in a databasethat is configured in MongoDBConnectionResource.

InsertDocument1 Inserts a document in the specified collection in a databasethat is configured in MongoDBConnectionResource1.

InsertDocument2 Transaction1 is started with a session. Inserts a documentin the specified collection in a database that is configured inthe MongoDBConnectionResource using session.

SubProcess Invokes the SubProcess. Transaction2 is started with a newsession. For example, session 1 because of differentconnection resource chosen for UpdateDocumentActivitywithin sub-process. For multiple connection resources,MongoDB Connection Property name must differ thatleads to multiple transactions.

SubProcess.bwp

This subprocess demonstrates how to use the plug-in to insert a document in a specified collectionusing Mongodbconnectionresource1.

82

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 83: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

The subprocess is designed with the following activities:

The following table describes the activity in the process.

Activity Description

InsertDocument Inserts a document in the specified collection in a databasethat is configured in MongoDBConnectionResource1 usingsession1.

83

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 84: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Log Management

When an error occurs, you can check logs to trace and troubleshoot the plug-in exceptions.

By default, error logs are displayed in the Console view when you run a process in debug mode. Youcan change the log level of the plug-in to trace different messages and export logs to a file. Different loglevels correspond to different messages, as described in Log Levels.

Log LevelsDifferent log levels include different information.

The plug-in supports the following log levels:

Log Level Description

Debug Indicates a developer-defined tracing message.

Info Indicates normal plug-in operations. No action is required. A tracing messagetagged with Info indicates that a significant processing step is reached, andlogged for tracking or auditing purposes. Only info messages preceding atracking identifier are considered as significant steps.

Error Indicates that an unrecoverable error occurred. Depending on the severity ofthe error, the plug-in might continue with the next operation or might stop.

Setting Up Log LevelsYou can configure a different log level for the plug-in, plug-in activities, and shared resources to tracedifferent messages.

If you do not configure any log levels, the plug-in uses the default log level of TIBCO ActiveMatrixBusinessWorks. The default log level is Error.

Procedure

1. Navigate to the TIBCO_HOME/bw/version_number/config/design/logback directory and openthe logback.xml file.

2. Add the following node in the BusinessWorks Palette and Activity loggers area to specify a loglevel for the plug-in:<logger name="com.tibco.bw.palette.mongodb.runtime"> <level value="DEBUG"/></logger>

The value of the level element can be Error, Info, or Debug.

If you set the log level to Debug, the input and output for the plug-in activities are alsodisplayed in the Console view. For information about each log level, see Log Levels.

3. Optional: Add different nodes in the BusinessWorks Palette and Activity loggers area to specifydifferent log levels for the activities and shared resources.For the MongoDB Connection shared resource, add the following node:<logger name="com.tibco.bw.sharedresource.mongodb.runtime"> <level value="DEBUG"/></logger>

84

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 85: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

For the EventListener and the WaitForEvent activities, add the following node:<logger name="com.tibco.bw.palette.mongodb.runtime.ActivityNameEventSource"> <level value="DEBUG"/></logger>

For other activities, add the following node:<logger name="com.tibco.bw.palette.mongodb.runtime.ActivityNameAsynchronousActivity"> <level value="DEBUG"/></logger>

The activities that are not configured with specific log levels use the log level configuredfor the plug-in.

4. Save the file.

Exporting Logs to a FileYou can configure the logback.xml file to export plug-in logs to a specified file.

Procedure

1. Navigate to the TIBCO_HOME/bw/version_number/config/design/logback directory and openthe logback.xml file.

After deploying an application in TIBCO Enterprise Administrator, navigate to theTIBCO_HOME/bw/version_number/domains/domain_name/appnodes/space_name/

node_name directory to find the logback.xml file.

2. Add the following node to specify the file where the log must be exported:<appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>c:/bw6-mongodb.log</file> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}-%msg%n</pattern> </encoder></appender>

The value of the file element is the absolute path of the file that stores the exported log.

3. Add the following node to the root node at the bottom of the logback.xml file:<root level="DEBUG"> <appender-ref ref="STDOUT"/> <appender-ref ref="FILE"/></root>

4. Save the file.

85

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 86: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error Codes

The following table lists error codes, detailed explanation of each error, and where applicable, ways toresolve the errors.

Error Code andError Message Role Category Description Solutions

TIBCO-BW-PALETTE-MONGODB-500001

Activity {0}

initialization

error.

Error BW-Plug-in Occurs when theactivity is initiated

Ensure that the activityis configured correctly.

TIBCO-BW-PALETTE-MONGODB-500002

IOException

occurred while

retrieving XML

Output for

activity [{0}].

Error BW-Plug-in Occurs when the XMLoutput for the activityis retrieved

Ensure that the activityis configured correctly.

TIBCO-BW-PALETTE-MONGODB-500003

Exception occurred

while invoke

execute method for

activity [{0}].

Error BW-Plug-in Occurs when theexecute method for theactivity is invoked

Ensure that the activityis configured correctly.

TIBCO-BW-PALETTE-MONGODB-500004

Configuration

Error.{0}

Error BW-Plug-in Occurs when theconfiguration for theactivity is not correct

Ensure that the activityis configured correctly.

TIBCO-BW-PALETTE-MONGODB-500005

Exception occurred

while operate the

activity wrong.{0}

Error BW-Plug-in Occurs when theactivity is operatedincorrectly

Ensure that the activityis configured correctly.

86

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide

Page 87: Plug-in for MongoDB TIBCO ActiveMatrix BusinessWorks User ......Plug-in for MongoDB User's Guide Software Release 6.4 August 2020. Important Information SOME TIBCO SOFTWARE EMBEDS

Error Code andError Message Role Category Description Solutions

TIBCO-BW-PALETTE-MONGODB-500006

Exception occurred

while operate the

function of

IsGridFs.{0}

Error BW-Plug-in Occurs when thefunction of IsGridFS isoperated incorrectly

Ensure that the activityis configured correctly.

TIBCO-BW-PALETTE-MONGODB-500007

There is a problem

with network.

Error BW-Plug-in Occurs when there is aproblem with thenetwork

Ensure that thenetwork workscorrectly.

TIBCO-BW-PALETTE-MONGODB-500008

There is a problem

with IO.

Error BW-Plug-in Occurs when the IOoperation is notcorrect

Ensure that the IO isoperated correctly.

TIBCO-BW-PALETTE-MONGODB-500009

There is a problem

with the cursor.

Error BW-Plug-in Occurs when thecursor operation is notcorrect

Ensure that the query isoperated correctly.

TIBCO-BW-PALETTE-MONGODB-500010

Valid output type

are : {REPLACE,

MERGE, REDUCE,

INLINE}

Error BW-Plug-in Occurs when the inputfor the MapReduceactivity is not correct

Ensure that theMapReduce activity isoperated correctly.

TIBCO-BW-PALETTE-MONGODB-500011

Exception occurred

while parsing the

JSON string {0},

please ensure your

input is correct.

Error BW-Plug-in Occurs when the inputis not correct

Ensure that your inputis correct.

TIBCO-BW-PALETTE-MONGODB-500012

{0}

Error BW-Plug-in Occurs when thelistening operation isnot correct

Ensure that your host iscorrect.

87

TIBCO ActiveMatrix BusinessWorks™ Plug-in for MongoDB User's Guide