Re: [jboss-user] [jBPM] - I18n : create mail with ressource bundles ?
by Mark Roy
Mark Roy [http://community.jboss.org/people/markroy] replied to the discussion
"I18n : create mail with ressource bundles ?"
To view the discussion, visit: http://community.jboss.org/message/542355#542355
--------------------------------------------------------------
I've given this some thought myself, but haven't implemented anything yet. There's nothing available "out of the box", but I believe it can be done on your own. I guess the solution depends on what your requirement is.
If you only need to internationalize per jBPM installation, use the mail template feature. Move all mail message text out of the jPDL and into a separate mail template file (which essentially would be a resource file), then import the resource ( <import resource=+"mailtext.jbpm.cfg.xml" /> )+ in jbpm.cfg.xml. Deploy the appropriate mail template file during app installation.
If you need to internationalize per process instance, you could create a process variable(s) to hold the appropriate text for that instance. Then, use process variable references in your mail templates rather than hard-coded text. The variables have to be serializable, so something based on ResourceBundle won't work unless you do something extra.
The jBPM JuelScriptEngine seems like it wll resolve resource variables: chain.add( *new* *ResourceBundleELResolver());,* but I don't know what those references would look like or how to load the bundle. Perhaps someone else can shed some light?
Finally, if you need to internationalize mail text based on the locale of the recipient(s), it looks like you'd have to create your own MailProducer, which is a supported extension point. You'd probably have to create your own IdentitySession implementation, since locale is not included in the default implementation.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/542355#542355]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
Re: [jboss-user] [JBoss Microcontainer Development POJO Server] - Implementing a non-flat deployment for Weld Integration
by Flavia Rainone
Flavia Rainone [http://community.jboss.org/people/flavia.rainone%40jboss.com] replied to the discussion
"Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/542347#542347
--------------------------------------------------------------
Pete and I had a face-to-face meeting where we discussed all my questions and what would be the best way to implement this.
Regarding the assumptions I wanted to validate, both are correct.
But, regarding visibility of deployments. He told me that the best approach is to mirror the ClassLoader structure. The point is that one BDA A can see another BDA B if the module it represents, say A', can see classes from the module B', that corresponds to BDA B.
So, instead of reinventing the wheel, we should use the already existent ClassLoader structure to implement this correspondence in the BDA structure. These are the steps that Pete suggested:
1) Find Modules which are BDA's
2) List <Module>, List<ClassLoader>, Map<ClassLoader, Module>
3) Iterate over classes and build graph of modules
4) Module -> BDA
a) Explore CL graph & for each CL & Module
b) Convert
A few examples of complex things that we would have to implement if we don't use the ClassLoader structure:
- we would have to able to see if a deployment is scoped or not, so we can define the visibility it has from other modules and to which modules it is visible
- we need to keep track of modules being deployed and undeployed, so to know when it becomes visible and when it becomes invisible
- we need to support Class-path attributes in manifest files
- we need to define when a previously defined archive is available to a archive being deployed now
So, these features that we need to support provide the arguments as to why we should mirror the ClassLoader structure instead of implementing this from scratch.
Pete also pointed out an important behaviour that should be fixed. In a nutshell, all archives visible to a BDA are scanned. In the given scenario:
ejb.jar A reaches lib2. In lib2 we have a ClassPath reference in the manifest to lib3, which is not in the classpath of the server... it is somewhere in the filesystem. In this case, for what I understood from Pete's explanations, lib3 is going to be scanned for CDI stuff. But this shouldn't happen, so we would also need a way of differentiating lib3 from lib2. I'll stop my explanation here, as I think Pete can fill in the blanks and explain this much better :-)
Anyway, this would be a future step, as the priority is to first mirror the CL structure effectively.
So, Ales, how do you think this should be done? I think we have plenty of code in the ClassPools that do exactly that, mirror the ClassLoader structure in a way that allows us to find the classes and xml files in META-INF dirs. Maybe there is a way of reusing part of the ClassPool code to do this?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/542347#542347]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
[jBPM] - jBPM and Seam-Debug-Page
by Heri Bender
Heri Bender [http://community.jboss.org/people/hbender] created the discussion
"jBPM and Seam-Debug-Page"
To view the discussion, visit: http://community.jboss.org/message/542334#542334
--------------------------------------------------------------
Hi
I'm quite new to jBPM (and seam) and have following problem: After I have accessed some JBPM stuff programmatically within a seam component (backing bean of a xhtml page, long running conversation started) I cannot call the seam debug page anymore. The error is:
"JbpmContext may only be used inside a transaction"
I do not actively put this JbpmContext into the conversation context.
The code I execute (in a @Observer(value="org.jboss.seam.beginConversation" method) :
JbpmContext jbpmContext = ManagedJbpmContext.instance();
GraphSession graphSession = jbpmContext.getGraphSession();
ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("pdPUKRetrieval");
graphSession.findProcessInstances( 0 );
ProcessInstance processInstance = new ProcessInstance(processDefinition);
org.jbpm.graph.exe.Token t = processInstance.getRootToken();
myLog.debug( "token.node before signal: " + t.getNode().getName() );
t.signal();
myLog.debug( "token.node after signal: " + t.getNode().getName() );
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/542334#542334]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
[JNDI and Naming] - JBoss 4 to JBoss 5 (JNDI question)
by New Close
New Close [http://community.jboss.org/people/new_open_close] created the discussion
"JBoss 4 to JBoss 5 (JNDI question)"
To view the discussion, visit: http://community.jboss.org/message/542318#542318
--------------------------------------------------------------
I've searched, but haven't seen anyone bring up this issue... so I'm assuming we have a configuration problem. We're trying to test our code with JBoss 5 (jboss-5.1.0.GA), and have run into trouble when looking up the datasource (DefaultDS and XAOracleDS) in JNDI. It appears in the JMX console:
h1. java: Namespace
+- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
+- comp (class: javax.namingMain.Context)
+- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
+- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
+- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- app (class: org.jnp.interfaces.NamingContext)
| +- Manager (class: javax.inject.manager.Manager)
+- Mail (class: javax.mail.Session)
+- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- *DefaultDS* (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- jaas (class: javax.naming.Context)
| +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)
+- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
+- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
+- *XAOracleDS* (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
+- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
+- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
+- ManagementView (class: org.jboss.aop.generatedproxies.AOPProxy$3)
but in the code all we see is:
Using bound name < java: > found class < javax.namingMain.Context > with object name < comp >
Using bound name < java: > found class < org.jnp.interfaces.NamingContext > with object name < app >
Using bound name < java: > found class < javax.inject.manager.Manager > with object name < Manager >
Using bound name < java: > found class < org.jboss.security.SubjectSecurityProxyFactory > with object name < SecurityProxyFactory >
Using bound name < java: > found class < javax.naming.Context > with object name < timedCacheFactory >
which appears to be a subset of the available objects. The above log statements were output by:
Context context = new InitialContext();
listContext(context, "java:");
private void listContext(Context ctx, String bName)
{
try
{
NamingEnumeration<Binding> list = ctx.listBindings(bName);
while (list.hasMore())
{
Binding item = (Binding) list.next();
String className = item.getClassName();
String objectName = item.getName();
log.info("Using bound name < " + bName + " > found class < "
+ className + " > with object name < " + objectName + " >");
Object o = item.getObject();
if (o instanceof javax.naming.Context)
{
listContext((Context) o, bName);
}
}
}
catch (NamingException ex)
{
log.warn("JNDI failure: ", ex);
}
}
There were no errors and/or warnings at this point in our code. Any help would be appreciated. Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/542318#542318]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months