cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic models - no restart required ...

janv
Employee
Employee
We have recently added a new feature to the Alfresco Repository that allows custom models to be updated dynamically without requiring a server restart. Additionally, the Web Client UI can also be customised without a restart. This means for example that new types, aspects and properties can now be added dynamically. Also, new workflow task models can be deployed at runtime.

Here's a first-cut wiki page with more details:

http://wiki.alfresco.com/wiki/Dynamic_Models

This feature is available on HEAD and via nightly builds:

http://dev.alfresco.com/downloads/nightly/dist/

We would appreciate your feedback on this new feature. Please raise any bugs via JIRA.

Thanks,
Jan
22 REPLIES 22

fbehfar
Champ on-the-rise
Champ on-the-rise
Hi,
I'm new to the Alfresco and I'm trying to work with the Dynamic model!
I've downloaded "AlfrescoCommunity-2.9.0dev-Setup", I've run the example model (wiki example 1) sucessfully, but I have problem with the (wiki example 2). I've followed all the steps and when I push the 'Advanced Workflow' button I get the following error!

javax.faces.FacesException: Exception in JSP: /jsp/wizard/container.jsp:133

130: <tr>
131: <td style="width: 100%;" valign="top">
132: <f:subview id="wizard-body">
133: <jsp:include page="<%=Application.getWizardManager().getPage() %>" />
134: </f:subview>
135: </td>
136: </tr>


Stacktrace:
caused by:
org.apache.jasper.JasperException: Exception in JSP: /jsp/wizard/container.jsp:133

130: <tr>
131: <td style="width: 100%;" valign="top">
132: <f:subview id="wizard-body">
133: <jsp:include page="<%=Application.getWizardManager().getPage() %>" />
134: </f:subview>
135: </td>
136: </tr>


Stacktrace:
caused by:
org.apache.jasper.JasperException: Cannot get value for expression '#{WizardManager.bean.hasStartableWorkflows == false}'
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{WizardManager.bean.hasStartableWorkflows == false}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property hasStartableWorkflows of base of type : org.alfresco.web.bean.workflow.StartWorkflowWizard
caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.workflow.StartWorkflowWizard, property: hasStartableWorkflows
caused by:
java.lang.reflect.InvocationTargetException
caused by:
org.alfresco.service.cmr.repository.XPathException: Error executing xpath:
xpath: /app:company_home/app:dictionary/app:messages/cm:'lifecycle-messages.properties'_en_US.properties
caused by:
org.jaxen.XPathSyntaxException: Unexpected 'lifecycle-messages.properties'
caused by:
class org.jaxen.saxpath.XPathSyntaxException: /app:company_home/app:dictionary/app:messages/cm:'lifecycle-messages.properties'_en_US.properties: 50: Unexpected 'lifecycle-messages.properties'
Would you help me to solve this problem?
(wiki example 2) doesn't have number 3 in its steps, maybe I've missed something there, that causes this error!
Thanks,
FSB

janv
Employee
Employee
Thanks for the feedback. All the steps are listed for example 2. I have now fixed the typo and re-numbered steps 4-7 as steps 3-6.

It looks as if you may have mis-typed step 4 as:
  
    reload messages 'lifecycle-messages.properties'
You should be able to resolve this issue by either:
  
    running the following two commands:

       undeploy messages 'lifecycle-messages.properties'
       reload messages lifecycle-messages
or:
  
    simply re-starting Alfresco
In a future release, we will look to improve the validation when registering ('reloading') message resource bundles.

Thanks,
Jan

fbehfar
Champ on-the-rise
Champ on-the-rise
Thank you for your quick reply Jan,

Actually I had done all the steps, even the 'reload' step, but as I thought this solution doesn't need to restart, so I didn't try that.
BUT I still have problem,
         I can see 'Lifecycle Review & Approve …' in the Advanced workflow list, but when I push the Finish button at the end I get the following error!

Please correct the errors below then click Finish.

    * A system error happened during the operation: Failed to signal transition 'null' from workflow task 'jbpm$17'

each time I try, the 'jbpm$…' number is raised by two. I have done logout / login and also I have restarted the Tomcat but nothing happend. What am I doing wrong?



In the 'Users and their Roles' step at advanced workflow I want to select more than one person to do the task, what can I do? I have changed the
<actor>#{bpm_assignee}</actor>
to
<actor>#{bpm_assignees}</actor>
in the 'Lifecycle_processdefintion.xml' file, but nothing happend. Should I change something else in another file?
or it's better tto say, where is the UI configuration of 'LifecycleModel', there is nothing about lifecycle model in the 'web-client-config-custom.xml' file, so how does it understand, which properties to show and in what order, there is no
<config evaluator="node-type" condition="wf:submitAdhocTask" replace="true">
   <property-sheet>
      <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
      <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
      <show-property name="bpm:workflowPriority" />
      <show-property name="bpm:workflowDueDate" />
      <show-property name="wf:notifyMe" />
      <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
      <show-association name="bpm:assignee" />
   </property-sheet>
</config>
such a thing for ifecycle workflow in any files!!!
how can I customise it?


Another question, I'm working with an old version of alfresco on LINUX too, which doesn't have any Model, Workflow Definitions and etc. . Is it possible to  upgrade that version without loosing my data? or I should take a backup and then restore them?

Thank you again,
FSB

janv
Employee
Employee
I'm glad that fixed your (initial) problem.

I don't seem to be able to repeat your next issue in my environment. Can you please provide an extract from your server log when the issue occurs and also environment details (version/build of Alfresco and app/db/os platform details).

Please also post your Workflow question in the Workflow forum.

Yes, in theory you should be able to upgrade - but make sure you have a backup, and then refer to wiki for upgrade notes - however, we do not specifically test upgrades to/from preview/dev releases.

Thanks,
Jan

fbehfar
Champ on-the-rise
Champ on-the-rise
Thanks Jan,

I found my probelem that caused the error!
It was for changing <actor>#{bpm_assignee}</actor> to <actor>#{bpm_assignees}</actor>

Now It's working correctly!!!

Thank you again,
FSB

kbonnet
Champ in-the-making
Champ in-the-making
Jan, if you're still reading this, is there a way to disable the loading of the dynamic content models from the repository? I have run into a problem with restarting of Alfresco wit the error message "InvalidTypeException". I started another topic in tihs in the repository services thread. This must be caused by one of my own models in the repository, becasue when i start the same Alfresco installation with a clean database en empty contentstore on the filesystem it starts OK.

So the question for this topic is, if there is any way to disable the loading of dynamic content models. Otherwise i would never be able to solve this problem.

Kind regards,

Koen Bonnet

janv
Employee
Employee
In general, referenced models should not be removed or disabled since this can lead to integrity issues. This applies to static models (loaded from the classpath) or dynamic models (loaded from the repository). In the future, we may wish to allow the repository to be more tolerant to missing/invalid types etc. In the meantime, the issue that you raised (AR-2179) has now been fixed on HEAD and a workaround is also available.

Thanks,
Jan

heiko_robert
Star Collaborator
Star Collaborator
When we use Dynamic Models as described in http://wiki.alfresco.com/wiki/Dynamic_Models#Updating_and_re-loading_message_resources no translation files are used.
e.g. we put
in Data Dictionary/Models: ProductModel.xml
in Data Dictionary/Messages: ProductModel.properties, ProductModel_de_DE.properties, ProductModel_en_US.properties

in the WebUI only the values from ProductModel.properties (english version) are used. I executed "reload messages ProductModel" in the Repository Admin Konsole but no success.

The only way to get the translation is to use the classic way to put the files in the classpath and to register using property name="labels".

Any hints?
Thanks
Heiko

heiko_robert
Star Collaborator
Star Collaborator

protanveer
Champ in-the-making
Champ in-the-making
Is there a way to execute 'reload' command remotely i.e. via web service api?