0

I need get the system fields before launching the workflow to make them available for user to set.fields like F_subject and F_Comment

filenet.vw.api.VWWorkflowDefinition workflowDefinition = vwSession.fetchWorkflowDefinition(-1, workClassName, true);
filenet.vw.api.VWFieldDefinition []fieldDefinitions = workflowDefinition.getFields();

used calling getFields method on the workflowdefinition in above code it is returning F_trackers only

I can made those fields by hard coding but I doesn't like that. Need help regarding this

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
sagar
  • 112
  • 9

1 Answers1

3

Did you try getting step element parameters? For example, when launching workflow:

VWStepElement stepElement = vwSession.createWorkflow(workflowName);
stepElement.getParameters(VWFieldType.ALL_FIELD_TYPES, VWStepElement.FIELD_USER_AND_SYSTEM_DEFINED);
ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
  • I don't want to launch the workflow for getting the parameters,i need it before launching workflow – sagar Feb 02 '13 at 03:54
  • The code above does not launch workflow. Workflow is launched when you do stepElement.doDispatch() – ᄂ ᄀ Feb 02 '13 at 08:23
  • Create Workflow--- Launches a workflow defined by a transferred workflow definition, as specified by the workflow version or the workflow definition name (work class name). please go through it – sagar Feb 02 '13 at 09:21
  • 1
    The call vwSession.createWorkflow() only starts the procedure of launching workflow. It does not actually create an instance of workflow, as this call does not persist anything to Process Engine. Changes are persisted when you call stepElement.doDispatch(). The quote from documentation that you provided might be a bit misleading. I described how the code above works in practice. You can verify this yourself, as you won't get workflow instance created in Process Engine just by calling vwSession.createWorkflow(). – ᄂ ᄀ Feb 02 '13 at 11:30
  • thank you @fnt checked the event log no event has been fired then what exactly launch means – sagar Feb 03 '13 at 07:32
  • 2
    As I noted, the documentation is somewhat misleading in this regard. Launching usually means creating a new workflow instance, but it requires two calls when it comes to coding. Like many operations in Process Engine API, vwSession.createWorkflow() requires additional call to persist changes. – ᄂ ᄀ Feb 03 '13 at 11:04