[JBoss jBPM] - Token lock issue
by firetruck
I have an issue with locking a Token.
When an action starts to execute inside a Node, I lock the token with the method lock() from the Token object. That's to avoid the use of it, while the action is executing.
Then, in another part of my code, i try to verify if the token is locked. I do this:
Token token= jbpmContext.loadToken(processInstance.getRootToken().getId());
| if(token.isLocked()){
| ...
| }
|
My problem is that when I load the token to check if it is locked, I don't get the same object that I locked in the Node. Instead, the token seems to be reloaded from database, and when it happens, the value of isLocked is lost, because it is a transient attribute.
How should I do to load the exactly same object that I had previously locked in the Node?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4194295#4194295
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4194295
17 years, 7 months
[JBoss Portal] - Re: Custom navigation region
by JohnnyTheHun
Ok, I don't get where the portlet markup get's created.
I see that the WindowContext already get's the markup via its String content parameter, so I need to create the portlet markup BEFORE instanciating a WindowContext
But how do I create the markup for a specific portlet instance?
What is the class that I can instanciate or the utility I can call to create the markup?
I looked at DivPortletRenderer which calls PortletRendererContext.getMarkup() to get the markup.
PortletRendererContext is implemented via PortletRendererContextImpl.
The getMarkup() function of PortletRendererContextImpl gets the markup from the WindowContext.
So now I'm in a circle - I have to create the markup before any XYContext comes into the picture. But I don't know what creates the markup for a Portlet instance.
The best would be to have some Class or Function like:
new PortletMarkupGenerator(String portletInstanceName).getMarkup();
I found some code in the injectTabbedNav of PageCustomizerInterceptor class:
| public String injectTabbedNav(PageCommand rpc)
| {
| ControllerContext controllerCtx = rpc.getControllerContext();
| ControllerRequestDispatcher rd = controllerCtx.getRequestDispatcher(targetContextPath, tabsPath);
|
| //
| if (rd != null)
| {
| Page page = rpc.getPage();
| PortalAuthorizationManager pam = portalAuthorizationManagerFactory.getManager();
| PortalNodeImpl node = new PortalNodeImpl(pam, page);
|
| //
| rd.setAttribute("org.jboss.portal.api.PORTAL_NODE", node);
| rd.setAttribute("org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT", Navigation.getPortalRuntimeContext());
|
| //
| rd.include();
| return rd.getMarkup();
| }
| return null;
| }
|
The following lines are used to access the jsp to create the tabs:
| ControllerContext controllerCtx = rpc.getControllerContext();
| ControllerRequestDispatcher rd = controllerCtx.getRequestDispatcher(targetContextPath, tabsPath);
|
1. This function renders a jsp file, it doesn't render a Portlet.
2. This function uses a PageCommand instance to create the markup. But I don't see that a RegionRenderer gets a PageCommand parameter
So the best would still be to have some Class or Function like:
new PortletMarkupGenerator(String portletInstanceName).getMarkup();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4194284#4194284
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4194284
17 years, 7 months