留言板

How to set workflow for page scope

thumbnail
Sam Collett,修改在12 年前。

How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
Asked this on stackoverflow (Liferay, how to set workflow for page scope), but no answer, so trying here.

How can you set a scope for a workflow in Liferay Portal 6 CE? I can see you can set it up at a portal level and at the 'Default' scope, but I wish to be more specific than that.

e.g.

Documents -> Policy = Policy Workflow (for Document Library Document)
Documents -> Guidelines = Guideline Workflow (for Document Library Document)

If I go to 'Workflow Configuration' then change the scope to anything other than 'Default', I get the following message, even though I am an administrator (using 'Bruno Admin').

You do not have the required permissions to access this application
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
I tested this but had no problems and can not reproduce.
Even on a SevenCogs demo installation you use i presume.

I suggest you start with a clean database (ie remove sevencogs and default site war from webapps folder
thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
No still not working. I selected the Liferay Community, then changed Scope from Default to Documents. Same problem with SevenCogs demo (adding new Documents page). On Windows 7 and Windows 2008 R2 (not that that should make a difference, since the database is the same as if you were running it on Linux and it is Java). I've run it in Eclipse as well, and nothing showed up in the console window.

Workflow Configuration is not listed in the Control Panel unless I am in the Default Scope. It doesn't make any difference if SevenCogs is on or not (I deleted the hsql files and all the sevencogs folders). Same with any new Communities or Organisations that I create.

I used the Liferay 6.0 GA4 Community Edition with Tomcat and didn't create anything new, just a new page with a document library and it scope set to the current page.
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
On a clean database you only have one Default Scope;
Just checking;
Did you create a new Community by yourself!
thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
No, I didn't create a new Community (just left the existing Liferay one). The Documents scope appeared in the control panel after I create a page, and added a document library scoped to the page.

Thanks,
Sam
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
emoticon i did not such a thing... ah well it works good luck. maybe you could share your workflow?
thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
The scope is listed in the control panel, but I can't do anything with workflows unless it is top level (so not working...). Can you create a scope manually, so it can have workflows attached to it?
The only other way I can think of doing it is to have one big workflow with conditionals to execute tasks depending on scope (or maybe category / tag), but I'm not sure where to start with that (using Kaleo)
e.g.
if scope/category/tag = policies
	execute task policies
if scope/category/tag = guideline
	execute task guidelines
else
	approve document

To complicate things, I wish to mark documents as 'expired' after 12 months and trigger a review 3 months before they expire (or 36 months expired etc), where they are then republished, amended or archived
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
I tested this on a clean installed bundle;

  • Removed all the apps in the /webapps/ folder except ROOT
  • created new MySQL database
  • startup
  • login with admin test@liferay.com/test
  • create new MyCommunity
  • add new workflow xml on Control Panel > Portal > Workflow
  • select new Scope "MyCommunity"
  • select new Workflow in Control Panel > Content "MyCommunity" > Workflow Configuration
  • select original Scope "Liferay.com"
  • select orignal Workflow in Control Panel > Content "liferay.com" > Workflow Configuration
thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
In addition to that, I did

  • Goto 'My Community' home page, e.g.: web/test/home
  • Add -> Page (Documents)
  • Goto 'Documents' page
  • Add -> More -> Document Library
  • Document Library portlet -> 'Wrench' -> Configuration
  • Select Scope
  • Scope = Current Page (Documents)
  • Save
  • Goto Control Panel
  • Change 'Scope' (in yellow box under 'My Community') to 'Documents'
  • No 'Workflow Configuration' option
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
Ah only now do i completly comprehend your issue and indeed this seems strange but is no bug;

Kaleo Workflow seems to be depending on the groupId and not

		<!-- PK fields -->

		<column name="kaleoActionId" type="long" primary="true" />

		<!-- Group instance -->

		<column name="[b]groupId[/b]" type="long" />

		<!-- Audit fields -->

		<column name="companyId" type="long" />
		<column name="userId" type="long" />
		<column name="userName" type="String" />
		<column name="createDate" type="Date" />
		<column name="modifiedDate" type="Date" />


thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
So I guess this is by design then (would be good if there was finer granularity though)?

How would you actually script the workflow, so you can change the state (or even some of the meta data - e.g. set an ID type field depending on the 'Category' (a custom dropdown field), or rename the file)? Also automatically approve a document in some circumstances.

Coming from SharePoint, I would like to do some of the things its workflows can do, but am not sure how to do some aspects of them in Liferay (since no GUI, have to do xml) - for instance sending and email to the reviewers prompting for more data or move/copy the document to another document library (e.g. to a site visible to the public/anonymous users)

I could always have a look at JBPM, since it looks more poweful than Kaleo and looks like it has designer tools, although the setup looks like it isn't as simple as just downloading a plugin (looking at How to Set Up JBPM With Liferay).
thumbnail
Corné Aussems,修改在12 年前。

RE: How to set workflow for page scope

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
Kaleo is intended for simple workflow else you should use JBPM or other;

In the next Liferay Studio (not IDE) you will find a graphical editor for Kaleo
thumbnail
Sam Collett,修改在12 年前。

RE: How to set workflow for page scope

Junior Member 帖子: 64 加入日期: 08-11-13 最近的帖子
I can see jpbm-web available in the Liferay SVN repository (no war file though), but can't see it when I search for it within Liferay itself using the built-in plugin installer. Does this work with the current Liferay CE 6.0.6? Maybe it will be available in Liferay CE 6.1 (whenever that comes out).

Is it still JBPM3 (JPBM5 is out now)? I see that SVN Kaleo has conditionals (category-specific-definition.xml), which I'm guessing could be scripted to approve straight away depending on the category, or assigning to a different role for reviewing. I'm not sure if that will work in 6.0.6 though.