[jBPM] - Re: Example of simple process of executing a service task in JBPM Console.
by Sumeru Saha
Sumeru Saha [https://community.jboss.org/people/sumerus] created the discussion
"Re: Example of simple process of executing a service task in JBPM Console."
To view the discussion, visit: https://community.jboss.org/message/818341#818341
--------------------------------------------------------------
Hi David,
Was your problem resolved? I'm doing things similar to what you were doing ... i wanted to create a Domain Specific service task called "CallaJava" for that i wrote the below workietm definition (WID)
[
"name" : "CallJava",
"parameters" : [
"Interface" : new StringDataType(),
"Operation" : new StringDataType(),
"ParameterType" : new StringDataType(),
"Parameter" : new ObjectDataType("com.sample.service.Student")
],
"results" : [
"Result" : new ObjectDataType("java.util.Map")
],
"displayName" : "CallJava",
"icon" : " http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/j... http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/j..." ,
"defaultHandler" : "com.sample.service.ExtendedServiceTaskHandler"
]
I've put the jar containing my custom WorkItemHandler, a class called "com.sample.service.ExtendedServiceTaskHandler" witin *jbpm-gwt-console-server.war/WEB-INF/lib*
I've added an entry in the *jbpm-gwt-console-server.war/WEB-INF/classes/META-INF/CustomWorkItemHandlers.conf* (like below)
[
"Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),
"CallJava": new com.sample.service.ExtendedServiceTaskHandler(ksession),
]
Now i can get this handler invoked with parameters that i mentioned in the WID, i can have any java code invoked from within the handler, BUT my problem is that i can't pass any variables from the process flow (defined in the BPMN process in designer) into this handler - i can only pass literal values (of primitive types like String, int etc.). Have you been able to do that?
Thanks
Sumeru
---
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/818341#818341]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[Datasource Configuration] - java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file
by m p
m p [https://community.jboss.org/people/mp_108] created the discussion
"java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file"
To view the discussion, visit: https://community.jboss.org/message/820693#820693
--------------------------------------------------------------
Background:
I am developing in Eclipse and using Struts 2 framework to build and deploy .war file to http://www.coderanch.com/forums/f-63/JBoss JBoss. 4.2.3GA
There is an action class that I am using to insert a user into a database table - pretty simple stuff http://cache-www.coderanch.com/images/smilies/3b63d1616c5dfcf29f8a7a031aa... http://cache-www.coderanch.com/images/smilies/3b63d1616c5dfcf29f8a7a031aa...
I get the following exception for executeUpdate() method.
DEBUG com.opensymphony.xwork2.DefaultActionInvocation.debug:68 - Executing action method = execute
[STDOUT] >>>>>>>>>>insert into catNav.USERS values('mm', 'pp', 88, 'mm.pp(a)yahoo.com (mailto:'mm.pp(a)yahoo.com)');
[STDOUT] java.sql.SQLException (http://docs.oracle.com/javase/7/docs/api/java/sql/SQLException.html): [Microsoft][ODBC Microsoft Access Driver] Could not find file *'C:\java\jboss-4.2.3.GA\bin\catNav.mdb'*.
*I am provide the full path to the database .mdb file but the exception is referring to file in jboss folder, which is does no exist. I am struggling to find a solution to resolve this. * The path, using either \\ or / file separators is validated as an exception occurs if invalid path is defined.
The code is below; I have the same code in a standalone Java program that executes successfully (I verify row was added) .... *but fails when running on JBoss* :(
public String execute() throws Exception {
//call Service class to store personBean's state in database
final String dbName = "catNav";
Connection con = null; // The connection to the database.
Statement stmt = null;
// The following code can throw errors, so they must be caught.
try{
// First, tell Java what driver to use and where to find it.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Next, create a connection to your data source.
// Specify that you are using the ODBC-JDBC Bridge.
// And specify the data source name from ODBC.
String database =
"jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/Users/mp/Documents/Work/JDBC/catNav.mdb;";
con = DriverManager.getConnection(database, "", "");
/* also tried:
con = DriverManager.getConnection("jdbc:odbc:catNavDB");
*/
// Create an SQL statement.
stmt = con.createStatement();
// Execute some SQL to create a table in your database.
// If the table already exists, an exception is thrown!
String sqlSt = "insert into " + dbName +
".USERS " +
"values('" + personBean.getFirstName() + "', " + // FIRST_NAME
"'" + personBean.getLastName() + "', " + // LAST_NAME
personBean.getAge() + ", " + // AGE
"'" + personBean.getEmail() + "'); " ; // EMAIL
// display SQL statment
System.out.println (">>>>>>>>>>" + sqlSt );
stmt.executeUpdate( sqlSt);
}
// Catch any exceptions that are thrown.
etc.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/820693#820693]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[Beginner's Corner] - Init script of jboss 4.2.3 GA - jdk6 for Debian 7
by Mikel Vadillo
Mikel Vadillo [https://community.jboss.org/people/mikelvadillo] created the discussion
"Init script of jboss 4.2.3 GA - jdk6 for Debian 7"
To view the discussion, visit: https://community.jboss.org/message/820557#820557
--------------------------------------------------------------
Hi all, ultra noob mega newbie here.
I'm an student of Informatics Ingeniering in the university of Basque Country, Spain.
For my last year project i'm trying to make work a server with OpenACS ( http://sourceforge.net/projects/openacs/ http://sourceforge.net/projects/openacs/) in a Debian 7 distribution with many routers. This opensource web service goes over Jboss (author recomends 4.2.x versions) and at least i have managed to configure almost all. I'm glad because is my first contact with this and it is very interesting.
My only problem is to use a good init script to use with Debian 7. I have composed one, using several i have found over internet and mixing them. Finally it works, it seems to my noob eyes, fine. This is the script:
| #!/bin/sh
### BEGIN INIT INFO
# Provides: jboss
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop JBoss AS v7.0.0
### END INIT INFO
JBOSS_HOME=/opt/jboss
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-i386
#JBOSS_BIND_ADDR="-b 192.168.1.205"
#configuration to use, usually one of 'minimal', 'default', 'all'
#JBOSS_CONF=${JBOSS_CONF:-"default"}
export JAVA_HOME
export JBOSS_HOME
EXEC=${JBOSS_HOME}/bin/run.sh
#JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -b 192.168.1.205"}
#define the script to use to start jboss
#JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF"}
do_start(){
start-stop-daemon --start --chuid jboss --user jboss --name jboss -b --exec ${EXEC}
}
do_stop(){
start-stop-daemon --stop -u jboss
rm -f ${PIDFILE}
}
case "$1" in
start)
echo "Starting JBoss 4.2.3"
do_start
;;
stop)
echo "Stopping JBoss 4.2.3"
do_stop
;;
restart)
echo "Restarting JBoss 4.2.3"
do_stop
sleep 20
do_start
;;
*)
echo "Usage: /etc/init.d/jboss4.2.3 {start|stop|restart}"
exit 1
;;
esac |
My problem is the ip binding. Untill now i have been starting Jboss through console using:
cd /opt/jboss/bin
./run.sh -b 192.168.1.205
but now what i get with this script is the web only working in localhost as URL.
I have read many articles in the internet about this but i can't make it work. As you can see in the script, there are several tryes i have done in commented lines but none of them have worked well.
I have even tryed to add this two things (not at the same time) in the /opt/jboss/bin/run.conf file:
-Dbind.address=192.168.1.205
-Djgroups.bind_addr=192.168.1.205
But it's not worth it.
Any ideas?
Perhaps, due to my poor english, you should have questions about what i have done or how bad i have explained it....feel free to ask.
Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/820557#820557]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months