cancel
Showing results for 
Search instead for 
Did you mean: 

Path to Workflow Task.

joaotpd
Champ on-the-rise
Champ on-the-rise
Hi all! …
I'm sending an email to each assignee of my new workflow if they have a new task.
In that email it would be nice to have a path (url) to the correspondent workflow task?!
Is this possible??!
Thanks!

João Duarte
9 REPLIES 9

joaotpd
Champ on-the-rise
Champ on-the-rise
I still don't have it!!! Anyone?! …
Please help!!
Thanks!

João Duarte

calle
Champ in-the-making
Champ in-the-making
I would also like to know if it is possible to get an url to the task page!
//Carl

calle
Champ in-the-making
Champ in-the-making
Maybe I found a solution…  reading more in http://wiki.alfresco.com/wiki/URL_Addressability#ExternalAccessServlet I found the dialog outcome argument and I think this could be used together with the NodeRef to the task (?) to create an URL directly to the manage task page.

calle
Champ in-the-making
Champ in-the-making
http://wiki.alfresco.com/wiki/URL_Addressability#ExternalAccessServlet was close but the way to address a workflow task is:

http://xyz.com/alfresco/command/ui/managetask?id=jbpm$123&type={workflowURI}wfTask&container=plain

You can read about it on the same page: http://wiki.alfresco.com/wiki/URL_Addressability#CommandServlet, though you do not have a concrete example of the managetask command in there. It is found in the source…

//Carl

cheffilet
Champ in-the-making
Champ in-the-making
This should work for you. Happy coding  Smiley Happy

   final String createTaskDetailsUrl(ExecutionContext executionContext,
         TaskInstance taskInstance) {

      StringBuilder urlBuffer = new StringBuilder("base url of your host");

      // command path
      urlBuffer.append("/command/ui/");
      urlBuffer.append(CustomUIActionCommandProcessor.REG_KEY_OPENTASK)
            .append(CustomUIActionCommandProcessor.URL_QUERY_STRING);
      // task id
      String taskId = BPMEngineRegistry.createGlobalId("jbpm", String
            .valueOf(taskInstance.getId()));
      urlBuffer.append(OpenWorkflowTaskCommand.PROP_TASKID).append(
            CustomUIActionCommandProcessor.URL_KEY_VALUE_SEPARATOR).append(
            taskId);
      urlBuffer.append(CustomUIActionCommandProcessor.URL_PARAM_SEPARATOR);


      String taskType = QName.resolveToQNameString(this.namespaceService,
            taskInstance.getName());
      taskType = URLEncoder.encode(taskType);
      urlBuffer.append(OpenWorkflowTaskCommand.PROP_TASKTYPE).append(
            CustomUIActionCommandProcessor.URL_KEY_VALUE_SEPARATOR).append(
            taskType);
      urlBuffer.append(CustomUIActionCommandProcessor.URL_PARAM_SEPARATOR);
      // transition
      urlBuffer.append(OpenWorkflowTaskCommand.PROP_OUTCOME).append(
            CustomUIActionCommandProcessor.URL_KEY_VALUE_SEPARATOR).append(
            "dialog:manageTask");

      return urlBuffer.toString();
   }

nitinkcv
Champ in-the-making
Champ in-the-making
Hi Cheffet,

The "base url of your host" may be localhost:8080 or it could be someserver.com which may change also.
Is it possible to get this context information also rather than hardcoding the value

Thanks.

nitinkcv
Champ in-the-making
Champ in-the-making
Cheffet,

Could you please let me know which class is the createTaskDetailsUrl method part of? Do we need to override this class and implement this method?

Thanks.

cheffilet
Champ in-the-making
Champ in-the-making
Well, you should add your host-details into a properties file which will be injected into your jBPM-Action.

nitinkcv
Champ in-the-making
Champ in-the-making
Thanks Cheffilet. Thats one to go, but i was thinking whether that information would be available in some variable. I checked the execution context but it wasn't present there.

Thanks.