Commit d5b19161 authored by Laurent Leseigneur's avatar Laurent Leseigneur

initial commit

parents
.idea
build
node_modules
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
#!/usr/bin/env groovy
boolean isVersionSupported(version, supportedVersions) {
def result = false
for (supported in supportedVersions.tokenize(',')) {
if (supported == version) {
result = true
break
}
}
def status = result ? 'supported' : 'NOT supported'
println "Version <$version> is $status on this environment."
return result
}
node {
stage 'Checkout'
def branch_name = env.BRANCH_NAME
println "Checking out branch $branch_name"
checkout scm
stage 'Build'
def nodejsHome = tool name: 'NodeJS_424', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'
sh """#!/bin/bash
set -e
env | sort -u
echo "### Cleaning previous build (except index.html)"
shopt -s extglob
rm -rf build
echo ""
echo "### Converting .md to .html"
PATH=\$PATH:${nodejsHome}/bin
npm install
scripts/convertMdToHtml.js ici
scripts/taxonomy.js
echo ""
echo "### Creating doc html archive"
archive_name=doc-ici-html-\$BRANCH_NAME-`date +"%Y%m%d_%H%M%S"`.tar.gz
rm -rf doc-ici-html*.tar.gz doc-ici-html
mkdir doc-ici-html && ln -s ../build/html doc-ici-html/html && ln -s ../md/images doc-ici-html/images
tar czf \$archive_name --dereference doc-ici-html
echo ". Generated archive: \$archive_name"
echo ""
echo "Done."
"""
stage 'Archive'
archive '**/doc-ici-html*.tar.gz'
stage 'Deploy'
parallel preprod: {
if (isVersionSupported(branch_name, env.GLOBAL_PREPROD_BCD_VERSIONS)) {
build job: 'push-content-preprod', parameters: [[$class: 'StringParameterValue', name: 'ARE_YOU_SURE', value: 'Yes']]
}
}, prod: {
if (isVersionSupported(branch_name, env.GLOBAL_PROD_BCD_VERSIONS)) {
build job: 'push-content-prod', parameters: [[$class: 'StringParameterValue', name: 'ARE_YOU_SURE', value: 'Yes']]
}
},
failFast: false
}
# Bonita Intelligent Continuous Improvement documentation resources
This repository contains Bonita Intelligent Continuous Improvement documentation site content.
It uses [Markdown](https://help.github.com/categories/writing-on-github/) to create documentation content.
## View rendered content on GitHub
Using the [Github Markdown Format](https://help.github.com/categories/writing-on-github/) allows to check the documentation directly on the GitHub repository website.
Hence a simple way to view documentation content is to browse the `md` folder on [GitHub website](md).
This [Table of contents](md/taxonomy.md) is also provided to ease your navigation.
## Build project
The project contains several tasks to generate the documentation content.
### HTML
Use `npm run build` to have the HTML files generated to the `build/html` directory.
This command requires 2 arguments:
- `version` - Documentation version string. Example: `1.0`. If no version argument is provided, then version is read from the `scripts/variables.json` file.
- `application` - URL prefix when serving documentation images. Image URLs will be like:
```html
<img src="${application}/images/${version}/<image_filename>"/>
```
**Example**: With version=`1.0` and application=`bcd`, generated HTML will contain `img` tags like:
```html
<img src="bcd/images/1.0/bcd_overview.png"/>
```
Providing arguments to the HTML build command is done with one of the following syntaxes:
```bash
npm run build -- [application] [version]
npm run build -- -a [application] -v [version]
npm run build -- -a [application]
```
Examples:
```bash
npm run build -- ici 1.0
npm run build -- -a ici -v 1.0
npm run build -- -a ici
```
### Taxonomy
Once the HTML content has been generated, the `taxonomy.json` file can be generated from the `build/html/taxonomy.html` file.
Use the `npm run taxonomy` command to do so.
## Contribute
To help you contributing to Bonita Intelligent Continuous Improvement documentation, we provide a set of [contribution guidelines](https://github.com/bonitasoft/bonita-doc/blob/7.3/CONTRIBUTING.md).
Thanks for taking time to contribute!
# Architecture
Bonita Intelligent Continuous Improvement architecture.
## Overview
# Configure Operations Management Living Application
Configure Operations Management Living Application.
## Set target duration
## Set on-time decision threshold
## Create the model
## Troubleshooting
# Business Process Intelligence dashboard
Business Process Intelligence dashboard.
## Kibana
## Our examples
## Create your own
# Bonita Intelligent Continuous Improvement Add-on
![Bonita Intelligent Continuous Improvement Add-on](images/ici.png)
This add-on provides a solution to use _Intelligent Continuous Improvement_ practice for your Bonita platform.
It is composed of and application, connected to Bonita Egine database, and two living applications
to configure and monitor cases.
![Bonita Intelligent Continuous Improvement](images/bonita_ici_stack.png)
# Download, Install, and Configure ICI add-on
Bonita Intelligent Continuous Improvement installation.
# Monitor cases
Monitor cases.
## The UI
## How to createe your own UI
## Troubleshooting
example: no data available.
\ No newline at end of file
# Next steps
Bonita Intelligent Continuous Improvement next steps.
## Business data in the algorithm
## Several algorithms
## Predict case end flow
# Poll data from Bonita Engine database to Elastic Search
Bonita Intelligent Continuous Improvement architecture.
## Start / Stop / Scheduled polling
## Status
## Reporting
## Incremental polling
### Definition
### Setting
## Troubleshooting
# Pre-requisites
Bonita Intelligent Continuous Improvement prerequisites.
## Hardware
## Software
bonita
## Skills
## Data
# Process-mining
Process mining is ...
## General
see our [webinar](https://fr.bonitasoft.com/videos/bpm-intelligence-artificielle) (in French)
## What is used in ICI v1: Predict chances to finish on time
# Release notes
## Limitations and known issues
## What's new in 1.0.0
### Bugfixes
# Security
Nothing yet.
# Send us (anonimous) data!
Send us (anonimous) data!
\ No newline at end of file
* [Release Notes](release_notes.md)
* [Intelligent Continuous Improvement](index.md)
* [Architecture](architecture.md)
* [Process-mining](process_mining.md)
* [Pre-requisites](prerequisites.md)
* [Download, Install and Configure ICI add-on](installation.md)
* [Poll data from Bonita Engine database](polling.md)
* [Configure Operations Management Living Application](configure.md)
* [Monitor cases](monitoring.md)
* [Business Process Intelligence dashboard](dashboard.md)
* [Licencing](licensing.md)
* [Security](security.md)
* [Next steps](next_step.md)
* [Send us (anonymous) data!](send_data.md)
This diff is collapsed.
{
"name": "ici-documentation",
"version": "1.0.0",
"description": "",
"scripts": {
"taxonomy": "node ./scripts/taxonomy.js",
"build": "node ./scripts/convertMdToHtml.js"
},
"author": "Laurent Leseigneur <laurent.leseigneur@bonitasoft.com>",
"devDependencies": {
"common-tags": "1.3.0",
"denodeify": "1.2.1",
"es6-promise": "3.2.1",
"himalaya": "0.2.0",
"markdown-it": "6.0.2",
"markdown-it-alerts": "0.1.0",
"markdown-it-decorate": "1.2.1",
"markdown-it-fontawesome": "0.2.0",
"markdown-it-for-inline": "0.1.1",
"markdown-it-smartarrows": "1.0.1",
"mkdirp": "0.5.1",
"query-string": "4.2.2",
"winston": "2.2.0",
"xmldom": "0.1.22",
"xpath": "0.0.23",
"yargs": "4.7.1"
}
}
#!/usr/bin/env node
(() => {
'use strict';
require('es6-promise').polyfill();
const denodeify = require('denodeify');
const fs = require('fs');
const mkdirp = require('mkdirp');
const queryString = require('query-string');
const winston = require('winston');
const argv = require('yargs')
.string(['a', 'v'])
.string('_')
.argv;
const variables = require('./variables.json');
let application= argv.a || argv._[0];
if(application){
application = application + '/';
}else{
application = '';
}
let version = argv.v || argv._[1];
if (!version) {
version = variables.varVersion;
if (!version) {
winston.warn('usage convertMd2Html [-v] version or set a "varVersion" key in scripts/variables.json');
return;
}
}
const readdirPromise = denodeify(fs.readdir);
const writeFilePromise = denodeify(fs.writeFile);
const accessPromise = denodeify(fs.access);
const mkdirpPromise = denodeify(mkdirp);
const fa = require('markdown-it-fontawesome');
const smartArrows = require('markdown-it-smartarrows');
const decorate = require('markdown-it-decorate');
const mdInline = require('markdown-it-for-inline');
const alerts = require('markdown-it-alerts');
const md = require('markdown-it')({ html: true })
.use(fa)
.use(decorate)
.use(smartArrows)
.use(alerts)
.use(mdInline, 'navigation_in_site', 'link_open', (tokens, idx) => {
const hrefIndex = tokens[idx].attrIndex('href');
if (hrefIndex >= 0 && !tokens[idx].attrs[hrefIndex][1].match(/^http/)) {
if (hrefIndex >= 0 && tokens[idx].attrs[hrefIndex][1].match(/^images\//)) {
tokens[idx].attrs[hrefIndex][1] = tokens[idx].attrs[hrefIndex][1].replace(/^images\//gi, `${application}images/${version}/`);
tokens[idx].attrPush([ 'target', '_blank' ]);
} else {
const pageAndHash = tokens[idx].attrs[hrefIndex][1].split('#', 2);
const page = pageAndHash[0].replace(/\.md$/, '');
tokens[idx].attrPush([ 'ng-click', 'contentCtrl.goTo($event, \'' + page + '\'' + ((pageAndHash[1]) ? ', \'' + pageAndHash[1] + '\'' : '') + ')' ]);
tokens[idx].attrs[hrefIndex][1] = '?' + queryString.stringify({page, hash: pageAndHash[1]});
}
}
if (hrefIndex >= 0 && tokens[idx].attrs[hrefIndex][1].match(/^http:\/\/documentation.bonitasoft.com\//)) {
tokens[idx].attrPush([ 'target', '_self' ]);
}
})
.use(mdInline, 'site_compatible_images', 'image', (tokens, idx) => {
const srcIndex = tokens[idx].attrIndex('src');
if (srcIndex >= 0) {
tokens[idx].attrs[srcIndex][1] = tokens[idx].attrs[srcIndex][1].replace(/^images\//gi, `${application}images/${version}/`);
}
const altIndex = tokens[idx].attrIndex('alt');
if (altIndex < 0) {
tokens[idx].attrPush(['alt', tokens[idx].content]);
} else {
tokens[idx].attrs[altIndex][1] = tokens[idx].content;
}
const titleIndex = tokens[idx].attrIndex('title');
if (titleIndex < 0) {
tokens[idx].attrPush(['title', tokens[idx].content]);
} else {
tokens[idx].attrs[titleIndex][1] = tokens[idx].content;
}
});
const pathToRepo = __dirname + `/..`;
const pathToMd = pathToRepo + '/md';
const pathToApp = `${__dirname}/../build`;
const pathToHtml = `${pathToApp}/html`;
const currentDir = process.env.PWD;
convertDirectory(pathToMd, pathToHtml);
function convertDirectory(mdPath, htmlPath) {
winston.info('converting', mdPath, 'to', htmlPath, 'for version', version);
accessPromise(htmlPath, fs.F_OK)
.catch(e => winston.error(e) || mkdirpPromise(htmlPath))
.then(() => readdirPromise(mdPath)
.then(fileNames => fileNames.filter(fileName => fileName.match(/\.md$/)).forEach(fileName => convertFile(fileName, htmlPath, mdPath)))
);
}
function convertFile(fileName, htmlPath, mdPath) {
writeFilePromise(htmlPath + '/' + fileName.replace(/\.md$/, '.html'),
addForkMeRibbon(fileName) + md.render(
replaceVariables(fs.readFileSync(mdPath + '/' + fileName).toString())
) + '<!-- Generated on ' + new Date() + ' -->'
).then(() => console.log(fileName + ' has been successfully converted'));
}
function replaceVariables(content) {
Object.keys(variables).forEach(key => content = content.replace(new RegExp('\\${' + key + '}','g'), variables[key]));
return content;
}
function addForkMeRibbon(fileName) {
return '<div style="position: relative;"><a href="https://github.com/bonitasoft/bonita-ici-doc/edit/'+version+'/md/'+fileName+'"><img style="position: absolute; top: -1px; right: -40px; border: 0; z-index=-100;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"/></a></div>\n'
}
})();
#!/usr/bin/env node
/**
* Create a json object representing doc taxonomy from index.html
*/
(() => {
'use strict';
let himalaya = require('himalaya');
let xpath = require('xpath');
let dom = require('xmldom').DOMParser;
const denodeify = require('denodeify');
const fs = require('fs');
const writeFilePromise = denodeify(fs.writeFile);
let queryString = require('query-string');
let stripIndents = require('common-tags').stripIndents;
function format(string) {
return string.split(' ').join('-').toLowerCase();
}
function parse(node) {
if (node.tagName === 'ul' && node.children) {
return node.children.map(parse);
} else if (node.tagName === 'li') {
let result;
if (node.children && node.children[0] && node.children[0].tagName === 'a') {
result = parse(node.children[0]);
}
if (node.children && node.children[1] && node.children[1].tagName === 'ul') {
result.children = parse(node.children[1]);
}
return result;
} else if (node.tagName === 'a') {
let result = {
name: node.children[0].content.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>')
};
if (node.attributes.href.match(/^http:\/\//)) {
result.href = node.attributes.href;
} else {
result.page = queryString.parse(node.attributes.href).page;
}
return result;
} else {
return node;
}
}
let rootDir = __dirname + '/../build/html/';
fs.readdir(rootDir, (err, dirs) => {
if (err) {
throw err;
}
var html = fs.readFileSync(rootDir + '/taxonomy.html').toString().replace(/\n/gi, '');
// Generate taxonomy.json from taxonomy.html page
var uls = xpath.select("/ul", new dom().parseFromString(html)); // get first ul of html doc
var json = himalaya.parse(uls[0].toString());
var taxonomy = json[0].children.map(parse);
fs.writeFileSync(rootDir + '/taxonomy.json', JSON.stringify(taxonomy));
console.log('Generated taxonomy.json');
// Generate sub taxonomy HTML pages from root taxonomy.html page
xpath.select('//li[ul]', new dom().parseFromString(html)).forEach(li => {
li = new dom().parseFromString(li.toString());
var filename = queryString.parse(xpath.select1('/li/a/@href', li).value).page + '.html';
var content =
stripIndents`<h1>${xpath.select('string(/li/a)', li)}</h1>
${xpath.select('/li/ul', li).toString()}
<!-- Generated on ${new Date()} -->`;
writeFilePromise(rootDir + filename, content).then(() => console.log('Generated ' + filename));
});
});
})();
{
"varVersion": "1.0",
"bonitaDocVersion": "7.6"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment