[jBPM] - How to access a processInstance within a work item
by Tobias Wittur
Tobias Wittur [http://community.jboss.org/people/tob1as] created the discussion
"How to access a processInstance within a work item"
To view the discussion, visit: http://community.jboss.org/message/623382#623382
--------------------------------------------------------------
Hello,
I know usually a signal is invoked upon the knowledgeSession, and all processInstances that are registered on this session and listen to the messageType, will be notified. E.g.
ksession.signalEvent("Message-StartProcessMessage", params);
However, how can I signal a specific process instance from within a work Item?
I know how to get to the ProcessInstanceId, but how would I have to go on?
> public class CustomerServiceTaskHandler implements WorkItemHandler {
>
> public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
> System.out.println(workItem.getProcessInstanceId());
>
> try{
> ...
> }catch(Exception ex){
> myProcessInstance.signal('AbortTheCurrentInstance');
> }
>
> }
>
> public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
> }
> }
Best regards,
Tobias
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/623382#623382]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - Process flow stops after human task completion in jBPM5.1
by Michał Warecki
Michał Warecki [http://community.jboss.org/people/michal.warecki] created the discussion
"Process flow stops after human task completion in jBPM5.1"
To view the discussion, visit: http://community.jboss.org/message/623308#623308
--------------------------------------------------------------
Hi,
I have very simple process flow:
1. Script task: Log "Before"
2. Human Task
3. Script task: Log "After"
When I'm running process instance I can see log "Before". Next, I'm starting human task and next completing ( I can see in database that task is in stated "Completed"). Flow stops after human task completion and I can't do anything. There is no exception.
Here are logs from console:
> Hibernate: insert into ProcessInstanceInfo (lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into VariableInstanceLog (log_date, processId, processInstanceId, value, variableId, variableInstanceId) values (?, ?, ?, ?, ?, ?)
> Hibernate: insert into ProcessInstanceLog (end_date, processId, processInstanceId, start_date) values (?, ?, ?, ?)
> Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)
>
> BEFORE
>
> Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)
> Hibernate: select user_.id from OrganizationalEntity user_ where user_.id=?
> Hibernate: update WorkItemInfo set creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=? and OPTLOCK=?
> Hibernate: insert into Task (allowedToDelegate, taskInitiator_id, priority, activationTime, actualOwner_id, createdBy_id, createdOn, documentAccessType, documentContentId, documentType, expirationTime, faultAccessType, faultContentId, faultName, faultType, outputAccessType, outputContentId, outputType, parentId, previousStatus, processInstanceId, skipable, status, workItemId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
> Hibernate: insert into I18NText (language, text) values (?, ?)
> Hibernate: insert into I18NText (language, text) values (?, ?)
> Hibernate: insert into I18NText (language, text) values (?, ?)
> Hibernate: insert into Content (content) values (?)
> Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?
> Hibernate: update I18NText set Task_Descriptions_Id=? where id=?
> Hibernate: update I18NText set Task_Names_Id=? where id=?
> Hibernate: insert into PeopleAssignments_BAs (task_id, entity_id) values (?, ?)
> Hibernate: insert into PeopleAssignments_PotOwners (task_id, entity_id) values (?, ?)
> Hibernate: update I18NText set Task_Subjects_Id=? where id=?
> Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?
> Hibernate: update ProcessInstanceInfo set lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?
> Hibernate: select task0_.id as col_0_0_, task0_.processInstanceId as col_1_0_, names5_.text as col_2_0_, subjects3_.text as col_3_0_, descriptio4_.text as col_4_0_, task0_.status as col_5_0_, task0_.priority as col_6_0_, task0_.skipable as col_7_0_, task0_.actualOwner_id as col_8_0_, task0_.createdBy_id as col_9_0_, task0_.createdOn as col_10_0_, task0_.activationTime as col_11_0_, task0_.expirationTime as col_12_0_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.createdBy_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id left outer join I18NText subjects3_ on task0_.id=subjects3_.Task_Subjects_Id left outer join I18NText descriptio4_ on task0_.id=descriptio4_.Task_Descriptions_Id left outer join I18NText names5_ on task0_.id=names5_.Task_Names_Id, OrganizationalEntity organizati6_ where organizati6_.id=? and (organizati6_.id in (select potentialo9_.entity_id from PeopleAssignments_PotOwners potentialo9_ where task0_.id=potentialo9_.task_id)) and (names5_.language=? or (select count(names10_.Task_Names_Id) from I18NText names10_ where task0_.id=names10_.Task_Names_Id)=0) and (subjects3_.language=? or (select count(subjects11_.Task_Subjects_Id) from I18NText subjects11_ where task0_.id=subjects11_.Task_Subjects_Id)=0) and (descriptio4_.language=? or (select count(descriptio12_.Task_Descriptions_Id) from I18NText descriptio12_ where task0_.id=descriptio12_.Task_Descriptions_Id)=0) and (task0_.status in ('Created' , 'Ready' , 'Reserved' , 'InProgress' , 'Suspended')) and (task0_.expirationTime is null)
> Hibernate: select user0_.id as id19_0_ from OrganizationalEntity user0_ where user0_.id=? and user0_.DTYPE='User'
> Hibernate: select task0_.id as id24_3_, task0_.allowedToDelegate as allowedT2_24_3_, task0_.taskInitiator_id as taskIni23_24_3_, task0_.priority as priority24_3_, task0_.activationTime as activati4_24_3_, task0_.actualOwner_id as actualO24_24_3_, task0_.createdBy_id as createdBy25_24_3_, task0_.createdOn as createdOn24_3_, task0_.documentAccessType as document6_24_3_, task0_.documentContentId as document7_24_3_, task0_.documentType as document8_24_3_, task0_.expirationTime as expirati9_24_3_, task0_.faultAccessType as faultAc10_24_3_, task0_.faultContentId as faultCo11_24_3_, task0_.faultName as faultName24_3_, task0_.faultType as faultType24_3_, task0_.outputAccessType as outputA14_24_3_, task0_.outputContentId as outputC15_24_3_, task0_.outputType as outputType24_3_, task0_.parentId as parentId24_3_, task0_.previousStatus as previou18_24_3_, task0_.processInstanceId as process19_24_3_, task0_.skipable as skipable24_3_, task0_.status as status24_3_, task0_.workItemId as workItemId24_3_, user1_.id as id19_0_, user2_.id as id19_1_, user3_.id as id19_2_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.taskInitiator_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id left outer join OrganizationalEntity user3_ on task0_.createdBy_id=user3_.id where task0_.id=?
> Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?
> Hibernate: select task0_.id as id24_3_, task0_.allowedToDelegate as allowedT2_24_3_, task0_.taskInitiator_id as taskIni23_24_3_, task0_.priority as priority24_3_, task0_.activationTime as activati4_24_3_, task0_.actualOwner_id as actualO24_24_3_, task0_.createdBy_id as createdBy25_24_3_, task0_.createdOn as createdOn24_3_, task0_.documentAccessType as document6_24_3_, task0_.documentContentId as document7_24_3_, task0_.documentType as document8_24_3_, task0_.expirationTime as expirati9_24_3_, task0_.faultAccessType as faultAc10_24_3_, task0_.faultContentId as faultCo11_24_3_, task0_.faultName as faultName24_3_, task0_.faultType as faultType24_3_, task0_.outputAccessType as outputA14_24_3_, task0_.outputContentId as outputC15_24_3_, task0_.outputType as outputType24_3_, task0_.parentId as parentId24_3_, task0_.previousStatus as previou18_24_3_, task0_.processInstanceId as process19_24_3_, task0_.skipable as skipable24_3_, task0_.status as status24_3_, task0_.workItemId as workItemId24_3_, user1_.id as id19_0_, user2_.id as id19_1_, user3_.id as id19_2_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.taskInitiator_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id left outer join OrganizationalEntity user3_ on task0_.createdBy_id=user3_.id where task0_.id=?
> Hibernate: select subtaskstr0_.Task_Id as Task4_1_, subtaskstr0_.id as id1_, subtaskstr0_.id as id25_0_, subtaskstr0_.name as name25_0_, subtaskstr0_.DTYPE as DTYPE25_0_ from SubTasksStrategy subtaskstr0_ where subtaskstr0_.Task_Id=?
> Hibernate: update Task set allowedToDelegate=?, taskInitiator_id=?, priority=?, activationTime=?, actualOwner_id=?, createdBy_id=?, createdOn=?, documentAccessType=?, documentContentId=?, documentType=?, expirationTime=?, faultAccessType=?, faultContentId=?, faultName=?, faultType=?, outputAccessType=?, outputContentId=?, outputType=?, parentId=?, previousStatus=?, processInstanceId=?, skipable=?, status=?, workItemId=? where id=?
> Hibernate: select task0_.id as id24_3_, task0_.allowedToDelegate as allowedT2_24_3_, task0_.taskInitiator_id as taskIni23_24_3_, task0_.priority as priority24_3_, task0_.activationTime as activati4_24_3_, task0_.actualOwner_id as actualO24_24_3_, task0_.createdBy_id as createdBy25_24_3_, task0_.createdOn as createdOn24_3_, task0_.documentAccessType as document6_24_3_, task0_.documentContentId as document7_24_3_, task0_.documentType as document8_24_3_, task0_.expirationTime as expirati9_24_3_, task0_.faultAccessType as faultAc10_24_3_, task0_.faultContentId as faultCo11_24_3_, task0_.faultName as faultName24_3_, task0_.faultType as faultType24_3_, task0_.outputAccessType as outputA14_24_3_, task0_.outputContentId as outputC15_24_3_, task0_.outputType as outputType24_3_, task0_.parentId as parentId24_3_, task0_.previousStatus as previou18_24_3_, task0_.processInstanceId as process19_24_3_, task0_.skipable as skipable24_3_, task0_.status as status24_3_, task0_.workItemId as workItemId24_3_, user1_.id as id19_0_, user2_.id as id19_1_, user3_.id as id19_2_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.taskInitiator_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id left outer join OrganizationalEntity user3_ on task0_.createdBy_id=user3_.id where task0_.id=?
> Hibernate: select names0_.Task_Names_Id as Task5_1_, names0_.id as id1_, names0_.id as id20_0_, names0_.language as language20_0_, names0_.text as text20_0_ from I18NText names0_ where names0_.Task_Names_Id=?
> Hibernate: select subjects0_.Task_Subjects_Id as Task4_1_, subjects0_.id as id1_, subjects0_.id as id20_0_, subjects0_.language as language20_0_, subjects0_.text as text20_0_ from I18NText subjects0_ where subjects0_.Task_Subjects_Id=?
> Hibernate: select descriptio0_.Task_Descriptions_Id as Task6_1_, descriptio0_.id as id1_, descriptio0_.id as id20_0_, descriptio0_.language as language20_0_, descriptio0_.text as text20_0_ from I18NText descriptio0_ where descriptio0_.Task_Descriptions_Id=?
> Hibernate: select potentialo0_.task_id as task1_1_, potentialo0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from PeopleAssignments_PotOwners potentialo0_ left outer join OrganizationalEntity organizati1_ on potentialo0_.entity_id=organizati1_.id where potentialo0_.task_id=?
> Hibernate: select excludedow0_.task_id as task1_1_, excludedow0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from PeopleAssignments_ExclOwners excludedow0_ left outer join OrganizationalEntity organizati1_ on excludedow0_.entity_id=organizati1_.id where excludedow0_.task_id=?
> Hibernate: select taskstakeh0_.task_id as task1_1_, taskstakeh0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from PeopleAssignments_Stakeholders taskstakeh0_ left outer join OrganizationalEntity organizati1_ on taskstakeh0_.entity_id=organizati1_.id where taskstakeh0_.task_id=?
> Hibernate: select businessad0_.task_id as task1_1_, businessad0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from PeopleAssignments_BAs businessad0_ left outer join OrganizationalEntity organizati1_ on businessad0_.entity_id=organizati1_.id where businessad0_.task_id=?
> Hibernate: select recipients0_.task_id as task1_1_, recipients0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from PeopleAssignments_Recipients recipients0_ left outer join OrganizationalEntity organizati1_ on recipients0_.entity_id=organizati1_.id where recipients0_.task_id=?
> Hibernate: select delegates0_.task_id as task1_1_, delegates0_.entity_id as entity2_1_, organizati1_.id as id19_0_, organizati1_.DTYPE as DTYPE19_0_ from Delegation_delegates delegates0_ left outer join OrganizationalEntity organizati1_ on delegates0_.entity_id=organizati1_.id where delegates0_.task_id=?
> Hibernate: select comments0_.TaskData_Comments_Id as TaskData5_2_, comments0_.id as id2_, comments0_.id as id16_1_, comments0_.addedAt as addedAt16_1_, comments0_.addedBy_id as addedBy4_16_1_, comments0_.text as text16_1_, user1_.id as id19_0_ from task_comment comments0_ left outer join OrganizationalEntity user1_ on comments0_.addedBy_id=user1_.id where comments0_.TaskData_Comments_Id=?
> Hibernate: select attachment0_.TaskData_Attachments_Id as TaskData9_2_, attachment0_.id as id2_, attachment0_.id as id13_1_, attachment0_.accessType as accessType13_1_, attachment0_.attachedAt as attachedAt13_1_, attachment0_.attachedBy_id as attachedBy8_13_1_, attachment0_.attachmentContentId as attachme4_13_1_, attachment0_.contentType as contentT5_13_1_, attachment0_.name as name13_1_, attachment0_.attachment_size as attachment7_13_1_, user1_.id as id19_0_ from Attachment attachment0_ left outer join OrganizationalEntity user1_ on attachment0_.attachedBy_id=user1_.id where attachment0_.TaskData_Attachments_Id=?
> Hibernate: select startdeadl0_.Deadlines_StartDeadLine_Id as Deadlines4_1_, startdeadl0_.id as id1_, startdeadl0_.id as id17_0_, startdeadl0_.deadline_date as deadline2_17_0_, startdeadl0_.escalated as escalated17_0_ from Deadline startdeadl0_ where startdeadl0_.Deadlines_StartDeadLine_Id=?
> Hibernate: select enddeadlin0_.Deadlines_EndDeadLine_Id as Deadlines5_1_, enddeadlin0_.id as id1_, enddeadlin0_.id as id17_0_, enddeadlin0_.deadline_date as deadline2_17_0_, enddeadlin0_.escalated as escalated17_0_ from Deadline enddeadlin0_ where enddeadlin0_.Deadlines_EndDeadLine_Id=?
> Hibernate: select subtaskstr0_.Task_Id as Task4_1_, subtaskstr0_.id as id1_, subtaskstr0_.id as id25_0_, subtaskstr0_.name as name25_0_, subtaskstr0_.DTYPE as DTYPE25_0_ from SubTasksStrategy subtaskstr0_ where subtaskstr0_.Task_Id=?
What could be the reason of such behaviour?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/623308#623308]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JNDI and Naming] - javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:7099
by Ruslan Danilin
Ruslan Danilin [http://community.jboss.org/people/rdanilin] created the discussion
"javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:7099"
To view the discussion, visit: http://community.jboss.org/message/622765#622765
--------------------------------------------------------------
Hello,
I'm trying to run standalone java application that subscribes to JMS topic on *JBoss AS 7.0.1* but get an error.
The same app works fine on JBoss AS 6.1. I'm running JBoss with full profile (./standalone.sh --server-config=standalone-preview.xml)
Connection properties looks like this:
INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
URL_PKG_PREFIXES=org.jboss.naming:org.jnp.interfaces
PROVIDER_URL=jnp://127.0.0.1:1099
When I'm starting my app I get this exception:
Exception in thread "main" javax.naming.CommunicationException: *Could not obtain connection to any of these urls: 127.0.0.1:7099* and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1690)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1761)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:695)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at net.delmax.JMSClient.example(JMSClient.java:26)
at net.delmax.JMSClient.main(JMSClient.java:114)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:135)
at java.net.DatagramSocket.receive(DatagramSocket.java:729)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1659)
... 6 more
[Root exception is javax.naming.CommunicationException: Failed to connect to server /127.0.0.1:7099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /127.0.0.1:7099 [Root exception is java.net.ConnectException: Connection refused]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1780)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:695)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at net.delmax.JMSClient.example(JMSClient.java:26)
at net.delmax.JMSClient.main(JMSClient.java:114)
Caused by: javax.naming.CommunicationException: Failed to connect to server /127.0.0.1:7099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /127.0.0.1:7099 [Root exception is java.net.ConnectException: Connection refused]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:337)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1746)
... 5 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server /127.0.0.1:7099 [Root exception is java.net.ConnectException: Connection refused]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:307)
... 6 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:303)
... 6 more
why this happens and how can I fix it?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/622765#622765]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months