(OK) cBPM-CentOS—wrapped by fastcgi—files—executing commands
来源:互联网 发布:ogame 源码 编辑:程序博客网 时间:2024/05/16 01:41
----------------------------下面针对cBPM
[root@localhost html]# gedit /root/.bashrc
[root@localhost html]# gedit /etc/profile
末尾添加:
---------------------------------
export WF_HOME=/etc/nginx/html
export CRITERIA_HOME=/etc/nginx/html
---------------------------------
[root@localhost criteria-lin]# gedit ./src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp
-------------------------
使用绝对路径, 如下。因为 代码里面不能 解析 ${CRITERIA_HOME}。 权宜之计。
//ztg alter path
//String sWfHome = System::getEnvironmentVariable("${CRITERIA_HOME}");
//String sWfHome = "/opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor";
String sWfHome = "/etc/nginx/html";
//ztg alter path
//string sDirectory = bOS::CoreSystem::System::expandEnvironmentStrings ("${WF_HOME}");
//String sDirectory = "/opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor";
String sDirectory = "/etc/nginx/html";
-------------------------
[root@localhost html]# gedit database/Criteria.xml
-------------------------
使用绝对路径, 如下。因为 代码里面不能 解析 ${CRITERIA_HOME}。 权宜之计。
/etc/nginx/html/database/processTemplate
而非:
${CRITERIA_HOME}/database/processTemplate
-------------------------
[root@localhost html]# gedit database/processTemplate/TestNotePad.xml
-------------------------
?NoteResult?@gedit@%FileName1%
修改为
?NoteResult?@touch@%FileName1%
FileName1 ——> /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/notepad.txt
-------------------------
[root@localhost html]# cp /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer .
[root@localhost html]# cp -a /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/database/ .
[root@localhost html]# export WF_HOME=/etc/nginx/html; export CRITERIA_HOME=/etc/nginx/html
[root@localhost html]# spawn-fcgi -a 127.0.0.1 -p 8088 -f /etc/nginx/html/executer
[root@localhost html]# ./executer TestNotePad
[root@localhost html]# lsof executer
+++++++++++++++++++++++++++++++++++++++++
[root@localhost html]# gedit index.html
+++++++++++++++++++++++++++++++++++++++++
[root@localhost html]# gedit cbpm.js
executer ——> /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer
+++++++++++++++++++++++++++++++++++++++++
/opt/cBPM/criteria-lin/src/Criteria/Criteria.Tools/Criteria.Tools.Executor/src/main.cpp
+++++++++++++++++++++++++++++++++++++++++
[root@localhost html]# gedit /root/.bashrc
[root@localhost html]# gedit /etc/profile
末尾添加:
---------------------------------
export WF_HOME=/etc/nginx/html
export CRITERIA_HOME=/etc/nginx/html
---------------------------------
[root@localhost criteria-lin]# gedit ./src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp
-------------------------
使用绝对路径, 如下。因为 代码里面不能 解析 ${CRITERIA_HOME}。 权宜之计。
//ztg alter path
//String sWfHome = System::getEnvironmentVariable("${CRITERIA_HOME}");
//String sWfHome = "/opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor";
String sWfHome = "/etc/nginx/html";
//ztg alter path
//string sDirectory = bOS::CoreSystem::System::expandEnvironmentStrings ("${WF_HOME}");
//String sDirectory = "/opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor";
String sDirectory = "/etc/nginx/html";
-------------------------
[root@localhost html]# gedit database/Criteria.xml
-------------------------
使用绝对路径, 如下。因为 代码里面不能 解析 ${CRITERIA_HOME}。 权宜之计。
/etc/nginx/html/database/processTemplate
而非:
${CRITERIA_HOME}/database/processTemplate
-------------------------
[root@localhost html]# gedit database/processTemplate/TestNotePad.xml
-------------------------
?NoteResult?@gedit@%FileName1%
修改为
?NoteResult?@touch@%FileName1%
FileName1 ——> /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/notepad.txt
-------------------------
[root@localhost html]# cp /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer .
[root@localhost html]# cp -a /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/database/ .
[root@localhost html]# export WF_HOME=/etc/nginx/html; export CRITERIA_HOME=/etc/nginx/html
[root@localhost html]# spawn-fcgi -a 127.0.0.1 -p 8088 -f /etc/nginx/html/executer
[root@localhost html]# ./executer TestNotePad
[root@localhost html]# lsof executer
+++++++++++++++++++++++++++++++++++++++++
[root@localhost html]# gedit index.html
点击(此处)折叠或打开
- <!DOCTYPE html>
- <html>
- <head>
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
- <script type="text/javascript" src="cbpm.js"></script>
- </head>
- <body>
- <div id="loginContent" class="container">
- <div id="loginResult" style="display:none;">
- </div>
- <form id="loginForm" name="loginForm" method="post" action="">
- <fieldset>
- <legend>Enter information</legend>
- <p>
- <label for="processname">Process name</label>
- <br />
- <input type="text" id="processname" name="processname" class="text" size="20" />
- </p>
- <p>
- <button type="submit" class="button positive">
- start
- </button>
- </p>
- </fieldset>
- </form>
- </div>
- </body>
- </html>
+++++++++++++++++++++++++++++++++++++++++
[root@localhost html]# gedit cbpm.js
点击(此处)折叠或打开
- $(document).ready(function(){
- $("form#loginForm").submit(function() { // loginForm is submitted
- var processname = $('#processname').attr('value'); // get first name
- //var name = $('#name').attr('value'); // get name
- //if (processname && name) { // values are not empty
- if (processname) { // values are not empty
- $.ajax({
- type: "GET",
- url: "/executer.cgi", // URL of the Perl script
- // send processname and name as parameters to the Perl script
- //data: "processname=" + processname,
- data: processname,
- // script call was *not* successful
- error: function() {
- alert("script call was not successful");
- },
- // script call was successful
- // perl_data should contain the string returned by the Perl script
- success: function(perl_data){
- alert("Your name is: " + perl_data)
- }
- });
- }
- else {
- $('div#loginResult').text("Enter your name");
- $('div#loginResult').addClass("error");
- }
- $('div#loginResult').fadeIn();
- return false;
- });
- });
executer ——> /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer
+++++++++++++++++++++++++++++++++++++++++
/opt/cBPM/criteria-lin/src/Criteria/Criteria.Tools/Criteria.Tools.Executor/src/main.cpp
点击(此处)折叠或打开
- #include "bOSString.h"
- #include "bOSStringBuffer.h"
- using namespace bOS::CoreString;
- #include "Tracer.h"
- #include "bOSTimer.h"
- #include "WAPI.h"
- #include "WAPIActivity.h"
- #include "WAPIWorkItem.h"
- #include "WAPIProcess.h"
- #include "Activity.h"
- //ztg add, use fcgi
- #include "fcgi_stdio.h"
- //ztg add, use fcgi
- int main_fcgi( char* proc_name, int argc=2);
- //ztg add, use fcgi
- int main(void)
- {
- //main_fcgi("TestNotePad");
- //*
- while (FCGI_Accept() >= 0) {
- char *proc_name = getenv("QUERY_STRING");
- printf("Content type: text/html\n\n");
- //printf("%s",proc_name);
- //main_fcgi("TestNotePad");
- main_fcgi(proc_name);
- } //*/
- }
- static void usage()
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s", "\nUsage:\n"
- " CriteriaToolsExecutor <WorkflowName> [NrExecution]\n\n"
- "This program invokes criteria workflow engine and execute <WorkflowName>\n"
- "Options:\n"
- " NrExecution the number of process execution. Default is 1\n");
- /*
- cout << "\nUsage:\n"
- " CriteriaToolsExecutor <WorkflowName> [NrExecution]\n\n"
- "This program invokes criteria workflow engine and execute <WorkflowName>\n"
- "Options:\n"
- " NrExecution the number of process execution. Default is 1\n"
- << endl;
- */
- }
- //ztg alter, use fcgi
- //int main(int argc, char* argv[])
- int main_fcgi( char* proc_name, int argc)
- {
- if ( argc == 1 )
- {
- usage();
- exit(1);
- }
- String sWorkflowName;
- if ( argc >= 2 )
- {
- //ztg alter, use fcgi
- //sWorkflowName = argv[1];
- sWorkflowName = proc_name;
- }
- unsigned int uiSize =1;
- if ( argc == 3 )
- {
- //ztg del, use fcgi
- //uiSize = atoi(argv[2]);
- }
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s", "The program will perform the following steps:\n\n"
- "1: Criteria session initialization (only one time)\n"
- " ----- for each process (begin) -----\n"
- "2: Create process instance from template\n"
- "3: Execute process instance just created\n"
- " ----- for each process (end) -----\n"
- "4: Querying for activity pending\n"
- "5: close criteria session\n\n");
- /*
- cout << "The program will perform the following steps:\n\n"
- "1: Criteria session initialization (only one time)\n"
- " ----- for each process (begin) -----\n"
- "2: Create process instance from template\n"
- "3: Execute process instance just created\n"
- " ----- for each process (end) -----\n"
- "4: Querying for activity pending\n"
- "5: close criteria session\n\n";
- */
- //ztg del, use fcgi
- //cout << "Press a Key for beginning................................................" << endl;
- //getchar();
- Response* response = new Response();
- response->iCode= 0;
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Criteria session Initialization.....(look at Executor trace file)");
- //cout << "Criteria session Initialization.....(look at Executor trace file)" << endl;
- CM_SETTING_TO("Executor", 7);
- InitSession(response);
- if ( response->iCode != 0 )
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Criteria session Initialization [KO].Error[ %s ]. Exit.\n", response->sMsg);
- //cout << "Criteria session Initialization [KO].Error[" << response->sMsg << "]. Exit." << endl;
- exit(2);
- }
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Criteria session Initialization [OK]");
- //cout << "Criteria session Initialization [OK]" << endl;
- bOS::Utils::Timer tExecutionTimer;
- tExecutionTimer.start();
- char* lProcessId = new char[50];
- //char* acRet = NULL;
- StringBuffer outputSimplified;
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Create process instance from template");
- //cout << "Create process instance from template" << endl;
- for ( unsigned int i=0; i<uiSize; i++)
- {
- bOS::Utils::Timer tTot;
- bOS::Utils::Timer tCreate;
- bOS::Utils::Timer tStart;
- tTot.start();
- tCreate.start();
- createWorkflowProcess((char*)sWorkflowName.c_str(), lProcessId, response);
- tCreate.stop();
- if ( response->iCode == 0 )
- {
- //cout << "Create process instance [OK]. Process Instance Id[" << lProcessId << "]" << endl;
- tStart.start();
- startProcessInSynchWay(lProcessId, response);
- tStart.stop();
- tTot.stop();
- if ( response->iCode == 0 )
- {
- //cout << "Execute process instance [OK]. Process Instance Id[" << lProcessId << "] just started" << endl;
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("[ %u ] Process [ %d ] [ %d ] [ %d ] [ %d ]\n", i, lProcessId, tCreate.getTicks(), tStart.getTicks(), tTot.getTicks());
- //cout << "[" << i << "] Process [" << lProcessId << "] [" << tCreate.getTicks() << "] [" << tStart.getTicks() << "] [" << tTot.getTicks() << "]" << endl;
- }
- else
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Execute process instance [KO]. Process Instance Id[ %s ]\n", lProcessId);
- //cout << "Execute process instance [KO]. Process Instance Id[" << lProcessId << "] not started" << endl;
- }
- }
- else
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Create process instance [KO]. Err[ %s ]\n", response->sMsg);
- //cout << "Create process instance [KO]. Err[" << response->sMsg << "]" << endl;
- }
- }
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Querying for activity pending");
- //cout << "Querying for activity pending" << endl;
- unsigned long lWorkflowRunning=0;
- do
- {
- lWorkflowRunning= getNumberRunningWorkflow(response);
- if ( response->iCode == 0 )
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("WorkflowRunning[ %lu ]\n", lWorkflowRunning);
- //cout << "WorkflowRunning[" << lWorkflowRunning << "]" << endl;
- }
- else
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Error retreiving RunningWorkflow.Err[ %s ]\n", response->sMsg);
- //cout << "Error retreiving RunningWorkflow.Err[" << response->sMsg << "]" << endl;
- }
- }
- while ( lWorkflowRunning > 0);
- tExecutionTimer.stop();
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Execution Time(ms): %d\n", tExecutionTimer.getTicks());
- //cout << "Execution Time(ms): " << tExecutionTimer.getTicks() << endl;
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Press a Key for terminating................................................");
- //cout << "Press a Key for terminating................................................" << endl;
- //getchar();
- //ztg add sleep()
- //sleep(2);
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "EndSession.......");
- //cout << "EndSession......." << endl;
- response->iCode = 0;
- EndSession(response);
- if ( response->iCode == 0 )
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("%s\n", "Session Terminated [OK]");
- //cout << "Session Terminated [OK]" << endl;
- }
- else
- {
- //ztg alter, use fcgi, not use cout, instead of using printf
- printf("Terminating [KO].Err[ %s ]\n", response->sMsg);
- //cout << "Terminating [KO].Err[" << response->sMsg << "]" << endl;
- }
- //
- return 0;
- }
+++++++++++++++++++++++++++++++++++++++++
0
上一篇:大公司用C++做WEB开发主要是用在哪个部分或环节?
下一篇:fastcgi++——A C++ FastCGI Library
相关热门文章
- Android之开发环境搭建
- Android自定义View的实现...
- AndroidManifest.xml配置文件...
- Android相对布局+圆角按钮+Sha...
- 查看Android应用包名package和...
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
0 0
- (OK) cBPM-CentOS—wrapped by fastcgi—files—executing commands
- (OK) cBPM-CentOS—wrapped by fastcgi—files—executing commands
- (OK) 运行cBPM—CentOS7
- (OK) 运行cBPM—Fedora23
- (OK) 运行cBPM—CentOS7
- (OK) 运行cBPM—Fedora23
- (OK) 运行cBPM—Fedora23—ALL
- (OK) 运行cBPM—Fedora23—SIMPLE
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7— API14
- (OK) cBPM-CentOS——Criteria.xml——create-database
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7— API14
- (OK) cBPM-CentOS——Criteria.xml——create-database
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7—API14—2版
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7—API14—3版
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7—API14—2版
- (OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7—API14—3版
- compile the mex files in the Matlab terminal by executing these commands(混合编程)zz
- (OK) 编译cBPM—CentOS7—gdb—gdbserver—成功—调试
- 值得推荐的C/C++框架和库—造轮子前先看看现有的轮子
- Java中别名现象和对象引用问题
- MySql EXPLAIN Output Format(Mysql执行计划分析参数)
- 大公司用C++做WEB开发主要是用在哪个部分或环节?
- 2.3趣味数学之分糖果问题
- (OK) cBPM-CentOS—wrapped by fastcgi—files—executing commands
- 将bitmap按照centercrop的方式截取
- js初学笔记(一)
- Android 权限 exproted 的作用
- I/O重定向
- fastcgi++——A C++ FastCGI Library
- 理解本真的REST架构风格
- 深入理解android之IPC机制与Binder框架
- 继承应用
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
遇到抢劫怎么办简答
在学校遇到地震怎么办
模拟人生4火灾怎么办
酒店发生火灾你怎么办
爆竹店发生火灾怎么办
登山遇到雪崩该怎么办
遇到台风与飓风怎么办
遇到地震该怎么办资料
遇到地震时应该怎么办
遇上台风与飓风怎么办
一旦遇到地震该怎么办
家里发生水灾时怎么办
19岁经期不正常怎么办
来例假肚子难受怎么办
月经来之前难受怎么办
例假来了难受怎么办
来月经特别难受怎么办
快来月经难受怎么办
第一次来月经要怎么办
发生海啸时应该怎么办
发生洪水时应该怎么办
发生雷电时应该怎么办
外痔越来越大了怎么办
oppo手机掉了怎么办
vivo手机丢了怎么办
手机丢了通讯录怎么办
三星手机丢了怎么办
发生火灾时的怎么办
居民楼四层火灾怎么办
遇到火灾怎么办教案ppt
火灾来了怎么办教案
着火了怎么办大班教案
遇到火灾时怎么办图片
遇到火灾时怎么办教案
遇到火灾怎么办30字
遇到火灾我们该怎么办
遇到家电火灾该怎么办
当遇到火灾应该怎么办
宿舍发生电火灾怎么办
发生火灾怎么办20字
发生火灾时怎么办教案