1.0.21 • Published 7 years ago

g4-runtime-api-business-apps v1.0.21

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
7 years ago

G4 runtime-api business-apps module

Module to search for specific business-apps.

Search by _id business-apps and find diagram, form, rule. docType by _id

Table of Contents

Prerequisites

Installation

Package installation

> npm install @intelisis/g4-runtime-api-business-apps --save

Usage

Initialize

Initilize module passing business-apps _id, database connection pool and database's name as tenantName

// JS Example
const BusinessApps = require('@intelisis/g4-runtime-api-business-apps');
const options = {
  _id: business_app_ID,
  tenantName: dataBaseName,
  db: InstanceOfDb
};

new BusinessApps(options);
# Coffee Example
BusinessApp  = require '@intelisis/g4-runtime-api-business-apps'

businessApp = new BusinessApp options

Options

  • db: - pool connection from mongoose
  • tenantName: - indicates the name of the tenant, is normally the users tenant
  • _id - indicates business-apps' id to search

API

fetch()

Search a specific business-apps by _id.

# Coffee Example
businessApp.fetch().then ->
  # now all business-apps attributes are available
  # businessApp.get 'name' 
.catch (err) ->
  # returns an error if it happens

###getDiagram(diagramId)

diagramId

Type: String

Search diagram on business-apps

# Coffee Example
businessApp.getDiagram(diagramId).then (diagram) ->
  # returns specific diagram
.catch (err) ->
  # returns an error if it happens

###getForm(formId)

formId

Type: String

Search form on business-apps

# Coffee Example
businessApp.getForm(formId).then (form) ->
  # returns specific form
.catch (err) ->
  # returns an error if it happens

###getRule(ruleId)

ruleId

Type: String

Search rule on business-apps

# Coffee Example
businessApp.getRule(ruleId).then (rule) ->
  # returns specific rule
.catch (err) ->
  # returns an error if it happens

###getDocType(docTypeId)

docTypeId

Type: String

Search docType on business-apps

# Coffee Example
businessApp.getDocType(docTypeId).then (docType) ->
  # returns specific docType
.catch (err) ->
  # returns an error if it happens

Tests

How to run the unit tests

> npm install
> gulp test

License

Copyright (C) 2016 Intelisis Software, S.A. de C.V. - All Rights Reserved

Unauthorized copying or distributing of this repository, project or any part of it, via any medium is strictly prohibited

Proprietary and confidential