cancel
Showing results for 
Search instead for 
Did you mean: 

Running the workflow example

kerkira67
Champ in-the-making
Champ in-the-making
I tried to deploy the jBPM example which is described in the "Workflow Administration" section of the Wiki.
After completing all the steps, I tried to run the example.
First I tried to start the workflow from the workflow console.
The "show definitions" command gave the following result:

id: jbpm$1 , name: wf:review , title: Review & Approve , version: 1
id: jbpm$5 , name: wf:adhoc , title: Adhoc Task , version: 4

The command "start jbpm$5" gave the following output:

var {}jbpm$5 not found.

The command "start jbpm$1" succeded the first time and I was able to go through the workflow using console command lines.

Afterwards I tried to apply a workflow to a space in the document management UI. I defined a content rule in my home space that starts a workflow when a content is added. I successfully completed all the steps of the content rule wizard. It did not ask me which workflow to apply, but I do not know whether this is normal or not.

Now, when I try to add a content in my home space, the following happens:

- I select the local file and click the Upload button
- I am forwarded to a page which says "'Hello.doc' was uploaded successfully." and shows the following info: "Uploaded Content", "General Properties", "Other Properties". The info is correct.
- I click the "Ok" button and get the following error message:
"Please correct the errors below then click OK.
A system error happened during the operation: Transaction didn't commit: null"


Here is part of the stack trace I get on the server console:

10:09:07,843 ERROR [ActionServiceImpl] An error was encountered whilst executing
the action 'composite-action'.
java.lang.NullPointerException
        at org.alfresco.repo.workflow.BPMEngineRegistry.getGlobalIdParts(BPMEngi
neRegistry.java:163)
        at org.alfresco.repo.workflow.BPMEngineRegistry.getEngineId(BPMEngineReg
istry.java:179)
        at org.alfresco.repo.workflow.WorkflowServiceImpl.getDefinitionByName(Wo
rkflowServiceImpl.java:154)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



I had a look at the source code (class BPMEngineRegistry, line 163, method getGlobalIdParts). Here is how the code reads:


161: public static String[] getGlobalIdParts(String globalId)
162:    {
163:      String[] parts = globalId.split(ID_SEPERATOR_REGEX);
164:          if (parts.length != 2)
165:          {
166:              throw new WorkflowException("Invalid Global Id '" + globalId + "'");
167:          }
168:          return parts;
169:    }

It seems that there is a problem when the method tries to split the globalId. Perhaps, due to the fact that the content rule wizard does not ask for any workflow ID, when the rule is triggered a null is passed as globalID.

On the other hand, if I remove the content rule, upload a file and then explicitely start an advanced workflow using the context menu, everything seem to work.

Does anybody has any clue?

Thanks

Roberto
2 REPLIES 2

davidc
Star Contributor
Star Contributor
The command "start jbpm$5" gave the following output:

var {}jbpm$5 not found.

The arguments to the start command are the list of workflow parameter values you wish to pass to the workflow.

The following cmd allows you to choose which workflow is started…

use definition jbpm$5

So, to start the adhoc workflow you can issue:


ok> use definition jbpm$5
ok> var bpm:assignee person admin
ok> var bpm:package package 3
ok> start bpm:assignee bpm:package

You can get help on all the commands by issuing:


ok> help

Afterwards I tried to apply a workflow to a space in the document management UI. I defined a content rule in my home space that starts a workflow when a content is added. I successfully completed all the steps of the content rule wizard. It did not ask me which workflow to apply, but I do not know whether this is normal or not.

There was a bug in the 1.4 preview which exposed the 'Start Workflow' action in the Web UI.  It shouldn't be listed and is fixed in the latest drops.

To start a workflow via rules, refer to:

http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_7:_Integration_with_Rules_.28Optional.29

kerkira67
Champ in-the-making
Champ in-the-making
Thank you very much.

Roberto