Taming the Shark

Questions and Answers


Table of Contents

General
Process definitions, repositories
Tool agents, scripting
Process instances, execution
Database,...

General

Q:. Is there any means for suggesting additional Q&As?
Q:. Does Shark (both Admin and Client) run under a J2EE appserver?
Q:. Can Reports be generated by using Shark?
Q:. While connecting, sometimes I can login ,but sometimes can not! It says Invalid username or password. Why?
Q:. Regarding the usage of Shark Swing Client.
Q:. What's the difference between Impl class and Wrapper class?
Q:. Why there are two set of interface for WfPrcessIterator and WfActivityIterator?
Q:. Many similar packages/classes confusion.
Q:. How can I build a workflow-driven distributed application, with workflowrunning on a (web-)server somewhere, and worklist clients in a browsersomewhere else (local network and/or internet)?
Q:. I want to define on a sub-flow some Extended Attributes, but how can I access them?
Q:. Did Shark implement the WAPI and where is its documents and sources about WAPI?
Q:. What's the role of AssingmentManager interface?
Q:. SharkTransaction versus java transaction api
Q:. CORBA, JSP, POJO, ... what about J2EE application?
Q:.

Is there any means for suggesting additional Q&As?

I'm sure I can think of some - perhaps I'll just send them as suggestions to the mailing list as/when I think of them (... I'll start with, maybe "How do I contribute to this FAQ" should be added ;).

A:.

Usually, a question contains part of the answer :)

  • Send a suggestion to the mailing list

  • Send a patch against the input/doc/Shark/faq.xml docbook file in Shark source tree.

  • Ask an interesting question on mailing list, be happy enough to have someone answer it, and patient enough to get it into this list. :)

Q:.

Does Shark (both Admin and Client) run under a J2EE appserver?

A:.

We currently have example of shark used from JSP application, Swing application and through CORBA (shark is used from CORBA wrappers that implement CORBA interface, and clients access the server through this CORBA interface).

Shark should be able to work in any environment, like in EJB container, but you need to write some wrappers around shark (as CORBA server did). However, Admin is not the part of engine, but a client application showing the engine capabilities. We have two kind of admin applications - one using shark directly (this is example of using shark from Swing application), and other CORBA Admin communicating with Shark CORBA server.

Q:.

Can Reports be generated by using Shark?

Our requirement is to query either a table/memory and generate reports based on the status of all activities, whether finalized or in progress, so is there any 'state capturing mechanism' that Shark offers?

A:.

You can perform various queries on shark by using its standard OMG client interface. I.e. you can search for the process instances for a definition whose state is closed, you can search for all activities from a process instance that are in state "open.running", ...

You can read OMG spec. It defines possible queries, and we extend the possibilities a little by including queries by definition Ids.

Q:.

While connecting, sometimes I can login ,but sometimes can not! It says Invalid username or password. Why?

A:.

If you are using local admin application (started by runSA script), for the first time you can log-on as you like (i.e. username=shark, pwd=s), but when you are again logging in shark, you must enter the same password. If you are using CORBA admin application, you have to log-on fist time as [admin,enhydra].

Q:.

Regarding the usage of Shark Swing Client.

I've taken a look of the source code of SharkSwingClient. It seems only the client side needs a Shark Server to connect to, right?

A:.

The SharkSwingClient does not need server - it is a swing application using shark as a library. The similar application can be found in SharkJSPClient module - it also uses shark as a library. On the other side, in module SharkCORBA\Client you can find CORBA client that needs Shark CORBA server.

Shark CORBA server is a wrapper around shark interfaces (it also uses shark as a library), and implements its own CORBA interfaces (which are similar to Shark POJO interfaces) which are provided to CORBA clients to access it.

Q:.

What's the difference between Impl class and Wrapper class?

There are object implementation classes such as WfProcessImpl, WfResourceImpl, WfProcessMgrImpl, WfActivityImpl, WfAssignmentImpl, WfResourceImpl. Also the seperately Wrapper: WfProcessWrapper, WfResourceWrapper, WfProcessMgrWrapper, WfActivityWrapper, WfAssignmentWrapper, WfResourceWrapper In the persitent layer,there are also pojos. Then what's the consideration when design these three level objects ? For flexibility?

A:.

Yes, thanks to these three-level object design, shark is very flexible and configurable:

* Wrapper objects are protecting core shark kernel objects from a client - client never gets the shark memory, just a wrappersaround in-memory objects. Thanks to them, shark can also use so called "External transactions" (the ones that can be used inexternal client app and in shark), they will also serve when we define security API to prevent some users of doing unallowed stuff,...

* Impl objects are the core of the shark's kernel, and they are actually doing the job

* In persistence layer, Activity, Process, ... objects are used for storing runtime information into DB (kernel sets/gets theruntime information to/from DB by the use of these objects)for each type of objects (wrapper, impl and instancepersistenct) there are defined interfaces, and shark can be easily configured touse one or another implementation of wrappers, impl, instpers. ...

Q:.

Why there are two set of interface for WfPrcessIterator and WfActivityIterator?

Out of curiosity, why there are two set of interface for WfPrcessIterator and WfActivityIterator (one is in package WorkflowModel, another one is in org.enhydra.shark.api.client.wfmodel) ?

A:.

One is the CORBA interace and the other is the POJO interface. So one is for a client/server application and the other is for an embedded workflow engine.

Q:.

Many similar packages/classes confusion.

Upon looking at the API, I see *many* different ways to accomplish the same task. Also, there are *many* variations of the same classes. What is the/are *de facto* way/packages/classes of Shark to use when, for example, create a process via the CORBA server as opposed to using Shark as a strickly a library? Likewise, what are the packages/classes/etc. to use when querying Shark for assignements and activities? This is very confusing and it is causing my development to progress *VERY* slowly because I find myself in trial and error.

A:.

The shark engine (library) itself has a client API, that is placed in SharkAPI module (org.enhydra.shark.api.* and org.enhydra.shark.api.client.*). You can look at to see shark architecture. Clicking on the boxes, you get an Java documentation of shark APIs, and implementations. In shark project, there are two deployments of shark that make shark a server. The first is CORBA deployment, and when accessing shark CORBAserver (which is a wrapper around shark engine) from client side, you should use this API Recently, shark also can be deployed as a SOAP service, and there is an ASAP(Wf-XML) API.

Q:.

How can I build a workflow-driven distributed application, with workflowrunning on a (web-)server somewhere, and worklist clients in a browsersomewhere else (local network and/or internet)?

In the source code of index.jsp and JSPClientUtilities.java, I see that the Shark engine is adressed using the static methods of Shark.class, that internally instantiates a Shark object. Does that mean that a whole new workflow engine is started, which has to be administered now using a kind of "JSPAdminClient"? Or is there a(magical) way to connect to a shark engine running in another JVM, started e.g. using bin\run.bat? If the first is true, does that mean that all clients (admin and worklist) have to use this single JSP?

A:.

Usually you need to build the webapp serving the client browser by yourself (or somebody else). When coding this webapp you usually encapsulate the workflow engine with your webapp, meaning that your clients don't see anything that looks like "shark". I bet they will be lucky if you do so, because shark is a workflow ENGINE, not a wonderful presentation layer with golden sparks all over. The jsp client shows the admin interface, but this is for professional users only.so what you webapp will do is start a shark engine. This engine may share the same database with many other shark instances (e.g. the swing client, or the jsp client). Of course, every toolagent or process will run in the shark instance that's currenlty using this process or toolagent. For us humans it looks like shark "processes" a workflow, but what one instance does is changing a lot of database values and call tool-agents if needed. so a "running" process is just a database entry of a process marked "running". And as a result, all other sharks using the same database can perform any action as long as a user (or application) requested it for this instance. If you want to happen a specific action on a specific server (e.g. because this server is the only one that has connection to a special service) you could write a tool-agent connecting to this server (e.g. using RMI or EJB's,or CORBA). Or you use the corba api and connect to a running shark instance (see the corba client for details).

Q:.

I want to define on a sub-flow some Extended Attributes, but how can I access them?

It seems that the Subflow is always entered automatically, independently the Start-Mode is set. I need this do have a "Subflow-Call" with a different number of variables - this should be defined in the extended Attribute-List and in the Subflow itself all given Attributes should be handled, as if they where a Variable Argument List.

A:.

Subflow activities are automatically executed by shark, and client app can't control this. Also, when you define a subflow activity in XPDL, you have to provide the actual parameters for the formal parameters of the underlying process. Recently, we introduced so called "remote" subflow activities, which will may be used along with newly defined Wf-XML internal API for the remote process calls. Such subflow activities, won't have formal parameters, but only actual ones, because the actual definition of the underlying process is on some other system. However,this doesn't solve your problem.I think you need to redesign your XPDL, or maybe to make your toolagent(s) that will be used to instantiate processes from other definitions.

Q:.

Did Shark implement the WAPI and where is its documents and sources about WAPI?

I want to Shark interact with a new client application. So I want to develop a new Tool Agent to act between Shark and the client application. IS it a right idea? So when Tool Agent interacts with Shark, it need WAPI to get the information of processs instances.

A:.

Yes, shark implemented WAPI, but through OMG object model . It is the core interface for running shark. However, we extended OMG model to provide lot of other features that could be used through Shark's ExecutionAdministration, SharkConnection, AdminMisc, ... APIs.

Q:.

What's the role of AssingmentManager interface?

The documentation of Assignment manager implementation isn't very clear. It is suggested that the standard implementation is not usefull. The History Related implementation is said to use 'extended attributes' in xpdl without some doc on what those extended attribute are. And the straight participant mapping seems less than usefull. Can somebody explain me more clearly the role of this interface. Is it, as i understood, this interface which will map xpdl participant to real user (In this case, does some implementation map a role participant to the list of users taken from the usergroup manager) or is the role of this interface completly different?

A:.

Standard implementation is useful in particular use cases when you use shark's UserGroup API along with ParticipantMapping API.HistoryRelated impl. extends standard implementation, and calculates assignments based on ext. attribs. I.e. you can set thatperformer that once executed some activity must execute such activity again if it comes again for execution in this particularprocess instance - if there is a loop in the process definition. Also, you can set that the performer of the activity has to be theone that actually performed some other activity in the process.XPDLStratight .... impl. determines the performer directly by the Id of Participant in XPDL. Also, using this last impl. you can setin XPDL that the performer of activity is some expression that will be evaluated at runtime (depending on process variables).It really depends on people's use cases which assignment manager they will use. Maybe your use case is such that you should writteyour own assignment manager impl. that will use the data provided in the assignment manager method call, and determing theassignments based on the info in your own UserGroup Database.

Q:.

SharkTransaction versus java transaction api

At several places of code, a transaction interface is used as argument. I'am quite surprised this transaction is not a transaction from the java transaction api. I doesn't seem possible to attach an other transaction to this one (for example when an activity do some database manipulations which need to be commited along with activity, or, in our case, when manipulation of the underlying process persistence mean a parallel manipulation of files in a content management repository and all need to be commited together).

A:.

SharkTransaction is an API, and you can provide its implementation. However, than you have to provide an implementation ofTransactionManager API, and of persistence layers that will use such transaction (Inst. persistence and event audit persistence ifyou configure shark to use event audits).Last year, Vladislav Pernin from OpenWide provided Hibernate implementation of SharkTransaction and all relevant APIs, and it is inshark sources although it is not compiled (the work was not finished, and had bugs that prevented shark to work properly; he had notime to finish this work, and we either didn't, nor we maintained the code; maybe one day we'll finish this work). Also, AndyZeneski from OfBiz implemented all relevant APIs that he needed for his project, and he successfully integrated shark beta2 intoOfBiz. I think he will continue his work with new shark version. However, these implementations are not included in the shark.If you use our persistence layers and our implementation of transaction, than you need to use DODS to perform the manipulation onyour data, and than you can do the shark work and DB manipulation work in a same transaction. Otherwise, you need to separate thetransactions, and to cause shark transaction to rollback if your DB manipulation transaction fails.

Q:.

CORBA, JSP, POJO, ... what about J2EE application?

You provide an admin tool which can connect to a corba interface. You also provide a JSPClient which use the shark library internally. Is it possible to have a J2EE application which use the client api internally and, at the same time, provide a corba server serving those process. This way the workflow can be used by servelts and jsp without using a corba connection (which I suppose would slow down the interactions).

A:.

You also have a Swing Admin that uses shark as a library (not through CORBA interfaces). Your approach is also possible. You canhave many shark VMs at a same time working on the same DB. In this case, you need to turn-off the caching so they can work in such cluster.

top of page

Process definitions, repositories

Q:. Cannot upload XPDL into repository.
Q:. What is pDefId?
Q:. If I have an activity, is it possible to tell which will be the next activity/activities?
Q:. About the method in class PackageAdmin that implements PackageAdministration
Q:. I have some problems with versioning in shark.
Q:. How to get workflows?
Q:.

Cannot upload XPDL into repository.

<?xml version="1.0" encoding="UTF-8"?>
<Package Id="test1"
 Name="mytest"
 xmlns="http://www.wfmc.org/2002/XPDL1.0"
 xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0 http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd">
   <PackageHeader>
      <XPDLVersion>1.0</XPDLVersion>
      <Vendor>Together</Vendor>
      <Created>2004-05-15 08:20:32</Created>
   </PackageHeader>
   <RedefinableHeader PublicationStatus="UNDER_TEST"/>
   <ConformanceClass GraphConformance="NON_BLOCKED"/>
   <WorkflowProcesses>
      ...
   </WorkflowProcesses>
</Package>
      
A:.

New shark requires that you define XPDL Script element (i.e. if your expressions are written using JavaScript syntax, you should have in your XPDL defined <Script Type="text/javascript"/>). You can look at the examples comming with shark about how they define this XPDL element.

Q:.

What is pDefId?

WfProcess proc=sc.createProcess(pkgId,pDefId); This method gives me an error. What is pDefId? I think this is the problem.

org.enhydra.shark.api.client.wfbase.BaseException: Can't create process for given definition - can't find manager
   at org.enhydra.shark.SharkConnectionImpl.createProcess(SharkConnectionImpl.java:181)
   at org.enhydra.shark.SharkConnectionImpl.createProcess(SharkConnectionImpl.java:156)
   at ManualTest.main(ManualTest.java:141)
  
A:.

If you read the JavaDoc for SharkConnection interface, you'll see that pDefId represents the Id of process definition inside the package with given pkgId, for which you want to instantiate the process. I.e., XPDL could look something like:

<Package Id="test" ....>
.....
.....
.....
    <WorkflowProcess Id="proc1" ...>
.....
.....
    </WorkflowProcess>
.....
....
....
</Package>
     

and if you call SharkConnection.createProcess("test","proc1") the instance of this process will be created (of course, the package had to be loaded into shark previously).

Q:.

If I have an activity, is it possible to tell which will be the next activity/activities?

I don't mind if it's an AND split or an OR split, I just want to know what might be the next tasks ?

A:.

Shark doesn't provide such feature - you have to parse XPDL to find out next possible activities.

Q:.

About the method in class PackageAdmin that implements PackageAdministration

In the class PackageAdmin that implements PackageAdministration , the method private String openPackage(RepositoryTransaction t, String id, String relativePath) open the package specified .when I read the code ,I find It open the package three times in sequence: First:

Package pkg = xpdlManager.openPackage(relativePath, false);

Second:

pkg = xpdlManager.openPackage(pkgIdWithVersion, true);

Third:

pkg = xmlInterface.openPackage(pkgIdWithVersion, true);

here the variable pkgIdWithVersion is defined as:

String pkgIdWithVersion = SharkUtilities.createPkgIdWithVersion(pkgId, repMgr.getNextVersion(t, pkgId));

I don't know why do it this way. The first can be executed correctly,but the last two can not work at all,because the package specified by the pkgIdWithVersion of course can not be found.

A:.

Shark has possibility of package versioning. When you load some package into shark, it automatically gets a version, and then you can update this package, and after that you'll have (from client's point of view) two packages with the same Id but different version. However, shark internally handles this packages as the packages with a different Ids (Id is created as combination of XPDL defined package Id and automatically generated package version).Shark uses a code for opening packages (xpdlManager.openPackage()) several times in order to validate package and its external packages, and only if they are valid to load it into memory.

Q:.

I have some problems with versioning in shark.

  1. After package updating i have two package versions but with the same package id. How can I create process from the first package version? I didn't find API with version parameter. Currently I use: createProcess(java.lang.String pkgId, java.lang.String pDefId) method in SharkConnection class.
  2. How can I get data (org.enhydra.jawe.xml.elements.Package object) of particular package version?
  3. Is it shark use package version number defined in xpdl or has own independent versioning?
A:.
  1. You can use the version of WfProcessMgr that correspond to the first version of the Package (In our implementation, versionnumbers are starting with 1), and create process by using WfProcessMgr.create_process(WfRequester) (you can use null for therequester).
  2. You can't get the Package object from shark interface. What you can do is to get the byte[] representing the Package (in current CVS version, only the current version of Package can be retrieved, but in the next update, you will be able to get any version).
  3. Shark has an independent versioning (Version element of the Package is not mandatory attribute).
Q:.

How to get workflows?

Is there a possibility to obtain a list of all workflows defined in an XPDL file? At the moment I parse the XPDL file looking for the "WorkflowProcess" tags.

A:.

If you know the Id of the XPDL file, you can do the following using ExecutionAdministration interface (after calling connect method):

   WfProcessMgrIterator pmi=ea.get_iterator_processmgr(); // ea is ExecutionAdministration
   String query="packageId.equals(\""+pkgId+"\")";
   pmi.set_query_expression(query);
   WfProcessMgr[] mgrs=pmi.get_next_n_sequence(0);
					

WfProcessMgr objects correspond to WorkflowProcess definitions from XPDL. You can further use WfProcessMgr to instantiate the process instance. You can also get the WorkflowProcess definition Id or Name attribute using AdminMisc.getProcessMgrProcDefId(mgrname) and AdminMisc.getProcessMgrProcDefName(mgrname), where mgrname can be retrieved using WfProcessMgr.name()

top of page

Tool agents, scripting

Q:. In version beta2, where can I store this procedures?
Q:. How to invocate and intergrate a system application which is developed by VB,VC,Delphi. This system application is also compiled to .exe file?
Q:. Is it possible to start ToolAgent in any other cases than when starting AUTOMATIC activity?
Q:. What expressions are supported?
Q:. Executing ToolAgent on the client
Q:. Is there any was I can have the original object supplied to me?
Q:. Variables filtering
Q:.

In version beta2, where can I store this procedures?

In Shark beta1 version there was a folder named "storedprocedures" to store the aditional .class or .java that a process uses.

A:.

There are no longer stored procedures, but now we use ToolAgent concept (you can read about it in docs). You can find a JavaClassToolAgent which acts similar like previous "storedprocedures".

Q:.

How to invocate and intergrate a system application which is developed by VB,VC,Delphi. This system application is also compiled to .exe file?

Maybe, I can say it more simple, this is how invocation of .EXE file works in the shark. I think it has its actual value in the actual workflow process. Can you help me?

A:.

Standard shark distribution comes with a ToolAgent called RuntimeApplicationToolAgent. It is supposed to execute system application (under Windows .exe application), and it can do it synchroniously (by waiting for application to finish, and then finishing activity), or asynchroniously (by starting application and finishing the activity). RuntimeApplication tool agent assumes that the application is on your system path, or that you've given the full path to application when performing its mapping (or in its extended attributes). In our test-JavaScript.xpdl example, you can see that we have defined a Package level Application called notepad. If in an existing process you add activity whose tool is a notepad application, the Windows notepad will be started when this activity comes to execution. Similar to that, you can specify an XPDL Application definition and map it (or specify its extended attributes) to some VB, VC,Delphi, ... .exe file. Of course, you must be aware that these applications will be started on the machine where the shark is running.

Q:.

Is it possible to start ToolAgent in any other cases than when starting AUTOMATIC activity?

Eg. with activity state transitions (activate/suspend/resume)? WfMC reference model mentions also other possibilities than starting an activity, but it's left to implementation.

A:.

The ToolAgent can be started when starting AUTOMATIC "Tool" activity (with Start/Finished modes set to AUTOMATIC), or when finishing Tool activity, whose Start mode is MANUAL (you can define Tool activity with Start mode MANUAL, and Finish mode AUTOMATIC, and in that case, this activity will appear in your worklist, and when you complete it, the Tool defined will be executed by ToolAgent). There are no other possibilities to start ToolAgent in shark.

Q:.

What expressions are supported?

I am trying to determine what expressions are supported in JaWE and how to write these expressions.

     A == B
     A != B
     A > B
     A < B
     A >= B
     A <= B
  

Are these all supported expressions? Can JaWE handle mathematical expressions like the following:

     (A + B) > (C + D)
  
A:.

I think that you are missing a point. You can write anything you like in JaWE - it is XPDL editor, and it does not restrict you at this point, but it is a problem what particular engine supports. I.e., shark supports a following kind of expressions: JavaScript expressions, BeanShell expressions (pure Java expressions) and Python expressions. To use i.e. JavaScript expression, your XPDL must have Script element value defined to be "text/javascript". Shark can handle (through the use of appropriate script interpreters) all of the expressions you've written.

Q:.

Executing ToolAgent on the client

Is there a way to execute a ToolAgent in the Client-VM?

A:.

Tool agents may be executed only by the shark, and not by the client applications that use shark (there is no client interface forToolAgents). Note that when you use shark as a library (not through the CORBA), you are using it in the VM of your clientapplication.

Q:.

Is there any was I can have the original object supplied to me?

I am passing a formal parameter to a java tool agent. The paramater is a mutable POJO. I would like to be able to update the POJO in this agent. However, I am passed a copy of the POJO (it looks like it has been copied through serialization). Is there any was I can have the original object supplied to me? I've tried toggling the parameter type of my application parameter, but that didn't seem to have any effect.

A:.

Tool agents always get the copy of process context. If your POJO is Clonable, than it is cloned, and if it is not Clonable, it is being Serialized/Deserialized to get its copy (of course, process variables must be Serializable).

Q:.

Variables filtering

When I get the activity process variables with the following code:

   WfActivity activity = assignment.activity();
   NameValue[] context = activity.process_context();
   for (int i = 0; i < context.length; ++i) {
      String type = WorkflowUtilities.getTypeKeyOfAnyObject(context[i].the_value);
      java.lang.Object val = WorkflowUtilities.exstractValueOfAnyObject(context[i].the_value,
                                                                        type);
      System.out.println("NameValue["+ i
                         +"] the name = "+ context[i].the_name
                         +"\nthe typecode = "+ type
                         +" the value = " + val );
   }
		     

I get all of the processes variables and not just the ones for the> specific activity currently in progress.

A:.

XPDL doesn't provide means to define which variables are specific for an activity, so Shark passes all variables from instance to all its activities.

We use some extended attributes, but these extensions are specific for our example applications - Shark kernel doesn't use any extended attribute from XPDL. For instance: in process definition: "specrelease" from test-JavaScript.xpdl activity test has extended attribute VariableToProcess_UPDATE with value status, signaling our application that this variable may be updated. This way *admin-application* "knows"to offer status variable for update.

top of page

Process instances, execution

Q:. When my process is finished, how can I remove the copy of the package xpdl from internal repository?
Q:. Does Shark offer any mechanism to store files as part of updating process variables?
Q:. Does Shark offer any mechanism to trigger alarms?
Q:. Can one activity definition instantiate several instances?
Q:. How to use WfActivity.complete() method?
Q:. How can I use a transaction in the shark?
Q:. I notice that the WfRequester is also used in these APIs. Can you show me an example to understand the WfRequester?
Q:. What should happen in case all conditions for an XOR-split will evaluate to false?
Q:. When the process is instantiated, what will happen? Which activities will be instantiated? Manual or automatic?
Q:. How can I get the process instance id and the activity instance id by assignment id? How can I get a worklist of user?
Q:. WfProcess.get_sequence_work_item(int) doesn't have an offset.
Q:. How do I find out which activity is accepted, when (date and time) and who accepted it?
Q:. Are there diferences between set_result and set_process_context methods from WfActivity?
Q:. I can't get the get() method to work on NameValue[]?
Q:. TERMINATE vs ABORT
Q:. How to obtain list of processes in a given package provided pkgID?
Q:. Shark hangs upon startup...
Q:. Can each process set a time-out option?
Q:. Does there exist a mechanism for email notification on outstanding workitems?
Q:. Iterating activities from package
Q:. Subprocess calling
Q:. I want to assign one or more Activities to a specific real Shark User and I already know that I can do this with the ParticipantMappingAdministration.
Q:. How to convert from CORBA to Java and vice versa
Q:. Is there such a state as being assigned and not accepted?
Q:. I would like of get the value of a variable in each running instance of a process definition.
Q:. How can I know which activity is active in a process instance?
Q:. How to get activities of a workflow process?
Q:. You claim to not use an additionnal thread. However, we need some workflow to do processes in the following pattern:
Q:. How do you map that group of two users to that process, I assume there is some way before you start the process ?
Q:. Accessing process variales via activity tools
Q:. Extended attribute and activity start mode.
Q:.

When my process is finished, how can I remove the copy of the package xpdl from internal repository?

A:.

IShark won't remove the packages for which there are process instances in DB (and by standard configuration, finished processes are not removed from DB), and if there are dependences on the package from some other package (External packages XPDL concept). If you want to be able to unload packages, you can do it in two ways:

  • you can configure shark to remove finished processes from DB, and this is something you can do if you set configuration parameter DODSPersistentManager.deleteFinishedProcesses to true (if using standard Shark.config, you can find it there). In that case, as soon as there are no active processes in DB (and there are no package dependencies) you will be able to unload the package.

  • this is more suitable option: you can use ExecutionAdministration.deleteClosedProcesses() method (there are several methods with various parameters) to delete finished processes, and after that, you'll be able to unload package

Q:.

Does Shark offer any mechanism to store files as part of updating process variables?

We also have a requirement to attach files (binary) in a certain activity.

A:.

Shark can't actually use files and move it around file system, but shark can use complex variables (Java classes). I.e., you can define any Java object to be a workflow variable (through the use of XPDL ExternalReference data type), and then use it in shark (of course, this class has to be on shark's classpath). This is how you can store a file (you can have XPDL type that represents your file).

Q:.

Does Shark offer any mechanism to trigger alarms?

Say for example when a task does not get completed in a certain time frame.

A:.

Currently, shark has LimitAgent interface and two implementations (one contributed by Andy Zeneski) that checks process/activity limits, and this simple implementations only log to console if limit is exceeded. One could write its own implementation that could do something more useful.

Q:.

Can one activity definition instantiate several instances?

A:.

Yes, several instances can be instantiated based on the same activity definition, and this can also be in the same process instance if you have loop defined. However, there can't be two activity instances (for the same definition) that both have "open" state in the same process instance at the same time.

Q:.

How to use WfActivity.complete() method?

I must call a method offerd by shark to instantiate a process. Shark will instantiate the first activity and complete it if it is automatic model. Then, shark will create the next activity and wait for the client application to perform some actions. When the workitem is finished, should we call the complete method to complete the activity or shark itself will complete the activity and create the next activity instance for us?

A:.

Shark will complete activity automatically only if it is Automatic activity (in XPDL definition these are: Route, SubFlow, Block and Tool activity with Automatic start and finish mode), and if it is manual activity (in XPDL definition this is No implementation activity) or partially manual activity (Tool activity with Manual start and Automatic finish mode), the client has to call WfActivity.complete() method to finish it, and after that shark will create the next activity instance, and so on...

Q:.

How can I use a transaction in the shark?

I notice that many APIs offer their two versions, one with Transcation and other without. What's the difference?

A:.

For typical shark use, you do not need to use methods with Transaction parameter. The methods with Transaction as a parameter are supposed to be used for executing several shark operations in a same transaction, by calling all of them with an "external" transaction. You can look at discussion at mailing list to see how to do that.

Q:.

I notice that the WfRequester is also used in these APIs. Can you show me an example to understand the WfRequester?

A:.

To understand WfRequester concept, please read OMG specification, and search our mail archive - there are several discussions on WfRequester.

Q:.

What should happen in case all conditions for an XOR-split will evaluate to false?

Currently it seems the execution stops there without further notice, causing the process to hang around in the db. Would it be possible to throw an exception in such case, i.e. if the end of condition list is reached?

A:.

You can see in documentation (doc\shark\shark.html) or in default Shark.conf file comments about the entry called:

     SharkKernel.UnsatisfiedSplitConditionsHandling
  

Using this configuration parameter, you can configure shark kernel how to act in such cases. The possibilities are to ignore it (to stay hanging here), to finish process if possible (if there are no other branches with active activities), and to rollback. The last option is the one you need, so you just have to set this parameter to value ROLLBACK.

Q:.

When the process is instantiated, what will happen? Which activities will be instantiated? Manual or automatic?

A:.

When the process is instantiated, the first activity will be created. If it is the manual activity, shark will stop here, and wait for client application interaction. If the first activity is automatic, it will be executed and the next activity will be created. Generally, when the process starts, or when the client application signals that manual activity is finished, shark will start all activities that come next, and execute the automatic ones until it comes to the next manual activity.

Q:.

How can I get the process instance id and the activity instance id by assignment id? How can I get a worklist of user?

A:.

The assignment Id does not exist in OMG spec. To get a worklist, you just have to call the method getResourceObject() of SharkConnection, and then call method get_sequence_work_item(0) on the WfResource object you get. This method will give you the array of WfAssignment objects. If you want to get the activity of an assignment, you can call method WfAssignment.activity(), and if you want to get the process of assignment's activity, you can do WfAssignment.activity().container(). The activity/process Ids are retrieved by calling key() method on WfActivity/WfProcess. Please look at our ManualTest.java example (in modules\SharkTests\src).

Q:.

WfProcess.get_sequence_work_item(int) doesn't have an offset.

If you specify maximum number that is greater then zero, the method will return maximal that number of appropriate objects (i.e.if there are 15 objects, and you specified 10 as max. num., you'll get an array of 10 objects), otherwise, you'll get all possible objects.

Doesn't it make sense to have an offset (int max, int offset) as well? . So one can build "result-sets". I can't really imagine a useful example for maximum only.

A:.

Well, these methods are specified by OMG spec, and we have implemented it. An example for getting the maximum value could be getting first 10 assignments, and then when they are executed, another 10, ... but I don't know how much could it be useful.

Q:.

How do I find out which activity is accepted, when (date and time) and who accepted it?

A:.

You can find who accepted an activity by AdminMisc.getActivityResourceUsername(procId,actId). If null is returned, it means that the activity is not accepted. We do not have an interface to tell you when did it happen. We could easily implement this interface (we'll put it on our TODO list), and meanwhile, you could find it out through event audits (take all WfAssignmentEventAudits for activity, find the last one, and check if is_accepted() returns true, and then extract the username by the use of new_resource_key() method).

Q:.

Are there diferences between set_result and set_process_context methods from WfActivity?

I'm using CORBA, and set_process_context is not updating any values.

Method set_process_context is working fine in WfProcess.

A:.

Out of the CVS-040416, there have been changes to this methods. WfActivity.set_process_context() is used to update activity variables, but only variables set by WfActivity.set_result() will be updated back to the process (this is how OMG spec. proposes).

Q:.

I can't get the get() method to work on NameValue[]?

I am trying to get into the variables and formal parameter stuff. In the HOWTO something like 'activity.process_context().get(vName)' is mentioned. Is that outdated or at least not being correct for CORBA-API since I can't get the get() method to work on NameValue[]?

If I ask for 'NameValue[i].the_name' I do get the name of the appropriate Variable but I can't figure out how to get the value of the Variable. 'NameValue[i].the_value' just returns some CORBA-stuff.

So, how is one supposed to get the values of the variables belonging to an instance of a process via CORBA? Is there any "easy" way to make use of the extended attributes shark uses to display or update variables via CORBA?

A:.

Here it is...

String type = WorkflowUtilities.getTypeKeyOfAnyObject (globalContext [i].the_value);
Object val = WorkflowUtilities.exstractValueOfAnyObject (globalContext [j].the_value, type);
      
Q:.

TERMINATE vs ABORT

Working with a WfProcess and reading WfMC documentation, I really cannot understand this: For a process instance, what is the differrence between terminate() and abort() ? For an activity instance, what is the differrence between terminate() and abort() ?

A:.

In OMG docs, it says that it is up to engine how will it implement this operations.In shark, terminating and aborting process is the same.On the other hand, when you terminate activity, process tries to follow to the next activity(s), and if you abort it it doesn't.

Q:.

How to obtain list of processes in a given package provided pkgID?

A:.

There is no easy way to get the list of process insances that are instantiated based on process definitions from some package, but there is what you need to do:

  1. Get WfProcessMgr objects for the given package (WfProcessMgr represents a factory for creating processes based on XPDL processdefinition), assuming that package Id is "test":

       WfProcessMgrIterator wpmi = ExecutionAdministration.get_iterator_processmgr();
       wpmi.set_query_expression("packageId.equals(\"test\")");
       WfProcessMgr[] mgrsForPkg = wpmi.get_next_n_sequence(0);
         
  2. Iterate through all process managers, and get their processes:

       List pkgProcs = new ArrayList();
       for (int i=0; i < mgrsForPkg; i++) {
          WfProcess[] procs = mgrsForPkg[i].get_sequence_process(0);
          pkgProcs.addAll(Arrays.asList(procs));
       }
          
Q:.

Shark hangs upon startup...

Hi,the only I currently know for sure is that as soon as I deleted the lock entry in the table, the process that was looping that insert-rollback statement continued. Nevertheless waiting that long time for the lock going awaydoes not make sense because JDBC meanwhile will go into timeoutand close connection, any further SQLs will fail.That "error looping" happened during startup of the engine,right after restoring processes.

A:.

It is the problem of improper shark configuration - you didn't setup DODS LockMaster properly.If you read the comments in Shark.conf file, you'll find that entry:DODSLockMaster.Timeoutdetermines how long to wait for a locked process. If this value is set to -1, it means wait forever, and this is probably your case.Also, there is another entry called:DODSLockMaster.LockWaitTimewhich determines how often will shark instance try to acquire a lock until DodsLockMaster.Timeout period has passed.If you setup DODSLockMaster.Timeout time to some positive value (let say 1000), you'll get an exception message from shark if itdoes not suceed to acquire a lock on some process during this time.

Q:.

Can each process set a time-out option?

If it failed to do in a range of time, then it would fall into some other process? Is that possible to do so in the existing system?

A:.

Yes. You can set a limit (both on process and activity), and you'll be informed if it expires. Additionally XPDL specification defines deadlines, which are implementedtoo.See (for limit example): test-JavaScript.xpdl or test-BeanShell.xpdl. For deadlines: deadlineexamples.xpdl.

Q:.

Does there exist a mechanism for email notification on outstanding workitems?

For example, as soon as there is a new workitem for me or a group I belong to, an email is sent to me. How could I implement this feature, if it is not already available?

A:.

Make an implementation of org.enhydra.shark.api.internal.eventaudit.EventAuditManagerInterface Default implementation only stores events into database, but thiscomponent IMHO fits nicely into your needs. Method public void persist(AssignmentEventAuditPersistenceInterface assea, SharkTransaction ti) throwsEventAuditException; gets called for each new assignment created.

Q:.

Iterating activities from package

Hi, we would like to iterate through all activities defined in a package. However Activity.getType() always returns 0 and start activties set is null. So I guess we did something wrong - see the code below:

   SharkInterface shark = Shark.getInstance();
   SharkTransaction t = shark.createTransaction();
   ExecutionAdministration ea =shark.getAdminInterface().getExecutionAdministration();
   PackageAdministration pa =shark.getAdminInterface().getPackageAdministration();
   AdminMisc am = shark.getAdminInterface().getAdminMisc();
   XMLInterface xm = new XMLInterfaceForJDK13();
   ea.connect(t, "admin", "enhydra", "shark", null);
   WfProcessMgrIterator im = ea.get_iterator_processmgr(t);
   List processMgrList = Arrays.asList(im.get_next_n_sequence(t, 0));
   Iterator processMgrIter = processMgrList.iterator();
   while (processMgrIter.hasNext()) {
      WfProcessMgr pm = (WfProcessMgr)processMgrIter.next();
      String mID = am.getProcessMgrProcDefId(t, pm.name());
      String mVersion = pm.version();
      String mName = am.getProcessMgrProcDefName(t, pm.name());
      String mPkgID = am.getProcessMgrPkgId(t, pm.name());
      if (!mPkgID.startsWith("X") && !mPkgID.startsWith("Y"))
         continue;
      String content = new String(pa.getPackageContent(mPkgID), "UTF8");
      Package pkg = xm.parseDocument(content, false);
      WorkflowProcess wp = pkg.getWorkflowProcess(mID);
      Set startActivities = wp.getStartingActivities();
//--------------------------^ null
      Activities acts=(Activities)wp.get("Activities");
      if (acts != null) {
         Iterator actIter = acts.toCollection().iterator();
         while (actIter.hasNext()) {
            Activity act = (Activity)actIter.next();
            int type = act.getType());
//-------------------------------^ zero
         }
      }
      ea.disconnect(t);
A:.

If you look at shark's code in PackageAdmin or at SharkAdmin's JaWE's code in EngineTreeModel, you will see that we never call xm.parseDocument(content, false); but instead of this method, we are calling method public Package openPackage(String pkgReference, boolean openFromStream). You CAN'T call parseDocument method directly, because there are a lot of things that are done in its caller method(s) that prepare XPDL objects. To properly do things, you should do following:

  1. put content of the package you want to open, and all external packages and its external packages, ...into XPDL map by using: xm.putPkgIdToFileContentMapping(pkgId,pkgContent);

  2. call: Package pkg=xm.openPackage(pkgId,true);

Q:.

Subprocess calling

We are wondering to apply Enhydra Shark in some applications here. We need to start various asynchronous subprocesses instances from a main source process instance called by a "subflow activity". The question is, how can we find information about which subprocesses were started from the main process? Though they are asynchronous, we should wait for all the subprocesses to complete before we complete the main process.We would like Shark to manage that information automatically, so that we would not have to code it in Java. Does Shark keep information about main processes and their subprocesses?

A:.

Here is explanation how can you find out which asynchronous sub-processes are started from the main process:

  1. Get all activities of the main process which are in state "closed.completed" (if you would search for synchronous subprocesses, you would search for the activities that are in state "open.running"). You can do it through the main process's WfActivityIterator:

       String query="state.equals(\"closed.completed\")";
       WfActivityIterator ai=mainProc.get_iterator_step();
       WfActivity[] acts=ai.get_next_n_sequence(0);
     
  2. Iterate through activities from previous step, and determine the ones that are the subflow activities by calling WfActivity.get_sequence_performer(0) method - that method returns an array of WfProcess objects,which size will be either 0 or 1 - if it is 1, this is a subflow activity, and the returned process is the subflow process that it instantiated.

Regarding second part of the question, I'm afraid that you have to find a way to model your XPDL in a right way and to make your client application to set some variable in the main process when asynchronous sub-processes are finished, and use that variable in transition condition to allow finishing of the main process. This is something that can't be automatically handled by shark, because shark immediatelly finishes subflow activities after instantiating their asynchronous process, and proceeds to the next XPDL activity.

Q:.

I want to assign one or more Activities to a specific real Shark User and I already know that I can do this with the ParticipantMappingAdministration.

But this is not useful in our case, because this mapping is static for defined Process, which means for all Clients, which has started that Process, this specific Assignment will occur. But I want to switch to some Users depending on the Client who has started the Process. Everything clear up to now? If yes ;-) , how can I code this? What's necessary inside XPDL-Declaration?

A:.

You can do it in several ways:

  1. Setup shark to use XPDLStraightParticipantMapping assignment manager - define the activity performers to depend on the value of some variable, that could be entered by the one who starts the process, or calculated by some tool activity. I.e. you can write expression for activity performer like:
       java.lang.String p="shark";
       if(processStarter.equals("manfred")) {
          p="sasa";
       } else if (processStarter.equals("sasa")) {
          p="manfred";}
       p;
    					   
    (in JaWE, show the always existing "Arbitrary expression" participant, put the activity there, and copy the code above in the performer field. Of course, script type defined for the package should be text/java)
  2. The most flexible implementation would be to define your own AssignmentManager, that would determine the performer on some activity based on information from both, the process variables, XPDL, and maybe from some data in your custom user DB.
Q:.

How to convert from CORBA to Java and vice versa

I am writing a BPM layer on top of shark that will be the interface to Shark for many applications that are being developed here. So I need a way to convert from CORBA to Java and vice versa.I have WRD of type java.util.LinkedList in my XPDL. I'd like to use the CORBA client because I want to connect to a server to use the deadline manager. I need to be able to pass my LinkedList to the process, but NameValue.the_value.insert_Object() *only* allows me to insert a CORBA Object and not a Java Object. How can I convert from an arbitrary Java Object to CORBA?

A:.

You have to use: NameValue.the_value.insert_Value(val); The only requirement is that the "val" is instance of a class that implements Serializable interface (and java.util.LinkedList is such class). You can also provide your custom class object as a WRD, but than both, server and client has to have it in their classpath.

Q:.

Is there such a state as being assigned and not accepted?

My client app will "assign" an activity to a user, but needs to have the user "click" on it to be accepted. Is this scenario possible or is an activity accepted the moment I assign a WfResource to it?

A:.

If you start the shark admin (look at quick start documentation), and try to execute some tasks from the worklist, you can see that you need to accept activity first, and than to complete it, and this is exactly what you need.When activity is created, several assignments to a different users can be created. Each of them can accept activity, and when (s)he does, the other user's assignments become invalid, and they can't accept it or complete an activity. If after some time the user that accepted activity rejects it,the previous user assignments again become valid, and any of them can accept it.

Q:.

I would like of get the value of a variable in each running instance of a process definition.

As I know, with processManager.context_signature() I get only the name and the type of a variable, but not the value.

A:.

You need to call "process_context" method on WfProcess instance to get the whole process context Map. The map keys are variable Ids, and map values are variable values. So, if you i.e. need to get the value of variable "status" which type is String, you can do following:

   Map m=proc.process_context();
   String status=(String)m.get("status");
				     

If you use CORBA API, you get the array of NameValue objects.You should iterate through this array, and check for the name of the variable, and get its value, i.e. the same example for that case would be (look at our CORBA client to find out more):

   String val=null;
   for (int i=0; i<nv.length; i++) {
      NameValue nv=nv[i];
      String name=nv.the_name;
      if (name.equals("status")) {
         val=name.the_value.extract_wstring();
         break;
      }
   }
		     
Q:.

How can I know which activity is active in a process instance?

A:.

To find out which activity(s) are active, you have a method on WfProcess object called get_activities_in_state(). It gives you in iterator on all activiites in which state is the one you provided to the method call, i.e.

   WfActivityIterator ai=proc.get_activities_in_state("open.running");
   WfActivity[] acts=ai.get_next_n_sequence(0);
					

gives you all the manual activities that are "accepted" and all the subflow activities that are running (and in the case you defined automatic activity to have manual end it also gives you all the Tool activities that are still running). If you use "open.not_running.not_started", you will get all Manual activities that are still not "accepted".

Q:.

How to get activities of a workflow process?

Is there a possibilty to obtain a list of all activities in a workflow or all activities assigned to a specific user? I tried resource.get_sequence_work_item(0) but this only gives the activities/assignments currently assigned to the user after the workflowstarted. In my application I need to present in an UI all available workflows in an XPDL file. After the user starts a workflow I need to present all activities in this workflow and to mark the activity currently assigned to the user. I would like to avoid parsing the XPDL file.

A:.

Through the usage of shark interface, you can get all activity instances that have ever been created, and that belong to some process instance, or the activity instances that are assigned to a certain user. However, you can't get an activity definitions for some WorkflowProcess definition using API (you can do it by the usage of JaWE or shark's XPDL module, but it's another story). Generally, you need to do the similar that our Admin application(s) does. It shows the process definition for selected process instance (using JaWE), and marks the currently active activities in this instance.

Q:.

You claim to not use an additionnal thread. However, we need some workflow to do processes in the following pattern:

  • a work is assigned to A
  • if after 30 mins A still didn't start the work, He is reminded of the work
  • if deadline for work is reached, mail must be immediately send to some responsible to fix this.

How can i make a process that send a mail at 10 o'clock if there is no thread to do it? Am i supposed to have a scheduler somewhere which will behave like a user and simply will do a given activity on a given workflow at a given moment, or is something already existing in shark for this?

A:.

You can model your activity to have a deadline set to 30 minutes after work is assigned to a user. When you model deadline, you have to model an exception transition that will lead to the next activity, which is in your case automatic activity that will send a mail to the user after deadline happens. If this is asynchronous deadline, the user's activity won't be terminated, and if it is synchronous one, it will be terminated. You can read howto and look at deadlineexamples.xpdl comming with shark to see how to use deadlines. Of course, you must have a scheduler that will use shark's DeadlineAdministration interface and will call appropriate method i.e.every 15 minutes. (Our Admin application comes with such scheduler, and you can either directly call a method for checking deadlines, or setup admin application to automatically check for deadlines).Also, as already suggested on the list said, you can use Limits to notify user, but than you must provide your own LimitAgent implementation thatwill send mails.

Q:.

How do you map that group of two users to that process, I assume there is some way before you start the process ?

1. Create two user and put them in a group using the UserGroupAdmin 2. I map these two users to two roles from an xpdl file 3. I then create a process (the process that contains these two roles mapped in 2.) and start the process. Then when john logs in and completes the first step "Dori cooks dinner", then when paul logs in he should see the step "Zsolt cooks"

   // *** 1.  Creating two new users and putting in the same group ***
   UserGroupAdministration ugAdmin = Shark.getInstance()
                                          .getAdminInterface()
                                          .getUserGroupAdministration();
   ugAdmin.createGroup(groupName,groupDesc);
   ugAdmin.createUser("TestGroup",
		      "john",
		      "poshnosh",
		      "Joe Bloggs",
		      "Joe.Bloggs@someemailaddress");
   ugAdmin.createUser("TestGroup",
		      "paul",
		      "poshnosh",
		      "Joe Bloggs",
		      "Joe.Bloggs@someemailaddress");

   // *** 2. Mapping of users to roles(from xpdl file) ***
   MappingAdministration mapAdmin = Shark.getInstance()
					 .getAdminInterface()
					 .getMappingAdministration();
   ParticipantMap[] map = mapAdmin.getAllParticipants();
   // Now loop through, find the roles you want to map the shark users
   // created in 1. above . This gets done twice for john and paul
   for (int i = 0; i < map.length; i++) {
      ParticipantMap indMap = map[i];
      if (indMap.getParticipantId().equalsIgnoreCase(role)) {
         indMap.setUsername("john");
         indMap.setIsGroupUser(true);
         try {
            mapAdmin.addParticipantMapping(indMap);
         } catch (Exception e) {
            // i promise I'll do something :)
         }
      }
   }

   // *** 3. Make a connection, create a process and start the process ***
   SharkConnection conn = Shark.getInstance()
			       .getSharkConnection();
   conn.connect(userName,
                "poshnosh" ,
                props.getProperty("enginename"),
                null);
   String pkgID = wf.loadPackage("Test_Package_16.xpdl");
   String procDefID = "Test_Package_16_Wor2";
   WfProcess proc = conn.createProcess(pkgID,procDefID);
   proc.start();
			

A:.

Do you want anybody in s particular role to pick up the activity, or do you know who's going to be your participants? If it's the latter then you can create a workflow relevant data, map it (set it) to the particular userid and then set this as the performer for that activity. For example,

   <Activity Id="doAlert_enterData" Name="Enter Data">
      <Implementation>
         <No/>
      </Implementation>
      <Performer>myParticipant;</Performer>
      <StartMode>
         <Automatic/>
      </StartMode>
      <FinishMode>
         <Automatic/>
      </FinishMode>
     <!-- other activity definition -->
   </Activity>
							       

If using JaWE, put "myParticipant;" in the participant field in the activity's properties. Also, make sure that the following is uncommented from the Shark.conf file:

   AssignmentManagerClassName=org.enhydra.shark.assignment.XPDLStraightParticipantMappingAssignmentManagerThen
		     

when you assign a userid to the myParticipant WRD, that activity will be assigned to that user. Here is the code:

   Map context = new HashMap();context.put("myParticipant", "john");
   WfProcess proc = sc.createProcess(<pkgId>, <defId>);
   //change to suit your needs.
   proc.set_process_context(context);
   proc.start();
			

Q:.

Accessing process variales via activity tools

I created an XPDL that spawns subworkflows asynchronously for many users (the list of users is passed in). The last activity (after the sub-flows in the main-flow) waits until a deadline is reached (this actually works fine), however, I want to be able to alter a variable that the waiting activity uses to evaluate the deadline. Here is what the deadline expression says:

   d=new java.util.Date();
   sdf=new java.text.SimpleDateFormat("MM/dd/yyyy h:mm a");
   d=sdf.parse(expireDate_global);
   if (allCompleted.booleanValue())
      d=new java.util.Date(System.currentTimeMillis());
   d;
					

I also had

   d=new java.util.Date();
   sdf=new java.text.SimpleDateFormat("MM/dd/yyyy h:mm a");
   d=sdf.parse(expireDate_global);
   if (allCompleted)
      d=new java.util.Date(System.currentTimeMillis());
   d;
					

"allCompleted" is a WRD. I understand that this activity has its own context/copy of the variables and that it is already started. I don't want to do callbacks to Shark from the XPDL script/tool to force this last activity to complete.Are there any new developments that address this issue? Is there a better way of accomplishing this? Currently, can an activity "re-evaluate" the variables? On a side note, if I use a circular transition and the process transitions back to the activity, will the variables be"refreshed"? If so, will the circular transition create a new activity or will it just update the original one?

A:.

Since we see that there are many use cases where one wants to use process context in (re)evaluating activity Deadlines (your and BenAnderson's use case), and we think it is useful, we'll provide configuration parameter for shark kernel. This parameter will tell kernel to use activity or process context while re-evaluating deadlines, and it'll be included the next CVS update.In current version, you can setup shark to re-evaluate deadlines or not (in latter case, it evaluates deadlines ones when the activity is created, and stores the information in DB). When the deadline re-evaluation happens, shark uses activity context variables, so currently if you change activity context before second deadline re-evaluation happens, it should reflect the calculation of deadline limit time.If you use circular transition, every time the new instance of activity is created.

Q:.

Extended attribute and activity start mode.

I noticed that the "specrelease" example process uses the "VariablToProcess_UPDATE" name. What is this used for? What is the difference between "VariableToProcess_VIEW" and "VariablToProcess_UPDATE".

A:.

The extended attributes "VariableToProcess_X" are used to indicate which workflow data should be changed in all examples. From these values within an activity, the gui knows which workflow data should be updated (VariableToProcess_UPDATE) or presented to the user for review (VariableToProcess_VIEW). This is not standard shark behaviour, it's just the way the guys from shark implemented it in their examples and in the gui. If i don't use these "Variable...." (by the way you can name it whatever you want in your app), then i need to know what to change by programming (hard-wiring) it in my code that uses and changes these activities. Using these extended attributes one can define within the activity definition what should be changed or presented, and the code just reads these extended attributes and prompts the user for review and/or new values.

top of page

Database,...

Q:. What's the relationship between UserTable and ResourcesTable?
Q:. Dods logs!
Q:. Whats's the meaning of the column CNT in the table AssignmentsTable?
Q:.

What's the relationship between UserTable and ResourcesTable?

After creating users by UserGroupAdministration.createUser(), UserTable has records about users, say "admin" and "qq". Then, if "admin" instantiates a process, it can't reassign a work item to "qq", because ResourcesTable won't have a record of "qq" until "qq" connects for the first time. Once "qq" is connected, the ResourcesTable will have the record of "qq".

So what's the relationship between UserTable and ResourcesTable? Shall they sync? Is Connecting the only way to turn a user to a resource?

A:.

The instance in the resource table is created just when needed. So, you could have a thousand users in UserTable, but none in ResourceTable. This is because shark is very configurable, and it can work without UserGroup API at all. I.e., if you turn-off UserGroup API and Authentication API, you will always be able to log-on using username and password as you like, and shark will create an instance in ResourceTable at this time. Also, you can work without MappingAPI, so each activity will be assigned to the resource that created its process.

Q:.

Dods logs!

Some time I get the info about the DODS as the following,sometimes Ican't get,why?

2003.07.26 16:43:01: databaseManager,WARNING: sql = selectProcesses.oid, Processes.version from Processes WHERE Processes.Id=1104_demo_package_task execute time = 391 max table execute time = 200

A:.

Now...

This is just a guess...

But that might be something about a query taking longer to execute than the the maximum time expected for execution. I wonder if that is in any way related to the conf setting that looks like this: DatabaseManager.defaults.maxExecuteTime=200

Q:.

Whats's the meaning of the column CNT in the table AssignmentsTable?

A:.

This column is introduced in this table and in some other tables where there is no column (or combination of two columns) that can represent the primary key. This is created in order to use the same data model with other O/RM tools than DODS (or at least to make obvious that there is no natural primary key in this specific table). When using DODS, in each table, we have additional column called OId that is always used as a primary key.

top of page

Shark developers wish to thank all participating in evaluation, testing, debugging, and finally using our little beast.