Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-27 Thread Michael Wohlfart
Michael Wohlfart [http://community.jboss.org/people/mwohlf] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/554662#554662

--
 HuiSheng Xu wrote:
 
 [...] And yes,  the Environment interface didn't declared close() method,  
 because we didn't need it.  The EnvironmentInterceptor will open/close the 
 Environment instance automaticly. [...]
 
Hi HuiSheng,
can I please have the close() method on the interface, all implementing classes 
also implement close(), the method is in the interface according to the docs:  
http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e3068 
http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e3068 and finally it's 
freaking ugly to cast each time i open/close an environment manually...

--

Reply to this message by going to Community
[http://community.jboss.org/message/554662#554662]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-08 Thread Joe Gottman
Joe Gottman [http://community.jboss.org/people/joegottman] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551675#551675

--
 HuiSheng Xu wrote:
 
 
 
 
 Also,  I think there is no api to get ActivityExecution from api services.

 It's easy enough to get an ActivityExecution from api services by using a 
cross-cast.


Execution execution = executionService.findExecutionById(executionID);if 
(execution instanceof ActivityExecution) { ActivityExecution 
activityExecution = (ActivityExecution)execution;
 //Do something with ActivityExecution
}


--

Reply to this message by going to Community
[http://community.jboss.org/message/551675#551675]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-08 Thread HuiSheng Xu
HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551699#551699

--
Hi Joe,

Yes, you could get ActivityExecution by using class casting.  But it is not the 
normal way to get it.  We could also get ExecutionImpl by class casting.  But 
it doesn't mean that we could use every methods in ExecutionImpl directly,  
without opening envionment.

The different between Execution interface and ActivityExecution interface is 
that you could use any methods on Execution,  even if we didn't open an 
environment for it.  But ActivityExecution didn't has this guarantee.  Why jbpm 
4 didn't export ActivityExecution in api service interface? Because there were 
some methods needing Environment supporting.

At last,  If you want to some features about getting activity information from 
api service interface,  you could post requirement in this forum,  or open an 
issue on JIRA.  Thank you very much.

--

Reply to this message by going to Community
[http://community.jboss.org/message/551699#551699]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-07 Thread Joe Gottman
Joe Gottman [http://community.jboss.org/people/joegottman] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551490#551490

--
 This seems like an awful lot of work to call a member function, which should 
literally be a one-liner.  If it is absolutely necessary to call getActivity() 
this way, this should be documented in getActivity's JavaDocs. 

--

Reply to this message by going to Community
[http://community.jboss.org/message/551490#551490]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-07 Thread HuiSheng Xu
HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551568#551568

--
Hi Joe,

Because the ActivityExecution interface is not intend to be invoked out of 
Environment.  It is a part of ActivityBehaviour/ExternalActivityBehaviour.  
When you need to implement some feature that jBPM 4 didn't provide by default,  
you could use them to implement a customized activity.

Also,  I think there is no api to get ActivityExecution from api services.

--

Reply to this message by going to Community
[http://community.jboss.org/message/551568#551568]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-06 Thread Michael Wohlfart
Michael Wohlfart [http://community.jboss.org/people/mwohlf] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551310#551310

--
Hi Joe,
in the first place I don't think it is a bug, it is rather the way jBPM is 
intended to be used.
You open and close an environment which is defined by jBPMs IoC Container, much 
like you open and close a hibernate session.

Maybe the fact that environmentFactory.openEnvironment() returns 
EnvironmentImpl is not really pretty,
but a lot of methods in ActivityExecution require an environment to work with 
and having them all open and close their own environment would be
even uglier and unnecessary in most cases.

--

Reply to this message by going to Community
[http://community.jboss.org/message/551310#551310]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-06 Thread Joe Gottman
Joe Gottman [http://community.jboss.org/people/joegottman] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551316#551316

--
The major thing I object to is the fact that I have to call elements of the 
private interface to make the public method getActvity() work.  If 
getActivity() requires an active Environment, then that fact should be 
published in the JavaDocs and there should be a well-advertised way in jBPM to 
get an Enviroment (and close it when I'm done with it). 

Right now, the Environment interface isn't even in the jBPM public API.  As a 
user, I don't know what an Environment is, what it is used for,  or how long I 
should keep one around.  Can I maintain one indefinitely, like a Hibernate 
session, or do  I need to close it as soon as I'm done with it, like a database 
transaction?

--

Reply to this message by going to Community
[http://community.jboss.org/message/551316#551316]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-06 Thread Michael Wohlfart
Michael Wohlfart [http://community.jboss.org/people/mwohlf] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551335#551335

--
I totally agree,
maybe the real problem is that the Environment interface doesn't implement the 
close() method
like it seems to be intended from my understanding of the DevGuide:
 http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e2485 
http://docs.jboss.com/jbpm/v4/devguide/html_single/#d0e2485

org.jbpm.api.cmd.Environment is part of the public API in 4.4 or do I miss 
something here?

--

Reply to this message by going to Community
[http://community.jboss.org/message/551335#551335]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-06 Thread Joe Gottman
Joe Gottman [http://community.jboss.org/people/joegottman] replied to the 
discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551339#551339

--
You're right. Environment is in the public interface.  However, 
EnvironmentFactory is not, so there is no public way to get an Environment 
variable from the public API.  Also, as you noted Environment does not have a 
close() method, so there is no way to close an Environment variable using the 
public api either.

--

Reply to this message by going to Community
[http://community.jboss.org/message/551339#551339]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

2010-07-06 Thread HuiSheng Xu
HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion

Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

To view the discussion, visit: http://community.jboss.org/message/551345#551345

--
Hi Joe,

Yes, you are right.  The EnvironmentFactory isn't a part of public api.  So if 
we want to get access environment,  the recommanded way is using Command.  As 
followed:

processEngine.execute(new Command() {
    public Object execute(Environment env) {
    // do something.
    return null;
    }
});


And yes,  the Environment interface didn't declared close() method,  because we 
didn't need it.  The EnvironmentInterceptor will open/close the Environment 
instance automaticly.

At last, if you want to do something transactional,  please use Command to 
replace 'EnvironmentFactory.openEnvironment()',  EnvironmentFactory wouldn't 
manage transaction,  so it could cause some transactional issues.

Cheers.  :) 

--

Reply to this message by going to Community
[http://community.jboss.org/message/551345#551345]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user