cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid workflow store Reference

rockycres
Champ in-the-making
Champ in-the-making
Hi All,

I am encountering an issue of invalid nodereference when files are submitted for the web project via the workflow.

1.Created the web project.
2.Created the web form & associated it with the web project.
3.Created the content with the web form & submitted via the workflow .

In the node browser,temporary store reference is created ( avm://www–workflow-2a7f6089-cef7-4842-ade9-26211ea92b86 ) , when I loop through the child nodes ,I can see the file( test.xml ) I submitted.

avm://www–workflow-2a7f6089-cef7-4842-ade9-26211ea92b86/-1;www;avm_webapps;ROOT;test.xml

When workflow is fully completed . temporary store reference is removed and the file gets added to avm store.

Now in the node browser again, under avm://www store reference , when I loop through the child nodes ,I can see the file( test.xml ) I submitted.

     avm://www/-1;www;avm_webapps;ROOT;Test.xml

Here is the issue,

Now when I submit a new file (test2.xml) following the same process and when I see the node browser before the

temporary store reference is created for the current WF ( avm://www–workflow-567e49cb-767c-4341-95aa-2ddf4288bcaa ) , when I loop through the child nodes ,I can see the files( test.xml , test2.xml)..

avm://www–workflow-567e49cb-767c-4341-95aa-2ddf4288bcaa/-1;www;avm_webapps;ROOT;test.xml
avm://www–workflow-567e49cb-767c-4341-95aa-2ddf4288bcaa/-1;www;avm_webapps;ROOT;test2.xml

Why the file which was submitted earlier (test.xml) is associated with the current Workflow.This intermediate temporary WF storerefence should not be having the file which are already submitted and gone to avm store..

This happen everytime,all the files which are avm(files assoiated with the completed WF ) are added to the  intermediate temporary WF storerefence.

Is this a bug..?

Any help is appreciated…
5 REPLIES 5

tommorris
Champ in-the-making
Champ in-the-making
Hi there,

I may be wrong, but I think the temporary workflow store is layered on top of the staging sandbox, thus you'll always see all files.

I think your code might need to use the alfresco API to 'diff' between the two stores (the staging store and the workflow store).
This would tell you what is unique in your workflow (including deletions).

This may prove helpful:
http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/avmsync/AVMSyncServic...

Tom
http://www.ixxus.com

rockycres
Champ in-the-making
Champ in-the-making
Hi,

Thanks for ur timely response…I have tried with the API reference u gave …But AVMSyncService API is getting the diff file list.Here is the code..

List<AVMDifference> diffs = syncService.compare(-1,"www:/www/avm_webapps/ROOT" ,-1, "www:/www–workflow-79dc8cd3-1e6a-497a-a0bf-4aea1717bc00/avm_webapps/ROOT", null);

My requirement is to get the file list which I submitted in the current WF..

So can u exactly tell me about the alfresco API to 'diff' between the two stores (the staging store(avm) and the workflow (temp) store).?

jack_jin
Champ in-the-making
Champ in-the-making
Hello,

I believe tommorris is correct.  The workflow store is merely a layer of the current staging store, with the new file in it.  In your scenario, when you submitted test2.xml to staging, you already have test.xml on staging.  So, what the workflow code tries to do, is it creates a new sandbox based off of staging, meaning it has test.xml in it.  Then, it adds ur new file, test2.xml to it the workflow store, that's why you see both files.

To get the files you've submitted to the workflow, it's exposed to the javascript API by following:
task.getPackageResources()

We use the following to find out which files are associated with an AVM workflow.  But I'm sure there's a Java service call for it as well.

Hopefully it helps,

Jack

rockycres
Champ in-the-making
Champ in-the-making
Hi ,,

Thanks to both jack & tommoris..Now I understood the logic behind sorkflow store & staging store,,,But still I am not able to get this done..
I have tried with java reference to get contents for the current workflow task but its returning NULL..

   WorkflowTask wfTask = workflowService.getTaskById(taskId);
        List<NodeRef> contents =workflowService.getPackageContents(wfTask.id);

so the contents is always null..And i have no idea in getting this done java api refernce Jack gave..Jack ,can u post the code  here to help me in getting this to work…Thanks..

rockycres
Champ in-the-making
Champ in-the-making
Sorry guys,

There was some problem before..Now I am able to get the file name using the same code..But I just hardcoded the taskid to get it..
   WorkflowTask str = workflowService.getTaskById("jbpm$150");
        List<NodeRef> contents =workflowService.getPackageContents(str.id);

Can u guys tell me how to get the task id from the  workflow service api's or from execution context…?

I tried to get it like this ,,but only getting the task name [wcmwf:submitReviewTask],,,But I need the corresponding unique task id for this task..
  String taskId =    workflowService.getTaskDefinitions(Id).get(i).id;