[jBPM] - Can't get Twitter service task to work when deployed via Guvnor
by Andy McC
Andy McC [https://community.jboss.org/people/andymcc] created the discussion
"Can't get Twitter service task to work when deployed via Guvnor"
To view the discussion, visit: https://community.jboss.org/message/807854#807854
--------------------------------------------------------------
[My set up: Windows 7 and 8, jBPM-5.4.0.Final, Eclipse Helios]
This is probably another newbie issue, but I have a simple Twitter process that runs in Eclipse that I just can't get to run via Guvnor. (HTTP Status 500 window and the message "Could not find work item handler for Twitter")
>From the working Eclipse version I've:
1. Copied over my BPMN task, jbmp-twitter.jar and twitter4j-core-2.2.2.jar using the Eclipse->Guvnor tooling.
2. In Gunvor, and using the "connect to service repository" utility in Designer, I've downloaded the Twitter service task from http://people.redhat.com/kverlaen/repository/ http://people.redhat.com/kverlaen/repository/ (There's an issue with the stencil set not updating properly in Designer or Eclipse which I'm going to put on Jira, but all the "bits" seem to have been added to defaultPackage OK)
3. I've then updated the twitter.properties file with the data for my account
4. Added the content of twitter.wid to WorkDefinitions.conf (This may be something I'm doing wrong)
5. Generated png and default task forms, everything is green-ticked in Guvnor and the package validates and builds OK.
6. I've then copied jbmp-twitter.jar, twitter4j-core-2.2.2.jar and twitter.properties into jbpm-installer/dependencies and run ant install.demo (I've also tried copying directly into jbpm-gwt-console-server.war/WEB-INF/lib but making no difference)
I can start the process from jbpm-console but it fails with an HTTP Status 500 window and the message "Could not find work item handler for Twitter".
Can anyone see what step I've missed along the way? Do the jars need to be copied somewhere else in addition to the steps above?
Really grateful for any help - it took me while to get the Email task working in both Eclipse and Guvnor and I finally thought I'd sorted out the steps in my mind.
Regards and thanks,
Andy McC
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/807854#807854]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - timer in sub-process differences jbpm4.3 - jbpm 4.4
by Ion Mihov
Ion Mihov [https://community.jboss.org/people/zalmolksis] created the discussion
"timer in sub-process differences jbpm4.3 - jbpm 4.4"
To view the discussion, visit: https://community.jboss.org/message/808616#808616
--------------------------------------------------------------
we are updating in our sistem from jbpm 4.3 to 4.4 and we have a problem with timeout timer in subprocess
this code is working in jbpm 4.3 :
<sub-process name="prc1" sub-process-key="prc1">
<parameter-in subvar="pc" var="pc"/>
<parameter-out subvar="pc" var="pc"/>
<transition name="timeout" to="prcTimedOut">
<timer duedate="#{dueTimeInSeconds}"/>
</transition>
<transition name="end" to="markProcessAsEnded"/>
</sub-process>
<java continue="async" expr="#{prcProcessor}" method="prcTimeout" name="prcTimedOut">
<arg><object expr="#{pc}"/></arg>
<transition to="markProcessAsEnded"/>
</java>
in jbpm 4.4 we get exception when timer fires :
[16/04/13 18:39:03:003] [pool-11-thread-1] ERROR org.jbpm.pvm.internal.cmd.ExecuteJobCmd: exception while executing 'timer[140008|2013-04-16 18:38:57|timeout]'
org.jbpm.api.JbpmException: execution[prcMain.9JPOVJXl7JQQTnSvyZWJzQAAAAAAAAAAAAAAAAAAAAA=.prc1.140007] has running subprocess: execution[prc1.140009] in state active-root
at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1086)
at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:424)
at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.pvm.internal.model.ExecutionImpl$$EnhancerByCGLIB$$80e585a7.signal(<generated>)
at org.jbpm.pvm.internal.job.TimerImpl.execute(TimerImpl.java:92)
at org.jbpm.pvm.internal.job.TimerImpl.execute(TimerImpl.java:50)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:79)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
can someone point me to a good documentation , because in developer guide I dit not found info i need
Thanks !
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/808616#808616]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[jBPM] - Extending jbpm-human-task-war by custom EventListner but they don't get fired
by René Zoller
René Zoller [https://community.jboss.org/people/rzoller] created the discussion
"Extending jbpm-human-task-war by custom EventListner but they don't get fired"
To view the discussion, visit: https://community.jboss.org/message/808596#808596
--------------------------------------------------------------
Hello all,
I'm trying to extend the jbpm-human-task-war by implementing an own HumanTaskServiceServlet and a custom EventListner. My EventListner looks like this:
public class MyTaskEventListner implements TaskEventListener {
private static final Logger logger = LoggerFactory
.getLogger(SiebelTaskEventListner.class);
@Override
public void taskCreated(TaskUserEvent event) {
// TODO Call Siebel to add Task;
logger.info("Task created!");
}
@Override
public void taskClaimed(TaskUserEvent event) {
// Nothing to do here
}
@Override
public void taskStarted(TaskUserEvent event) {
// TODO Call Desktop Connector to open dialogue;
logger.info("Task Started!");
}
@Override
public void taskStopped(TaskUserEvent event) {
// TODO Call Siebel to make the activity editable;
logger.info("Task stoped!.");
}
@Override
public void taskReleased(TaskUserEvent event) {
// Nothing to do here
}
@Override
public void taskCompleted(TaskUserEvent event) {
// TODO Call Siebel to close activity and make it editable again;
logger.info("Task completed! I have to inform Siebel.");
}
@Override
public void taskFailed(TaskUserEvent event) {
logger.info("Task failed!");
}
@Override
public void taskSkipped(TaskUserEvent event) {
// Nothing to do here
}
@Override
public void taskForwarded(TaskUserEvent event) {
// Nothing to do here
}
}
I'm adding the EventListner with
public class HumanTaskServiceServlet extends HttpServlet {
private static final long serialVersionUID = 5L;
private TaskServer server = null;
private Thread thread = null;
public void init() throws ServletException {
EntityManagerFactory emf = Persistence
.createEntityManagerFactory(getConfigParameter(
"task.persistence.unit", "org.jbpm.task"));
String escalationHandlerClass = getConfigParameter(
"escalated.deadline.handler.class",
DefaultEscalatedDeadlineHandler.class.getName());
TaskService taskService = null;
try {
EscalatedDeadlineHandler handler = getInstance(escalationHandlerClass);
if (handler instanceof DefaultEscalatedDeadlineHandler) {
UserInfo userInfo = null;
try {
String userInfoClass = getConfigParameter(
"user.info.class", null);
userInfo = getInstance(userInfoClass);
} catch (IllegalArgumentException e) {
Properties registryProps = new Properties();
registryProps.load(this.getClass().getResourceAsStream(
"/userinfo.properties"));
// userInfo = new DefaultUserInfo(registryProps);
}
((DefaultEscalatedDeadlineHandler) handler)
.setUserInfo(userInfo);
}
taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener(),
handler);
} catch (Exception e) {
taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener());
}
String usersConfig = getConfigParameter("load.users", "");
String groupsConfig = getConfigParameter("load.groups", "");
Map<String, User> users = new HashMap<String, User>();
Map<String, Group> groups = new HashMap<String, Group>();
try {
if (usersConfig != null && usersConfig.length() > 0) {
if (usersConfig.endsWith(".mvel")) {
Map vars = new HashMap();
Reader reader = new InputStreamReader(
getConfigFileStream(usersConfig));
users = (Map<String, User>) TaskService.eval(reader, vars);
} else if (usersConfig.endsWith(".properties")) {
Properties props = new Properties();
props.load(getConfigFileStream(usersConfig));
Enumeration<?> ids = props.propertyNames();
while (ids.hasMoreElements()) {
Object idObject = ids.nextElement();
if (idObject instanceof String) {
String id = (String) idObject;
users.put(id, new User(id));
}
}
}
}
} catch (Exception e) {
System.err.println("Problem loading users from specified file: "
+ usersConfig + " error message: " + e);
}
try {
if (groupsConfig != null && groupsConfig.length() > 0) {
if (groupsConfig.endsWith(".mvel")) {
Map vars = new HashMap();
Reader reader = new InputStreamReader(
getConfigFileStream(groupsConfig));
groups = (Map<String, Group>) TaskService
.eval(reader, vars);
} else if (groupsConfig.endsWith(".properties")) {
Properties props = new Properties();
props.load(getConfigFileStream(groupsConfig));
Enumeration<?> ids = props.propertyNames();
while (ids.hasMoreElements()) {
Object idObject = ids.nextElement();
if (idObject instanceof String) {
String id = (String) idObject;
groups.put(id, new Group(id));
}
}
}
}
} catch (Exception e) {
System.err.println("Problem loading groups from specified file: "
+ groupsConfig + " error message: " + e);
}
taskService.addUsersAndGroups(users, groups);
// Add our own Siebel TaskListener
taskService.addEventListener(new SiebelTaskEventListner());
int port = Integer.parseInt(getConfigParameter("hornetq.port", "5153"));
String host = getConfigParameter("hornetq.host", "localhost");
server = new HornetQTaskServer(taskService, host, port);
thread = new Thread(server);
thread.start();
System.out.println("HornetQ Task service started correctly !");
System.out.println("HornetQ Task service running (host " + host
+ " port " + port + ") ...");
UserGroupCallbackManager manager = UserGroupCallbackManager
.getInstance();
if (!manager.existsCallback()) {
String callbackClass = getConfigParameter(
"user.group.callback.class", "");
UserGroupCallback userGroupCallback = getInstance(callbackClass);
manager.setCallback(userGroupCallback);
}
System.out.println("Task service startup completed successfully !");
}
...
}
But when I'm starting a Task in jbpm-console non of the methods is executed. How can I assign/ how do I correctly implement a EventListner for User Tasks?
Thank you!
René
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/808596#808596]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years
[Datasource Configuration] - A question about configure the 'xa_open string'
by Thomas Chang
Thomas Chang [https://community.jboss.org/people/thomas2008ch] created the discussion
"A question about configure the 'xa_open string'"
To view the discussion, visit: https://community.jboss.org/message/808567#808567
--------------------------------------------------------------
Hi,
I am not sure if I should put my post here. Hope someone can help.
Background to my question:
One of our Jboss-Server is installed on a machine which OS is RHEL (RedHat Linux). There is a C/C++-Programm which is capsulated in a rar file uses the XA-transaction. This will create XA-trace file everyday. But these trace files (such as 'xa_NULL04162013.trc') are pushed unter $JBOSS_HOME/bin. I find thi is not correct. So I want to relocate these trace files.
According to the Oracle documents the location of the trace files is defined in the so-called xa_open string (or simply open string). I find out this 'xa_open string' is defined in a file called ra.xml inside the rar (such as 'RACPerf.rar').
I've added the LogDir to the 'xa_open string' but it seems it doesn't work since I find the xa-trace files are still pushed under the $JBOSS_HOME/bin.
Here is the ra.xml where the 'xa_open string' defined.
Has someone idea?
[code]
<?xml version="1.0" encoding="UTF-8" ?>
- <connector xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" version="1.5">
<display-name>RACPerf</display-name>
<vendor-name>PYLON</vendor-name>
<eis-type>PERFEKT C Resource Adapter</eis-type>
<resourceadapter-version>1.0</resourceadapter-version>
- <resourceadapter>
<resourceadapter-class>org.jboss.resource.deployment.DummyResourceAdapter</resourceadapter-class>
- <outbound-resourceadapter>
- <connection-definition>
<managedconnectionfactory-class>de.pylon.ra.connection.ManagedFactory</managedconnectionfactory-class>
- <config-property>
<description>Oracle XA connect String, er wird um ACC=P/(UserName)/(Password) ergaenzt. Er darf die Elemente ACC und SesTM nicht enthalten.</description>
<config-property-name>ConnectionURL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle_XA+SqlNet=VGERTJ+Threads=true+Loose_Coupling=false+MaxCur=50+LogDir=/var/log/jboss/vger1</config-property-value>
</config-property>
- <config-property>
<config-property-name>UserName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>pylon</config-property-value>
</config-property>
- <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>pylon</config-property-value>
</config-property>
- <config-property>
<description>session timeout value in seconds, *this* is a required parameter</description>
<config-property-name>sessionTimeout</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value>7200</config-property-value>
</config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>de.pylon.ra.connection.FactoryImpl</connectionfactory-impl-class>
<connection-interface>javax.resource.cci.Connection</connection-interface>
<connection-impl-class>de.pylon.ra.connection.RAConnection</connection-impl-class>
</connection-definition>
<transaction-support>XATransaction</transaction-support>
- <authentication-mechanism>
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
<reauthentication-support>true</reauthentication-support>
</outbound-resourceadapter>
</resourceadapter>
</connector>
[/code]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/808567#808567]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years