Display UI custom message in a workflow

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011 07:29 AM
Hi,
I would like to know if it is possible to display a custom message like "Workflow starting" ? or custom error message ?
Many thanks for your help
Regards
uskiki85
PS: My Workflow is used in Alfresco Share only
I would like to know if it is possible to display a custom message like "Workflow starting" ? or custom error message ?
Many thanks for your help
Regards
uskiki85
PS: My Workflow is used in Alfresco Share only
Labels:
- Labels:
-
Archive
17 REPLIES 17

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 05:56 AM
Any news ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2012 09:08 AM
Any JIRA has been created ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2012 04:22 AM
This topic has no success …
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2014 09:11 AM
So bad there is no given answer

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2014 09:12 AM
I know it's late but maybe htis can help you: https://forums.alfresco.com/forum/developer-discussions/workflow/customizechange-message-box-issued-...
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2014 01:00 AM
We also had similar problem, later we extended the AlfrescoRuntimeException to our own custom class.
In this way,we're not displaying "org.Activiti.Exception…" and we're displaying own error message like 'com.quanticate….'.
<java>
public class CustomWorkflowException extends AlfrescoRuntimeException
{
protected static final String UNKNOWN_MESSAGE = "CustomWorkflow.exception.unknown";
protected static final String START_MESSAGE = "CustomWorkflow.exception.start";
private static final long serialVersionUID = 2163551047437476248L;
private String msgId;
private String message;
/**
* Constructor
*
* @param msgId the message id
*/
public CustomWorkflowException(String msgId)
{
super(msgId);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* Constructor
*
* @param msgId the message id
* @param cause the exception cause
*/
public CustomWorkflowException(String msgId, Throwable cause)
{
super(msgId, cause);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* @return the msgId
*/
public String getMsgId()
{
return msgId;
}
@Override
public String getMessage()
{
return getLocalizedMessage();
}
@Override
public String getLocalizedMessage()
{
return message;
}
@Override
public String toString()
{
return I18NUtil.getMessage(START_MESSAGE) + " " + message;
}
/**
* Resolves the message id to the localised string.
* <p>
* If a localised message can not be found then the message Id is
* returned.
*
* @param messageId the message Id
* @param params message parameters
* @return the localised message (or the message id if none found)
*/
private static String resolveMessage(String messageId, Object[] params)
{
String message = I18NUtil.getMessage(messageId, params);
if (message == null)
{
// If a localised string cannot be found then return the messageId
message = messageId;
}
if (message == null || message.isEmpty())
{
// If there's no know message, pick the default unknown one
message = I18NUtil.getMessage(UNKNOWN_MESSAGE);
}
return message;
}
}
</java>
Hope this helps someone.
In this way,we're not displaying "org.Activiti.Exception…" and we're displaying own error message like 'com.quanticate….'.
<java>
public class CustomWorkflowException extends AlfrescoRuntimeException
{
protected static final String UNKNOWN_MESSAGE = "CustomWorkflow.exception.unknown";
protected static final String START_MESSAGE = "CustomWorkflow.exception.start";
private static final long serialVersionUID = 2163551047437476248L;
private String msgId;
private String message;
/**
* Constructor
*
* @param msgId the message id
*/
public CustomWorkflowException(String msgId)
{
super(msgId);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* Constructor
*
* @param msgId the message id
* @param cause the exception cause
*/
public CustomWorkflowException(String msgId, Throwable cause)
{
super(msgId, cause);
this.message = resolveMessage(msgId, null);
this.msgId = msgId;
}
/**
* @return the msgId
*/
public String getMsgId()
{
return msgId;
}
@Override
public String getMessage()
{
return getLocalizedMessage();
}
@Override
public String getLocalizedMessage()
{
return message;
}
@Override
public String toString()
{
return I18NUtil.getMessage(START_MESSAGE) + " " + message;
}
/**
* Resolves the message id to the localised string.
* <p>
* If a localised message can not be found then the message Id is
* returned.
*
* @param messageId the message Id
* @param params message parameters
* @return the localised message (or the message id if none found)
*/
private static String resolveMessage(String messageId, Object[] params)
{
String message = I18NUtil.getMessage(messageId, params);
if (message == null)
{
// If a localised string cannot be found then return the messageId
message = messageId;
}
if (message == null || message.isEmpty())
{
// If there's no know message, pick the default unknown one
message = I18NUtil.getMessage(UNKNOWN_MESSAGE);
}
return message;
}
}
</java>
Hope this helps someone.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2015 09:25 AM
I need to include this java class inside Alfresco. How do it???. Thank
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2015 05:46 AM
Hi,
You would need to register your class with the surf spring bean for it to be recognized.
Here is an example, you can always do a read up to understand more:
Give your file a name which ends with "-context.xml" and place it in the shared-extension folder.
Hope that helps.
You would need to register your class with the surf spring bean for it to be recognized.
Here is an example, you can always do a read up to understand more:
<beans> <bean id="your-bean-id" parent="baseJavaScriptExtension" class="your.package.classname"> <property name="extensionName"> <value>method-name</value> //The method you want to expose to your alfresco. </property> </bean></beans>
Give your file a name which ends with "-context.xml" and place it in the shared-extension folder.
Hope that helps.
