Archive for the 'Workflow' Category

Extending the Alfresco Workflow Javascript API

Wednesday, May 27th, 2009
buy generic clomid no rx cialis cheapest clomid order levitra online where to buy accutane find discount cialis online viagra tablets cheapest accutane prices buy acomplia cheap low cost viagra lasix online stores discount cialis no rx viagra india acomplia sale viagra approved viagra pharmacy cialis pills soma without prescription buy viagra in canada find no rx viagra buy zithromax find viagra clomid online stores discount acomplia cheap clomid tablets buy generic levitra purchase levitra online cialis buy cialis india cheapest cialis prices zithromax without prescription acomplia online stores buy cheapest viagra on line propecia online cheap purchase soma online synthroid without prescription cost viagra levitra pills viagra overnight shipping cheap viagra internet buy viagra us buy generic accutane synthroid sale cheap lasix online purchase cialis without prescription buy synthroid cheap viagra cheap drug cialis for order buy cheap zithromax viagra cheap price order accutane online buy viagra low price zithromax prices order propecia online discount clomid order cialis on internet online soma order cialis no prescription cheap propecia online acomplia pills buy accutane without prescription cialis australia price of soma cialis sales buy soma without prescription no prescription cialis lasix generic cheap cialis on internet cheap clomid online synthroid online cheap purchase clomid online where to buy synthroid cheap levitra online discount cialis overnight delivery viagra australia buying viagra online zithromax for sale viagra cost viagra pills buy cialis lowest price price of clomid cialis side effects lasix for sale cheapest generic cialis find viagra on internet levitra online stores cialis overnight shipping viagra online review free cialis cialis approved buy cheapest viagra cheap viagra online where to buy levitra order cialis from canada cialis pharmacy order soma levitra cheap viagra without rx clomid cheap cheap generic synthroid where to buy propecia buy generic synthroid order lasix online where to order viagra buy accutane cheap cheap accutane tablets cheapest synthroid prices cheap viagra in uk synthroid online stores accutane prescription where to order cialis order viagra on internet sale viagra buy cheap clomid buy cialis low price find cialis no prescription required viagra internet buy discount viagra best price for viagra cheap propecia clomid without a prescription buy viagra without prescription discount lasix levitra for sale buy clomid certified cialis where to buy acomplia buy cheap accutane online buy cheapest viagra online buy cheapest cialis on line lowest price propecia viagra in uk buy no rx viagra cheapest clomid prices order cialis in us cheap acomplia tablets buy lasix without prescription discount viagra overnight delivery cheap cialis internet cialis overnight no prescription viagra buy synthroid viagra price find cheap cialis online order clomid online best price for cialis viagra purchase purchase cialis online online lasix cheapest acomplia prices zithromax without a prescription best price viagra cialis order accutane cheap buy cialis in us buy viagra on internet purchase clomid clomid cialis pharmacy online cialis purchase cheap lasix tablets cialis generic cheapest viagra price zithromax no prescription zithromax cheap cialis cheap drug buy cialis in canada cheap zithromax tablets buy clomid without prescription lowest price lasix acomplia discount cialis online viagra tablet synthroid generic propecia no prescription buy generic zithromax order viagra in us purchase viagra no rx approved viagra pharmacy purchase viagra online soma generic accutane cialis no rx required online synthroid purchase viagra overnight delivery discount cialis buy no rx cialis viagra generic buy cialis us clomid prescription acomplia prices purchase lasix online buy cheap synthroid viagra online pharmacy buy cheap clomid online lasix cheap cheap generic clomid viagra buy drug clomid pharmacy propecia without prescription synthroid online accutane sale levitra no prescription online accutane price of cialis synthroid without a prescription buy generic viagra viagra in australia cheapest zithromax prices buy lasix discount zithromax cheapest levitra cost of cialis cheap viagra in usa propecia online stores buy zithromax cheap sale cialis find cheap viagra viagra us cheap clomid cialis online stores soma no prescription buy cialis online where to buy viagra generic viagra buy cialis internet buy levitra cheap order cialis no prescription required cheap levitra tablets buy cialis overnight delivery buy viagra generic lasix online cheap cialis no prescription acomplia cheap order viagra no prescription required cheapest levitra prices discount viagra online viagra where to buy zithromax buy cheap acomplia purchase viagra accutane for sale generic acomplia cheap viagra no prescription compare viagra prices generic zithromax buy clomid online propecia cheap levitra prescription buy clomid cheap viagra in malaysia acomplia pharmacy acomplia for sale order viagra cheap online online viagra buy acomplia without prescription lowest price soma discount cialis online lasix prices cialis cheapest price cheap accutane online buy synthroid without prescription find cialis without prescription accutane without prescription buy acomplia cialis cheap cheap viagra from usa online cialis clomid discount cheap cialis in usa soma online cheap cialis without a prescription where to buy soma purchase propecia online cialis sale buy cheap soma find viagra online cheap soma online cialis free sample lowest price viagra buy cialis on line viagra from canada online pharmacy cialis levitra drug viagra online purchase drug cialis buy zithromax online buy propecia lasix pharmacy accutane generic clomid online cheap soma prices synthroid levitra generic order viagra from us purchase accutane lasix discount cheapest cialis cheap cialis pill find discount viagra online lowest price for viagra accutane prices acomplia generic cheap cialis tablet synthroid pills viagra pharmacy online viagra overnight synthroid pharmacy viagra online stores buy discount viagra online levitra online certified viagra cheap viagra in canada cheapest propecia prices order viagra without prescription clomid sale price of viagra cialis cost lowest price synthroid purchase cialis buying generic viagra lasix pills generic accutane buy cheap soma online buy lasix cheap cialis online review purchase cialis overnight delivery soma for sale cheap viagra on internet lowest price cialis cheap viagra from uk buy generic lasix buy cheap lasix order levitra cialis without prescription cialis prices buy viagra no rx buy cialis no rx purchase zithromax online best price cialis cialis in uk buy discount cialis online propecia prescription cialis discount purchase lasix propecia sale order discount cialis viagra prices discount synthroid buy generic cialis soma online buy generic viagra online buy cialis from india cheap viagra pharmacy buy synthroid online online levitra order cheap viagra cost cialis cheapest cialis price cialis us acomplia without a prescription order cialis cheap generic zithromax cheap levitra cheap cialis without prescription cheapest viagra prices cheap cialis from canada zithromax pills zithromax generic buy viagra internet drug cialis online purchase compare viagra prices online buy cialis from us cialis tablets generic viagra online buy cheap viagra internet lasix prescription drug viagra accutane discount buying cialis online cheap soma order clomid buy generic acomplia cialis online without prescription price of levitra buy levitra online acomplia without prescription cialis rx buy propecia online buy cheap accutane price of synthroid synthroid prescription viagra online cheap synthroid online order propecia order synthroid online soma without a prescription viagra free delivery buy cialis without prescription purchase synthroid discount cialis without prescription buy viagra overnight delivery order acomplia online approved cialis pharmacy cialis uk order generic cialis buy propecia cheap cialis in bangkok clomid for sale zithromax pharmacy viagra online cheap order cheap cialis online pharmacy viagra buy cheapest cialis online order generic viagra cheap cialis overnight delivery buy cheap viagra find cheap cialis buy zithromax without prescription buy viagra on line tablet cialis purchase zithromax cialis in australia lowest price clomid overnight cialis cialis in us clomid without prescription cialis overnight delivery cheap lasix cheap synthroid cheapest lasix cheapest soma prices viagra cheap cheapest lasix prices find cialis on internet order viagra no prescription zithromax online compare cialis prices find cheap viagra online generic lasix discount propecia acomplia no prescription generic cialis online cheap viagra tablets order viagra buy soma cheap propecia for sale generic viagra cheap cheap propecia tablets cheap generic acomplia viagra bangkok discount viagra without prescription levitra prices cheapest accutane propecia online zithromax online cheap lasix sale where to buy lasix buy cheap synthroid online price of lasix price of acomplia find viagra no prescription required viagra online without prescription low cost cialis cheap zithromax propecia cheap acomplia online order cialis cheap online cheap cialis cialis bangkok lowest price for cialis cialis no online prescription cheap cialis pharmacy cialis canada buy accutane cheap cialis from uk viagra sales cialis from india order cialis without prescription order discount viagra order accutane find discount viagra order cialis no rx cialis prescription buy propecia without prescription cheap zithromax online cheap viagra pill buy cheap propecia purchase acomplia buying generic cialis cialis online pharmacy buy viagra online cheap buy cheap levitra online viagra for order cheap cialis in uk acomplia online generic clomid zithromax sale where to buy clomid buy viagra viagra without a prescription buy lasix online purchase propecia cheap cialis no rx viagra side effects order cheap cialis online cialis online cheap cialis drug online propecia generic cialis cheap cialis buy viagra no prescription required accutane pharmacy viagra discount buy soma online order viagra online propecia pharmacy accutane without a prescription levitra without prescription discount accutane cheapest viagra viagra no rx required buy cialis buy viagra cheap order no rx cialis cheapest cialis online purchase levitra cheapest zithromax lasix without a prescription zithromax order no rx viagra buy viagra lowest price cialis vendors cialis in malaysia cheapest generic cialis online cheap viagra buy discount cialis cialis from canada buy soma cialis malaysia levitra pharmacy synthroid no prescription cheap cialis tablets price of zithromax order cialis in canada discount soma order cialis overnight delivery soma cheap zithromax prescription order discount viagra online viagra from india propecia generic buy cheap cialis internet viagra buy viagra uk acomplia online cheap order acomplia cialis buy drug buy cheap lasix online levitra without a prescription cialis free delivery online acomplia where to buy cialis pharmacy viagra accutane online cheap cheapest generic viagra online purchase accutane online lowest price accutane buy viagra online generic soma lasix no prescription propecia without a prescription synthroid discount cheap generic accutane viagra sale viagra pill discount viagra no rx viagra free sample no rx viagra lasix online cheap order cheap viagra online viagra order lasix free viagra clomid pills buy cheap acomplia online propecia prices buy levitra without prescription price of accutane buy cheap viagra online lowest price zithromax soma find cialis find discount cialis order viagra no rx tablet viagra viagra buy online order synthroid viagra no online prescription soma prescription lowest price acomplia cheap viagra overnight delivery cheap acomplia discount viagra find viagra without prescription synthroid for sale acomplia prescription purchase synthroid online cialis information soma pills order lasix viagra no prescription lasix without prescription accutane pills purchase acomplia online zithromax online stores cheapest soma viagra cheapest price compare cialis prices online cheap viagra tablet order cialis online buy acomplia online cheap synthroid tablets viagra canada cialis no prescription viagra information price of propecia buy cialis generic order soma online order discount cialis online cheap generic lasix purchase viagra without prescription viagra vendors cialis medication order viagra overnight delivery viagra no rx overnight viagra cheap cialis online clomid prices cheap accutane buy viagra from india cialis tablet cheap viagra no rx viagra rx buy accutane online find no rx cialis buy generic cialis online cheap viagra without prescription cheapest propecia buy cheap propecia online levitra online cheap order viagra from canada accutane no prescription soma discount cheapest synthroid generic levitra cialis price online clomid generic cialis fda approved viagra purchase cialis no rx cialis without rx cheapest acomplia buy levitra pharmacy cialis accutane online stores soma online stores buy cialis from canada clomid generic propecia pills synthroid prices cheapest generic viagra buy cheap levitra buy cialis cheap buy cialis no prescription required viagra without prescription cheap generic soma accutane online buy viagra from canada find cialis online cialis no rx discount levitra buy cialis online cheap order cialis from us viagra in us buy cheap cialis online cialis for sale cheap price cialis cialis buy online order zithromax online fda approved cialis generic propecia viagra malaysia cheap cialis from usa buying cialis generic synthroid viagra medication propecia discount cheap generic cialis soma pharmacy levitra discount cheap generic propecia viagra for sale soma sale online zithromax acomplia cheap viagra from canada buy generic propecia viagra in bangkok buy cheap zithromax online cheap generic levitra cheap price viagra buy cheap cialis cheap cialis in canada buy generic soma cheap soma tablets viagra prescription lowest price levitra buy viagra from us cialis internet buy cheapest cialis buy viagra in us buying viagra cheapest viagra online viagra overnight delivery purchase soma clomid no prescription cialis pill cheap generic viagra levitra sale order viagra in canada viagra drug synthroid cheap order zithromax cialis cheap price buy cialis on internet cost of viagra clomid online

As I was testing the functionality of the user based workflow status reporting API that I posted about recently, I discovered that the Javascript API for workflow in Alfresco only enabled viewing workflow related information for the authenticating user.  I however would like to enable monitoring by other users who are either administrators or members of a designated group, such as a “Managers” group of users who will monitor workflow statistics.  Fortunately, there is a convenient way to handle this thanks to the magic of the Spring Framework (upon which Alfresco is built).

As described on the wiki, you can add custom Javascript APIs that are backed by Java implementations.  In fact, it is via this mechanism that the documented Javascript API is exposed.  But for our workflow status reporting scenario, we want to replace the implementation of the exposed “workflow” object with an implementation that allows for our new authorization requirement.  Therefore we need to find where the current “workflow” object is configured.  A simple grep command revealed that this object (along with all of the others) is configured via the script-services-context.xml Spring configuration file, which has the following bean entry for workflow:

    <bean id="workflowScript" parent="baseJavaScriptExtension"
            class="org.alfresco.repo.workflow.jscript.WorkflowManager">
        <property name="extensionName">
            <value>workflow</value>
        </property>
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>

Ideally, we would want to have all of the current capabilities that the WorkflowManager class already implements plus whatever our extension class would add to it via the ‘workflow’ object (including handling for our new authorization requirement in this case).  For some reason though, which I chose not to investigate thoroughly, extending an existing class intended for exposure via Javascript isn’t working the way I would have expected (see here for the JIRA report I filed about it).  Only the new public methods in my class were being exposed, despite the extension of the existing WorkflowManager class.

Since it’s not terribly critical though, we’ll just build a new class and expose a new object via Javascript.  We’ll call it WorkflowStatusManager and configure it via Spring as follows:

    <bean id="workflowScript" parent="baseJavaScriptExtension"
            class="org.alfresco.repo.workflow.jscript.WorkflowStatusManager">
        <property name="extensionName">
            <value>workflowstatus</value>
        </property>
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>

Now we’re free to add parameterized accessors for assigned tasks and completed tasks (where the parameter will be the user authority for which to obtain results for).  As you can see, this class will have a reference to the ServiceRegistry from the Alfresco Java API, which can be used to gain access to a variety of services, including the WorkflowService which will be used in this case.

One addition that I’m considering adding into the Spring configuration would be a property to set the name(s) of the group(s) that should have access to other users’ workflow data.  If you have ideas for other workflow status reporting capabilities to expose to Javascript, please share!

Alfresco Workflow Status Reporting Design

Tuesday, May 12th, 2009

Now that I’ve had a chance to dig into implementing some of the workflow status reporting capabilities, it’s time to get a little more specific.  First, let’s take a look at the architecture.

workflow_status_architecture1

As you can see from the image above, the workflow reporting web scripts will run on the Alfresco server, exposing information via JSON (and/or other formats) to other presentation layer technologies like Alfresco Share, JBoss Portal, etc.  Later on in this process Share dashlets or JSR-168 portlets can be written to consume and present the exposed data.

Because a lot of workflow information is already exposed via the Workflow JavaScript API, I’ll use JavaScript backed web scripts to expose the data as appropriate for the reports I want to generate.  I suspect that as I progress further, I may need to extend the workflow service at the Java level to expose additional workflow information.  If/when that happens, I’ll have a couple of choices for exposing that new information:

For now though, I need to flesh out what the API will look like.  At this point I’m assuming that most custom workflows will extend the out of the box models, and will thus have certain metadata available for extraction and reporting.  Note that only JSON will be exposed for now.  Exposing XML, RSS, ATOM, or even an HTML representation of the data is easily possible though by using the Alfresco web scripts templating capabilities.

User

Returns current and historical workflow information for the authenticating user.  It’s also possible to request another user’s workflow information via the id parameter.

URL

http://yourhost:8080/alfresco/service/api/workflow/status/user.format

Formats

JSON

HTTP Method(s)

GET

Requires Authentication

Yes, as the user for which workflow information is being requested or as an administrative role otherwise

Parameters

  • id.  Optional.  Specifies the id of the user whose workflow information is being requested.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json
  • startDate.  Optional.  Specifies the start date after which to retrieve workflow information.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json?startDate=01-01-2008
  • endDate.  Optional.  Specifies the end date before which to retrieve workflow information.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json?endDate=12-31-2008 or http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json?startDate=01-01-2008&endDate=12-31-2008
  • timePeriod.  Optional.  Specifies the time period to use to delimit data, for example in a table or graph.  The value must be one of {daily, weekly, biweekly, bimonthly, monthly, quarterly, biannually, annually}. When specified, this parameter must be accompanied by either startDate, endDate, or both
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json?startDate=01-01-2008&endDate=12-31-2008&timePeriod=monthly
  • taskName. Optional. Specifies a taskName to filter by. Workflow information related to any other task will NOT be included if this parameter is specified.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/user/brobinson.json?taskName=wf:reviewTask
  • sortBy.  Optional.  Specifies the parameter to sort by.  Must be one of {taskName, priority, duration, status, percent, dueDate, created, description}.
  • showProperties.  Optional.  Specifies whether task properties should be included in the output for every task.

Response

{
      user: "brobinson",
      assignedTasks: [
            {
            	name: "wf:reviewTask",
                description: "Take a look",
                priority: 3,
                due: null,
                percent: 0,
                completed: null,
                status: "Not Yet Started",
                duration: null,
                created: "2009-05-12 10:25:52.51",
                properties: [
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}startDate",
                            value: null
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup",
                            value: "edit_package_item_actions"
                        },
						{
                            key: "{http://www.alfresco.org/model/bpm/1.0}completionDate",
                            value: null
                        },
						{
                            key: "{http://www.alfresco.org/model/bpm/1.0}percentComplete",
                            value: 0
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}context",
                            value: "workspace://SpacesStore/707f218a-0967-4ebc-9bb4-872e9cb67597"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}priority",
                            value: 3
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}pooledActors",
                            value: "[]"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}package",
                            value: "workspace://SpacesStore/f602c326-ea5f-40f0-91b4-21f27249aff7"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}packageActionGroup",
                            value: ""
                        },
                        {
                            key: "{http://www.alfresco.org/model/content/1.0}owner",
                            value: "admin"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}dueDate",
                            value: null
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}hiddenTransitions",
                            value: ""
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}description",
                            value: "Take a look"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}outcome",
                            value: ""
                        },
                        {
                            key: "{http://www.alfresco.org/model/content/1.0}created",
                            value: "2009-05-12 10:25:52.51"
                        },
                        {
                        	key: "{http://www.alfresco.org/model/bpm/1.0}status",
                            value: "Not Yet Started"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}taskId",
                            value: 6586373
                        }
                  ]
            }, ...(truncated)...
      ],
      completedTasks: [
            {
            	name: "wf:submitReviewTask",
                description: "Hey, take a look at this, will you?",
                priority: 3,
                due: null,
                percent: 0,
                completed: "2009-04-15 16:22:49.808",
                status: "Completed",
                duration: 17.468,
                created: "2009-04-15 16:22:49.128",
                properties: [
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}startDate",
                            value: null
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup",
                            value: "start_package_item_actions"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}completionDate",
                            value: "2009-04-15 16:22:49.808"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}percentComplete",
                            value: 0
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}context",
                            value: "workspace://SpacesStore/6c5bf7d2-806c-4f04-99bc-3a4b84ed7073"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}workflowDueDate",
                            value: null
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}priority",
                            value: 3
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}pooledActors",
                            value: "[]"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}package",
                            value: "workspace://SpacesStore/6c5bf7d2-806c-4f04-99bc-3a4b84ed7073"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}packageActionGroup",
                            value: "add_package_item_actions"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}assignee",
                            value: "workspace://SpacesStore/9a4684c8-18ef-4f3e-a119-e5bb08c9da52"
                        },
                        {
                            key: "{http://www.alfresco.org/model/content/1.0}owner",
                            value: "admin"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}workflowPriority",
                            value: 2
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}dueDate",
                            value: null
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}hiddenTransitions",
                            value: ""
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}description",
                            value: "Hey, take a look at this, will you?"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}outcome",
                            value: ""
                        },
                        {
                            key: "{http://www.alfresco.org/model/content/1.0}created",
                            value: "2009-04-15 16:22:49.128"
                        },
                        {
                            key: "{http://www.alfresco.org/model/bpm/1.0}status",
                            value: "Completed"
                        },
                        {
                        	key: "{http://www.alfresco.org/model/bpm/1.0}taskId",
                            value: 2785280
                        },
                        {
                        	key: "{http://www.alfresco.org/model/bpm/1.0}workflowDescription",
                            value: "Hey, take a look at this, will you?"
                        }
                  ]
            }, ...(truncated)...
      ]

}

Group

Returns current and historical workflow information for the identified group

URL

http://yourhost:8080/alfresco/service/api/workflow/status/group.format

Formats

JSON

HTTP Method(s)

GET

Requires Authentication

Yes, as an administrative role

Parameters

  • id.  Required.  Specifies the id of the user whose workflow information is being requested.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering
  • startDate.  Optional.  Specifies the start date after which to retrieve workflow information.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering&startDate=01-01-2008
  • endDate.  Optional.  Specifies the end date before which to retrieve workflow information.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering&endDate=12-31-2008 or http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering&startDate=01-01-2008&endDate=12-31-2008
  • timePeriod.  Optional.  Specifies the time period to use to delimit data, for example in a table or graph.  The value must be one of {daily, weekly, biweekly, bimonthly, monthly, quarterly, biannually, annually}. When specified, this parameter must be accompanied by either startDate, endDate, or both
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering&startDate=01-01-2008&endDate=12-31-2008&timePeriod=monthly
  • taskName. Optional. Specifies a taskName to filter by. Workflow information related to any other task will NOT be included if this parameter is specified.
    • Example: http://yourhost:8080/alfresco/service/api/workflow/status/group.json?id=Engineering&taskName=wf:reviewTask
  • sortBy.  Optional.  Specifies the parameter to sort by.  Must be one of {taskName, priority, duration, status, percent, dueDate, created, description}.
  • showProperties.  Optional.  Specifies whether task properties should be included in the output for every task.

Response

To be implemented, but is intended to contain tasks assigned to group members, group pooled tasks (which are by definition unassigned), and completed tasks, all of which will have the following fields associated with each task: taskName, priority, duration, status, percent, dueDate, created, description.

Task

Returns current and historical workflow information for the identified task.  Further details TBD.

Workflow

Returns current and historical workflow information for the identified workflow.  Further details TBD.

If you have any feedback on what I’ve presented so far, as always, please speak up.

Reblog this post [with Zemanta]

Alfresco Workflow Status Reporting

Monday, April 20th, 2009

As part of the Alfresco Consulting team, I’ve done some work on web scripts for reporting workflow status, keyed off of custom workflow metadata.  At the AIIM conference a few weeks ago, I was asked multiple times about Alfresco’s ability to expose workflow reports. Last week I came across a post from Kas Thomas who wondered, “Does workflow always have to suck?“, which touched on workflow reporting.  My conclusion after all of this: we need to build workflow status reporting. And I’m going to start on it.

Now there are a lot of ways in which we could build this out.  First, we need to consider the reporting context.  Do we want to report based on:

  • the system as a whole (”show me all workflow status in the entire system”)
  • web content management use (”show me all workflow status for web project X”)
  • user (”show me how user ‘bobsmith’ is involved in workflow”)
  • group (”show me how group ‘marketing’ is involved in workflow”)
  • asset type (”show me all workflow status pertaining to ‘.jpg’ files”)
  • asset (”show me all workflow status related to this particular document”)
  • path (”show me all workflow status related to assets in/under this path”)
  • workflow (”show me all status related to all instances of this named workflow”)
  • workflow task (”show me all status related to all instances of this named workflow task”)
  • something else I haven’t thought of yet (please comment here if you have other suggestions)

Since I want to get something going that will be of the most use to the most people, I’m going to start with reporting by user, then by group.  My next consideration will be exactly what to report.  I have not used any other workflow software besides Alfresco, so if you’ve got input on this, I would love to hear it (please comment below).  That said, so far I’m thinking that given a user id, the report will show:

  • the number of currently active workflows the user is/may be involved it (i.e. this would be inclusive of pooled tasks assigned to a group that the user is a part of)
  • the number of currently active workflow tasks the user has assigned to them

Given a user id and a date range, the report will show:

  • the number of completed tasks
  • the number of completed workflows
  • the average duration of each completed task

Better still, given a user id, date range (Jan 1, 2008 - December 31, 2008), and recurring time period (monthly), the report could show a bar chart or line graph of the aforementioned metrics.  Perhaps you can even add the ability to compare one user to another on those metrics.

A few things are notably missing so far.  Nowhere have I mentioned the ability to key off of custom workflow metadata, or report on custom workflow metadata. Perhaps the former could be addressed via the inclusion of a name/value pair that serves as a filter.  For example, providing {http://www.mycompany.com/model/my-workflow/1.0}/customId=42 could serve to filter out any workflow that does not have that custom metadata set on the workflow’s start task.  Reporting custom workflow metadata probably doesn’t make sense as part of a “by user” oriented report, but probably does make sense as part of a named workflow report.  What do you think?

Hopefully this post will drum up some food for thought, and ideally some feedback on what Alfresco users might want from a workflow reporting perspective.  Please feel free to share your thoughts on the subject by commenting here or participating in the workflow forum at http://forums.alfresco.com/en/viewforum.php?f=34.

An E-Mail Action for Workflow

Sunday, March 15th, 2009

When dealing with workflows, a commonly requested feature is the ability to have automated E-Mails sent out from the workflow.  Alfresco documents a way to do this via the AlfrescoJavaScript action, by writing some Javascript code to send out the E-Mail.  While this approach provides great flexibility, it also requires your Javascript skills to be up to par.  Wouldn’t it be great to have a specialized E-Mail action instead that could be configured via XML?  Of course it would.

Here’s a simple example of how such an action could be used:

<action class="org.alfresco.repo.workflow.jbpm.Mailer" config-type="bean">
   <to>alfresco@localhost</to>
   <from>info@alfresco.com</from>
   <subject>Content awaiting review!</subject>
   <text>New changes have been submitted and are awaiting your review!</text>
</action>

This is a bit easier to work with as a workflow author than having to code an E-Mail action being sent via Javascript. It does have some limitations though in this simple form, so let’s enhance it a little further. A few things that might be desirable include:

  • Comma and/or semicolon separated E-Mail addresses
  • Variable resolution of E-Mail addresses
  • Variable resolution of task assignee E-Mail addresses (bpm:assignee)
  • Variable resolution of multiple task assignee E-Mail addresses (bpm:assignees)
  • Variable resolution of task group assignee E-Mail addresses (bpm:groupAssignee)
  • Variable resolution of multiple task group assignee E-Mail addresses (bpm:groupAssignees)
  • Variable resolution within the subject and body text

By implementing an Alfresco jBPM action to handle these various requirements, one could ultimately specify a quite dynamic E-Mail action, such as the following:

<action class="org.alfresco.repo.workflow.jbpm.Mailer" config-type="bean">
   <to>bob@example.com, ${bpm_groupAssignees}, ${somewf_somePersonsEmail}, jane@example.com</to>
   <from>info@alfresco.com</from>
   <subject>Content awaiting review!</subject>
   <text>New changes have been submitted and are awaiting your review!</text>
</action>

Further enhancements could include leveraging E-Mail templates already registered with the repository.  To get your hands on an implementation of the E-Mail action described here, see improvement ALFCOM-2555 in Alfresco’s JIRA.  If you have suggestions for how to further improve this simple extension, please comment here!

Reblog this post [with Zemanta]